gpt4 book ai didi

maven - maven部署: The packaging for this project did not assign a file to the build artifact

转载 作者:行者123 更新时间:2023-12-04 14:10:50 28 4
gpt4 key购买 nike

我正在尝试将Maven项目部署到远程存储库。

mvn install适用于本地存储库。

我正在使用Groovy和Groovy-Eclipse编译器插件。
我尝试运行mvn deploy部署到远程存储库,但出现以下错误:

The packaging for this project did not assign a file to the build artifact -> [Help 1]

这是我的pom.xml:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.notacariocafacil</groupId>
<artifactId>notacariocafacil</artifactId>
<version>1.0</version>
<packaging>jar</packaging>


<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.8.6</version>
</dependency>
</dependencies>

<build>
<extensions>
<extension>
<groupId>org.kuali.maven.wagons</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>1.2.1</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<source>1.6</source>
<target>1.6</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>1.8.6-01</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.7.0-01</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.7.0-01</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>

我需要在构建步骤中添加一些内容吗?

最佳答案

您需要运行mvn deploy而不是mvn deploy:deploy。前者执行maven lifecycle直到“部署”阶段,即它编译您的代码,将其打包到JAR文件中,最后将其部署到您的远程存储库中。

另一方面,mvn deploy:deploy仅执行maven-deploy-plugin的deploy目标。如果没有先前执行的生命周期阶段的上下文,而这些阶段会产生您的实际构建 Artifact (JAR文件),则maven-deploy-plugin将无法部署任何东西,并因错误The packaging for this project did not assign a file to the build artifact而中止。在maven-deploy-plugin的FAQ中也解释了此行为。

关于maven - maven部署: The packaging for this project did not assign a file to the build artifact,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33926182/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com