简体   繁体   中英

How to properly setup a maven project in Eclipse/IntelliJ

I'm struggling a bit, trying to properly setup my maven projects in an IDE.

I don't particularly care between Eclipse and IntelliJ, but it seems that IntelliJ handles much better when it comes to import my projects, so I think I will stick with this one.

I'm having other problems now when trying to run the install goal through IntelliJ.

The first error :

The svn command failed. Command output: 'svn' is not recognized as 
an internal or external command, operable
program or batch file.

How do I configure IntelliJ in order to let him see svn ? This error sounds weird to me, as I have installed Subversion as my Version Control System in IntelliJ.

Also, and this is related, I have a setenv.cmd that I usually run from the commandLine before calling mvn install. It only sets some variable like :

PROJECT_HOME=d:\Project\xxx\xxx\Trunk
PROJECT_VERSION=0.4.3-SNAPSHOT   
M2_HOME=d:\Java\apache-maven-2.0.11  
JAVA_HOME=d:\Java\jdk1.5.0_11   
PYTHON_HOME=d:\Python26   
XOOOF_HOME=d:\Project\xxx\xxx\XOOOF-BIN-1.0.3
XOOOF_URL=file:///d:/Project/xxx/xxx/XOOOF-BIN-1.0.3
SVNCLIENT_HOME=d:\Java\svn-win32-1.6.3
CATALINA_HOME=d:\Java\apache-tomcat  
PATH=C:\WINDOWS;C:\WINDOWS\system32

How could I improve this step, and find a way to make it work from my IDE ?

Thanks !

If you want to do maven builds in eclipse I would strongly suggest installing m2eclipse by Sonatype.

It has an excellent reference on how to use it -> http://www.sonatype.com/books/m2eclipse-book/reference/

Regarding the first error it seems to be not Idea fault. AFAIK Idea doesn't need/use external SVN binaries. What happens when you click "9: Changes" tab at the bottom in Idea? If you make your project/module as managed by SVN there should be Repository subtab.

You run Maven from Idea to perform install goal and that error seems to come from it. Do you use SCM/SVN plugin in pom.xml? If yes or you would like to have an ability to run SVN from command line add directory with svn.exe (d:\\Java\\svn-win32-1.6.3? d:\\Java\\svn-win32-1.6.3\\bin?) to PATH (not only to SVNCLIENT_HOME). After that operation svn command from new "run window" should be recognized.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM