2017-02-17 609 views
0

我在我的pom.xml中有一個下面的配置,我想用maven deploy插件目標進行部署。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> 

我嘗試使用下面的命令及其working-

 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 

但是當我運行它的失敗下方。我想沒有specifing全信息像上文

 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 

任何幫助,將不勝感激

回答

2

mvn deploy:deploy-file如果未指定某些信息無法部署拉鍊,如建議在本頁面的官方文檔:mvn deploy-file