• Home
  • RSS Feed
  • Log in


Smelly Jelly to the rescue
Posted by Lars Vonk at around evening time: May 7th, 2007

For a current project I use maven 1 as build tool. I always generate the eclipse plugin for generating the .project and .classpath file because I do not want to add dependencies both in the project.xml and the eclipse classpath. The eclipse plugin can also link the source files to the dependencies in your project, I find this a handy feature because you always need to debug and step through the code of some dependency.
However since the maven 1 repository is maintained even worse as the maven 2 repository you won’t find any sources jars for the newer versions of dependencies (for instance Spring 2.0). Besides this being very annoying the eclipse plugin also takes ages to finish because it gets a lot of time-outs about not being able to download the sources jars from the maven 1 repository. That’s why I created a small Jelly script that made it is possible to traverse through the maven 2 repository and grab the sources jars from there. Here’s the smelly Jelly that made it all possible:


		
	

	
		
			
				
				

				

				
				

	 			
 			
		
	

As the maven 2 repository has a different structure I had to rebuild the complete url using all the dependency properties. This script only includes the default maven 2 repository, but with a slight modification (looping over all url’s) it can be extended with more repositories.

The add-sources goal will try to retrieve the sources jar from the maven 2 repository and install it in the local maven 1 repository. If the sources jar cannot be found it will just continue to the next one. With the postGoal you bind the add-sources to the eclipse plugin. Make sure you set the maven.eclipse.src.download to false in your project.properties (or build.properties) otherwise the eclipse plugin will still take ages to run because of all the time outs it gets from not being able to find the sources jars from the maven 1 repository.

So simply add this to your maven.xml and the sources jars will be linked again in your eclipse (don’t forget to refresh ;-) ).

Share

Tags: Eclipse, Maven
Filed under General | No Comments »



No Responses to “Smelly Jelly to the rescue”



Leave a Reply

Click here to cancel reply.


Xebia Sites

  • Xebia Corporate
  • Xebia France
  • Xebia India
  • Xebia Sweden

Categories

  • Java (311)
  • Agile (181)
  • General (136)
  • Scrum (67)
  • Architecture (64)
  • Testing (59)
  • Performance (46)
  • Middleware (56)
    • Deployment (38)
  • Xebia Labs (39)
  • SOA (31)
  • Podcast (31)
  • Project Management (28)
  • Tools (26)
  • Uncategorized (20)
  • lean architecture (20)
  • Quality Assurance (17)
  • Articles (13)
  • Requirements Management (13)
  • Virtualization (19)

Tag Cloud

    Frameworks ACT Scrum Concurrency Control Lean Maven Grails Agile Javascript agile architectuur XML Architecture Scala Groovy Oracle JPA implementation patterns Ajax Xebia Moving to India SOA TDD lean architectuur Hibernate JPA Spring lean architecture Eclipse product owner Java Flex

Archives

  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
Avatars by Sterling Adventures