maven deploy:此项目的打包未将文件分配给构建工件

Bia*_*osa 6 maven

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

mvn install适用于本地存储库.

我正在使用Groovy和Groovy-Eclipse编译器插件.我试图运行mvn deploy来部署到远程存储库,我收到以下错误:

The packaging for this project did not assign a file to the build artifact -> [Help 1]
Run Code Online (Sandbox Code Playgroud)

这是我的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>
Run Code Online (Sandbox Code Playgroud)

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

Ste*_*stl 9

你需要运行mvn deploy而不是mvn deploy:deploy.前者执行maven 生命周期直到"部署"阶段,即它编译代码,将其打包到JAR文件中,最后将其部署到远程存储库.

mvn deploy:deploy另一方面,只执行deploymaven-deploy-plugin 的目标.如果没有先前执行的生命周期阶段(生成实际构建工件(JAR文件))的上下文,maven-deploy-plugin就没有任何可以部署的内容并且会因错误而中止The packaging for this project did not assign a file to the build artifact.maven-deploy-plugin 的FAQ中也解释了这种行为.