将maven 2升级到maven 3
升级maven时,属性插件出现问题:将maven 2升级到maven 3,maven,Maven,升级maven时,属性插件出现问题: <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> 所以登录是当我运行mvn时。。。没有配置文件的属性取自pom。如果使用配置文件,则应使用配置文件中的属性。这适用于maven 2,但maven 3仍然从pom获
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
所以登录是当我运行mvn时。。。没有配置文件的属性取自pom。如果使用配置文件,则应使用配置文件中的属性。这适用于maven 2,但maven 3仍然从pom获取属性。有没有办法解决这个问题
这里写着:
属性:
Requires a Maven 2.0 project to be executed.
这意味着maven 3不支持此插件?当从maven 2移动到maven 3时,要小心,因为maven 2在启动时加载所有依赖项,而maven 3在需要时加载它们。因此,在Maven 3中工作的构建将在运行Maven 2的构建框中中断。吸取的教训。你能显示完整的pom吗,因为我怀疑这是基于属性maven插件的。我不能显示整个pom,但我编辑了它,只显示了重要的部分。有趣的是,当我从pom中删除属性时,它就工作了,所以重写属性存在问题。我已经用maven 3.0.3检查了这一点,它工作得非常好。你能发布pom文件吗…我使用的是3.0.4。我只是发pom。您没有看到它?您想设置什么类型的属性查看build.properties?
<profile>
<id>config</id>
<activation>
<property>
<name>config</name>
</property>
</activation>
<properties>
<konfig>${basedir}/../config/${config}/build.properties</konfig>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${konfig}</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
appname=appname2
Requires a Maven 2.0 project to be executed.