Rob*_*lte 20
此页面应该告诉您调用cmdline传递的参数的名称(即用户属性)skip,这是一个选择不当的名称.要解决此问题,请执
<properties>
<maven.exec.skip>false</maven.exec.skip> <!-- default -->
</properties>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<skip>${maven.exec.skip}</skip>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
小智 5
使用配置文件(尽可能少)和执行阶段,您可以实现您想要的不处理跳过属性的插件:
插件配置:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<executions>
<execution>
<phase>${rpmPackagePhase}</phase>
<id>generate-rpm</id>
<goals>
<goal>rpm</goal>
</goals>
</execution>
</executions>
<configuration>
...
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
配置文件配置:
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<rpmPackagePhase>none</rpmPackagePhase>
</properties>
</profile>
<profile>
<id>rpmPackage</id>
<activation>
<property>
<name>rpm.package</name>
<value>true</value>
</property>
</activation>
<properties>
<rpmPackagePhase>package</rpmPackagePhase>
</properties>
</profile>
</profiles>
Run Code Online (Sandbox Code Playgroud)
调用:
mvn package -Drpm.package=true [...]
Run Code Online (Sandbox Code Playgroud)