【发布时间】:2012-11-29 23:49:56
【问题描述】:
我想用Maven执行某个插件,只需要源代码,但我不希望Maven编译任何东西(主要是因为项目只是不编译)。
我如何告诉 Maven 跳过编译步骤,只启动它的插件,然后将生成的资源打包到一个漂亮的 JAR 中? (最后一步的过程我已经知道了。)
其他信息:
所以我们现在尝试了很多东西,例如:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<excludes>
<exclude>**/*</exclude>
</excludes>
<source>1.7</source>
<target>1.7</target>
</configuration>
<executions>
<execution>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
虽然当我们执行mvn package 时,我们会得到:
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ project ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling ALOTOF source files to /home/myname/dir/dir/project/target/classes
消息已编辑。
【问题讨论】:
标签: java maven compilation