无法在Heroku中解析项目的依赖项

时间:2019-04-20 13:35:47

标签: java maven heroku dependencies

我正在尝试在Heroku上部署Maven Web应用程序,该应用程序依赖于某些其他应用程序。当我尝试部署应用程序并遇到此错误时。我不知道在传递依赖项时出了什么问题。

这是我的pom.xml文件

http://maven.apache.org/xsd/maven-4.0.0.xsd“>     4.0.0              org.springframework.boot         弹簧启动启动器父母         2.1.3发布                    商业化     美利坚     0.0.1-快照     美利坚     Merizameen的前端项目

<properties>
    <start-class>com.merizameen.MerizameenApplication</start-class>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <!-- MY PROJECT -->
    <dependency>
        <groupId>com.merizameen</groupId>
        <artifactId>merizameenbackend</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

错误日志---------

  [INFO] BUILD FAILURE
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time: 6.953 s
   [INFO] Finished at: 2019-04-16T18:29:11+00:00
   [INFO] Final Memory: 20M/162M
   [INFO] ------------------------------------------------------------------------
   [ERROR] Failed to execute goal on project merizameen: Could not resolve dependencies for project com.merizameen:merizameen:jar:0.0.1-SNAPSHOT: Could not find artifact com.merizameen:merizameenbackend:jar:0.0.1-SNAPSHOT -> [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/DependencyResolutionException

!错误:无法使用Maven构建应用        抱歉,此构建失败!如果您在应用程序代码中找不到问题,        请提交票证,以便我们提供帮助:https://help.heroku.com/  !推送被拒绝,无法编译Java应用。  !推送失败

1 个答案:

答案 0 :(得分:0)

您需要使用以下命令将com.merizameen:merizameenbackend添加为非托管依赖项:

$ mvn deploy:deploy-file -Durl=file:///path/to/yourproject/repo/ -Dfile=merizameenbackend.jar -DgroupId=com.merizameen -DartifactId=merizameenbackend -Dpackaging=jar -Dversion=1.0

请参阅本指南:https://devcenter.heroku.com/articles/local-maven-dependencies