我在我的pom.xml中定义了一个目标。当我希望目标不被执行时有一个条件。我的pom.xml是:
<plugins>
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-wsdl2code-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<goals>
<goal>wsdl2code</goal>
</goals>
<configuration>
<wsdlFile>src/main/resources/myWsdl.wsdl</wsdlFile>
<databindingName>xmlbeans</databindingName>
<unpackClasses>true</unpackClasses>
<packageName>com.example.client</packageName>
<flattenFiles>true</flattenFiles>
<outputDirectory>src/main/java</outputDirectory>
<action>
<ignore/>
</action>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
我尝试使用标签,但它没有用。
如何让我的pom.xml跳过这个特定目标?
答案 0 :(得分:0)
答案 1 :(得分:0)
您可以使用以下个人资料:
<profiles>
<profile>
<id>my-profile</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-wsdl2code-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<goals>
<goal>wsdl2code</goal>
</goals>
<configuration>
<wsdlFile>src/main/resources/myWsdl.wsdl</wsdlFile>
<databindingName>xmlbeans</databindingName>
<unpackClasses>true</unpackClasses>
<packageName>com.example.client</packageName>
<flattenFiles>true</flattenFiles>
<outputDirectory>src/main/java</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
这可以与maven关系激活,如下所示:
mvn -Pmy-profile clean package
如果您未指定-Pmy-profile
,则不会执行插件的执行。