0
votes

I am trying to deploy maven web app in the Heroku which have a dependency on some other application. When I am trying to deploy the app and getting this error. I have no clue what is going wrong in passing the dependency.

This is my pom.xml file

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot spring-boot-starter-parent 2.1.3.RELEASE com.merizameen merizameen 0.0.1-SNAPSHOT merizameen Frontend project for 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>

Error Logs---------

  [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

! ERROR: Failed to build app with Maven We're sorry this build is failing! If you can't find the issue in application code, please submit a ticket so we can help: https://help.heroku.com/ ! Push rejected, failed to compile Java app. ! Push failed

1
It looks pretty clear: "Could not find artifact com.merizameen:merizameenbackend:jar:0.0.1-SNAPSHOT… For more information about the errors and possible solutions, please read the following articles: [Help 1] cwiki.apache.org/confluence/display/MAVEN/…". Where should that dependency be coming from?Chris
@Chris that dependency is another application. So basically there are two application, merizameen is depended on the merizameenbackend . In local both are in the same directory so it's working fine. But I don't know how to pass the other dependency in pom.xml of another application if I am trying to deploy in hroku.Ayush

1 Answers

0
votes

You'll need to add com.merizameen:merizameenbackend as an un-managed dependency with a command like:

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

See this guide: https://devcenter.heroku.com/articles/local-maven-dependencies