Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Wednesday, February 6, 2013

Maven: Could not calculate build plan: Failure to transfer

Last day a very simple thing took little while for us to resolve. I was trying to setup a new project on a machine and did not have all my environment variables setup properly.


I was trying both the command line and eclipse options interchangibly. Initially I had the wrong repository settins in settings.xml so it could not download any jars and I ended up having *.lastUpdated files all over.

Eclipse maven plugin seems to stop downloading the dependencies if it seems *.lastUpdated files. I had to remove the all the *.lastUpdated file and plugin starts to work agian.
I read same clean up can be done using mvn -U clean too.   happy reading Manisha

Wednesday, July 25, 2012

Attaching Source code with Maven

Initially I use to download the source jars and then use to attach them to project. Then started adding source jar as dependencies to pom for dev profile. Recently I found a maven command which does i it seamlessly for us.

I ran below commands to download and attach the source code of all the projects in Eclipse for me.

mvn dependency:sources

mvn eclipse:eclipse -DdownloadSources=true 

Boom! refresh all project in Eclipse and the source code must be attached to your project.                    
Enjoy looking into source
Manisha

Saturday, June 30, 2012

Remove all unused imports with one click

I am almost month old in my new company. The project I am working has 5K approx warnings and majority of them are because of unused imports and unused variables (gurrrrr). So I was looking for someway to fix these minor things using some tool and guess what I found eclipse "Organize Imports (Ctrl+Shift+O) in most eclipse" can be executed at package or project level. Bingoooooooooo resolved around half of warning. Feeling better inside :)

Choose the package -> Right click -> Source -> Organize Imports.

Now to the next job of finding the tool for unused variables. Wish me luck
Manisha