英文:
Maven plugin not executing even though it is bound to a build phase
问题
<inherited>false</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>ant-execute</id>
<phase>package</phase>
<configuration>
<target name="UploadAndScan" description="Turns on debug symbols, logging. Cleans, builds, uploads binaries. Starts scan">
<!-- Call the Veracode wrapper to upload and scan -->
<java jar="${settings.localRepository}/com/veracode/vosp/api/wrappers/vosp-api-wrappers-java/20.7.7.0/vosp-api-wrappers-java-20.7.7.0.jar" fork="true">
<arg line=" -action UploadAndScan -vid <vid> -vkey <vkey> -criticality High -createprofile false -createsandbox false -version ${project.artifactId}-${project.version} -appname <appname> -sandboxname <sandboxname> -filepath <fpath>"/>
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.veracode.vosp.api.wrappers</groupId>
<artifactId>vosp-api-wrappers-java</artifactId>
<version>20.7.7.0</version>
</dependency>
</dependencies>
这是定义插件的代码,位于顶层 pom 文件中。
英文:
I am new to maven, and am having trouble executing a plugin. Currently I have bound it to the package phase, but when I do mvn clean package, or mvn clean install, it is not being executed. However, when I call the plugin by name, it executes as it should. What have I misunderstood/what is wrong with my code?
<inherited>false</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>ant-execute</id>
<phase>package</phase>
<configuration>
<target name="UploadAndScan" description="Turns on debug symbols, logging. Cleans, builds, uploads binaries. Starts scan">
<!-- Call the Veracode wrapper to upload and scan -->
<java jar="${settings.localRepository}/com/veracode/vosp/api/wrappers/vosp-api-wrappers-java/20.7.7.0/vosp-api-wrappers-java-20.7.7.0.jar" fork="true">
<arg line=" -action UploadAndScan -vid <vid> -vkey <vkey> -criticality High -createprofile false -createsandbox false -version ${project.artifactId}-${project.version} -appname <appname> -sandboxname <sandboxname> -filepath <fpath>"/>
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.veracode.vosp.api.wrappers</groupId>
<artifactId>vosp-api-wrappers-java</artifactId>
<version>20.7.7.0</version>
</dependency>
</dependencies>
This is the code that defines the plugin, located in the top-level pom.
答案1
得分: 0
你是否意外地将插件放入了<pluginManagement>
中?
那么它将不会被执行,你需要将它移动到<plugins>
中。
英文:
Did you, by accident, put the plugin into <pluginManagement>
?
Then it will not be executed and you need to move it to <plugins>
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论