Maven Errors in STS while working on Demo Spring Roo Project
I was trying to work on the Spring Roo Demo project @ www.springsource.org/roo/guide?w=beginning and I am using Spring Roo Shell in the STS IDE.
However, as I go through the various steps of demo project, I see that the pom.xml is created / updated by Roo. However,开发者_StackOverflow中文版 the dependencies are NOT getting downloaded.
I am not a maven expert, however, I tried the below steps to resolve the issues.
Made sure Maven is NOT working in offline mode - my looking into preferences -> maven -> offline mode not checked. I was also kind of sure about this because, maven was downloading other jars from repositories
I tried manually downloading the junit-4.8.2.jar and log4j-1.2.16.jar from the Maven Central repository to my local and tried manually installing the files using the commands
mvn install:install-file -DgroupId=junit -DartifactId=junit -Dversion=4.8.2 -Dpackaging=jar -Dfile=C:/Users/Satya/Downloads/junit-4.8.2.jar mvn install:install-file -DgroupId=log4j -DartifactId=log4j -Dversion=1.2.16 -Dpackaging=jar -Dfile=C:/Users/Satya/Downloads/log4j-1.2.16.jar
Maven told me the installation was successful on my windows command prompt, however, I did not see anything getting reflected in my STS IDE.
I tried, using the m2eclipse menu and "updating dependencies", "clean" etc.. to no use.
Maven Build Errors in STS IDE
Compilation Errors that I am getting in STS because of the Maven Build Errors
I am not sure what else I should be doing to resolve this and continue with the Spring Roo work.
I found the problem! :)
I was trying to achieve everything with one single download of Spring Source Tool Suite. Looks like I needed to add - MAVEN_HOME, JAVA_HOME environmental variables and the bin directories of both MAVEN and JAVA to the path, which was the reason none of the jars were getting downloaded automatically and I was seeing all compilation issues.
True that I was dumb, but at least it shows that I should not have ignored the most basics of Java, Maven! :-)
Try to run the following in Roo console:
perform eclipse
精彩评论