【问题标题】:Maven deploy plugin not workingMaven部署插件不起作用
【发布时间】:2017-07-06 15:01:52
【问题描述】:

我的 pom.xml 中有以下配置,我想使用 maven deploy 插件目标进行部署。

        <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.5</version>
            <executions>
                <execution>
                    <id>deploy-file</id>
                    <phase>deploy</phase>
                    <goals>
                        <goal>deploy-file</goal>
                    </goals>
                    <configuration>
                        <groupId>com.my.build</groupId>
                        <artifactId>my_build</artifactId>
                        <version>${version}</version>
                        <packaging>zip</packaging>
                        <generatePom>true</generatePom>
                        <repositoryId>dsnexus</repositoryId>
                        <url>https://dsnexus.xxxcontent/repositories/releases</url>
                        <file>target/my_build-${version}.zip</file>
                    </configuration>
                </execution>
            </executions>
        </plugin>

<distributionManagement>
    <repository>
        <id>dsnexus</id>
        <name>Repo</name>
        <url>
            https://dsnexus.xxxcontent/repositories/releases
        </url>
    </repository>
</distributionManagement>

我尝试使用以下命令及其工作-

     mvn deploy:deploy-file -Dfile=target/my_build-1.5.5.zip -DrepositoryId=dsnexus -Durl=https://dsnexus.xxxcontent/repositories/releases
         -DgroupId=com.my.build -DartifactId=my_build -Dversion=1.5.5 -Dpackaging=zip

但是当我跑到它失败的地方时。我想在不指定完整信息的情况下部署 zip-

     mvn deploy:deploy-file

  Error:
        Caused by: org.apache.maven.plugin.PluginParameterException: The parameters 'file', 'url' for goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy-file are missing or invalid
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:576)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:529)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more

任何帮助将不胜感激

【问题讨论】:

    标签: java maven-3 parent-pom


    【解决方案1】:

    如果未指定某些信息,mvn deploy:deploy-file 将失败,如此页面上的官方文档所示:mvn deploy-file

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-01
      • 1970-01-01
      • 2019-01-26
      • 2014-01-19
      • 2020-11-27
      • 1970-01-01
      相关资源
      最近更新 更多