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 \
-DrepositoryId=intelliwareReleases \

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


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 \

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

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.


It's only fair to share...
Share on Facebook
Tweet about this on Twitter
Share on LinkedIn

Leave a Reply