1

有什么方法可以在 Netbeans 中运行 Maven 项目而不是 Maven 方式?Netbeans 自动完成,但我只想正常运行程序,作为典型的 Java 项目(以节省时间)。我希望输出看起来像这样:

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
------------------------------------------------------------------------
4

1 回答 1

0

通过在项目属性中打开保存时编译。但是请注意,在 7.4(即将发布的版本)中,所有执行都将由 Maven 独占完成。

于 2013-05-03T19:10:22.530 回答