部署时遇到问题,这是我收到的错误消息。我已检查我的项目Target文件夹尚未创建。
[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>
我找不到正确的依赖关系。
最佳答案
如果未创建目标文件夹,可以先尝试执行“ mvn全新安装”,看看构建是否运行良好,以及是否使用所需的工件创建了“目标”文件夹。
并且,一旦确认可行,就在pom.xml中添加一个distributionManagement
标记,例如下面的示例,将下面的测试和url替换为所需的仓库管理器配置/值,然后执行“ mvn deploy”。
<distributionManagement>
<repository>
<id>test</id>
<url>Repo path</url>
</repository>
</distributionManagement>
关于java - mvn部署失败,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46342111/