Maven and Sun Jars

Old Sun jars have an irritating license that forbids public hosting. Newer jars (JAXB 2.0 and the Glassfish JEE5 work) don’t have this problem.

The workaround is download them yourself and manually install in your local repo. I just went through this for JTA (for Hibernate). Rather that force everyone to install this by hand, I’ve installed it in our internal repo. Give me a shout if you need any others added.

$ mvn deploy:deploy-file -DgroupId=javax.transaction \
-DartifactId=jta -Dversion=1.0.1B -DgeneratePom=true \
-Dpackaging=jar -Dfile=jta-1_0_1B-classes.zip \
-DrepositoryId=intelliwareReleases \
-Durl=scp://mvnrepo.intelliware.ca/data/repo/release

In addition to that you have to edit your settings.xml. In here add the following snippet in the <servers/> section:

<server>
   <id>intelliwareReleases</id>
   <username>root</username>
   <password>****</password>
</server>

If you want to install the source jar as well, run the following command:

mvn deploy:deploy-file -DgroupId=javax.transaction \
-DartifactId=jta -Dversion=1.0.1B -DgeneratePom=false \
-Dpackaging=java-source -Dfile=jta-1_0_1B-source.jar \
-DrepositoryId=intelliwareReleases \
-Durl=scp://mvnrepo.intelliware.ca/data/repo/release

As an alternative, I had to log on to our repo and create the directories for the above deploy by hand.

ssh root@mvnrepo.intelliware.ca
cd /var/www/repo/release
mkdir -p javax/transaction/jta/1.0.1B/
chown -R apache:apache javax

Now I’m proud because it worked.

From http://tapestryjava.blogspot.com/2006/01/maven-and-missing-java-transaction-api.html

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply