2017-09-21 215 views
2

我在部署时遇到了问题,这里是我得到的错误消息。我检查我的项目目标文件夹尚未创建。mvn部署失败

[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ LoanCalculator --- 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 10.010 s 
[INFO] Finished at: 2017-09-21T16:10:39+05:30 
[INFO] Final Memory: 27M/283M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project LoanCalculator: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 

过程与退出代码完成1

我检查互联网上,没能找到这个问题的解决方案。我认为它与pom.xml有关。这里是pom.xml的相关部分:

 <properties> 
      <spring.version>4.3.5.RELEASE</spring.version> 
      <maven.compiler.source>1.8</maven.compiler.source> 
      <maven.compiler.target>1.8</maven.compiler.target> 
     </properties> 


     <dependencies> 
      <dependency> 
      <groupId>org.jfxtras</groupId> 
      <artifactId>jfxtras-agenda</artifactId> 
      <version>8.0-r1</version> 
     </dependency> 

      <dependency> 
      <groupId>org.wildfly.swarm</groupId> 
      <artifactId>javafx</artifactId> 
      <version>2016.10.0</version> 
     </dependency> 

      <dependency> 
      <groupId>com.oracle</groupId> 
      <artifactId>javafx</artifactId> 
      <version>2.2.3</version> 
      <scope>system</scope> 
      <systemPath>${project.basedir}/lib/jfxrt.jar</systemPath> 
     </dependency> 

      <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-core</artifactId> 
      <version>${spring.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-web</artifactId> 
      <version>${spring.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-webmvc</artifactId> 
      <version>${spring.version}</version> 
     </dependency> 
     <!-- Spring AOP dependency --> 
      <dependency> 
        <groupId>cglib</groupId> 
      <artifactId>cglib</artifactId> 
      <version>2.2</version> 
     </dependency> 

我无法找到正确的依赖关系。

+3

的可能的复制[Maven的:在内部distributionManagement的POM没有指定的存储库元件](https://stackoverflow.com/questions/5910037/maven-repository-element-was-not-specified-in -pom-inside-distributionmanage) – jfs

+0

用这个https://stackoverflow.com/a/13314394/1746118作为答案。 – nullpointer

+0

其实我没有在我的项目中的目标文件夹,因为它不会执行一次。 – Garima

回答

1

如果未创建目标文件夹,可以先尝试执行“mvn clean install”,看看构建是否正常运行,并且是否使用所需的工件创建了“目标”文件夹。

一旦您确认可行,请在您的pom.xml中添加一个distributionManagement标记,例如下面的代码,将下面的测试和url替换为您想要的repo manager configs/values,然后执行“mvn deploy”。

<distributionManagement> 
    <repository> 
      <id>test</id> 
      <url>Repo path</url> 
    </repository> 
</distributionManagement>