[英]maven-deploy-plugin not executing its execution
I need to deploy custom jar's from my project itself I overrides maven-deploy-plugin with two more execution with its default execution. 我需要从我的项目本身部署自定义jar我使用默认执行覆盖maven-deploy-plugin两次执行。 below are my pom.xml with distributionManagement and maven-deploy-plugin which I use for my deployment. 下面是我的pom.xml,其中包含我用于部署的distributionManagement和maven-deploy-plugin。
<groupId>mycompany</groupId>
<artifactId>myproject</artifactId>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>temp</id>
<name>Release Repository</name>
<url>http://localhost:8000/nexus/content/repositories/temp/</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
some dependency
</dependency>
<dependency>
some dependency
</dependency>
<dependency>
some dependency
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<executions>
<execution>
<id>default-deploy</id>
<phase>none</phase>
</execution>
<execution>
<id>myjar-one</id>
<phase>deploy</phase>
<configuration>
<repositoryId>temp</repositoryId>
<url>http://localhost:8000/nexus/content/repositories/temp/</url>
<packaging>jar</packaging>
<artifactId>myjar-one</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
<sources>${project.build.directory}/build/lib/myjar-one.jar</sources>
</configuration>
</execution>
<execution>
<id>myjar-two</id>
<phase>deploy</phase>
<configuration>
<repositoryId>temp</repositoryId>
<url>http://localhost:8000/nexus/content/repositories/temp/</url>
<packaging>jar</packaging>
<artifactId>myjar-two</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
<sources>${project.build.directory}/build/lib/myjar-two.jar</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Guys I figure out the issue, there are following thing I need to fix. 伙计们我找出了问题,我需要解决以下问题。
Need to use file tag instead of source tag. 需要使用文件标签而不是源标签。 So final maven-deploy-plugin looks like. 所以最终的maven-deploy-plugin看起来像。
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <executions> <execution> <id>default-deploy</id> <phase>none</phase> </execution> <execution> <id>myjar-one</id> <phase>deploy</phase> <goals> <goal>deploy-file</goal> </goals> <configuration> <repositoryId>temp</repositoryId> <url>http://localhost:8000/nexus/content/repositories/temp/</url> <packaging>jar</packaging> <artifactId>myjar-one</artifactId> <groupId>${project.groupId}</groupId> <version>${project.version}</version> <file>${project.build.directory}/build/lib/myjar-one.jar</file> </configuration> </execution> <execution> <id>myjar-two</id> <phase>deploy</phase> <goals> <goal>deploy-file</goal> </goals> <configuration> <repositoryId>temp</repositoryId> <url>http://localhost:8000/nexus/content/repositories/temp/</url> <packaging>jar</packaging> <artifactId>myjar-two</artifactId> <groupId>${project.groupId}</groupId> <version>${project.version}</version> <file>${project.build.directory}/build/lib/myjar-two.jar</file> </configuration> </execution> </executions> </plugin>
after fixing this issue, my both custom jar's are deployed at my maven repository. 修复此问题后,我的两个自定义jar都部署在我的maven存储库中。 Thanks for help 感谢帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.