2013-05-03 93 views
1

是否有任何方法可以在Netbeans中以Maven方式運行Maven項目? Netbeans自動執行它,但我只是想正常運行程序,作爲典型的Java項目(以節省時間)。我想輸出看起來像這樣:在Netbeans中運行Maven項目

run: 
Hello world! 
BUILD SUCCESSFUL (total time: 0 seconds) 

,而不是這樣的:

cd C:\Users\mbrnw_000\Documents\NetBeansProjects\mavenproject1; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0_15" "\"C:\\Program Files\\NetBeans 7.3\\java\\maven\\bin\\mvn.bat\"" "-Dexec.args=-classpath %classpath pl.mbrnwsk.mavenproject1.App" "-Dexec.executable=C:\\Program Files\\Java\\jdk1.7.0_15\\bin\\java.exe" process-classes org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 
Scanning for projects... 

------------------------------------------------------------------------ 
Building mavenproject1 1.0-SNAPSHOT 
------------------------------------------------------------------------ 

[resources:resources] 
[debug] execute contextualize 
Using 'UTF-8' encoding to copy filtered resources. 
skip non existing resourceDirectory C:\Users\mbrnw_000\Documents\NetBeansProjects\mavenproject1\src\main\resources 

[compiler:compile] 
Nothing to compile - all classes are up to date 

[exec:exec] 
Hello world! 
------------------------------------------------------------------------ 
BUILD SUCCESS 
------------------------------------------------------------------------ 
Total time: 1.143s 
Finished at: Fri May 03 16:27:09 CEST 2013 
Final Memory: 6M/107M 
------------------------------------------------------------------------ 

回答

0

在項目屬性打開編譯保存。但請注意,在7.4(即將發佈的版本)中,所有執行都將由Maven完成。