2
votes

I have a multi-module maven project in azure repo:

Parent
  ----App
        --POM.xml
  ----Core
        --POM.xml
  ----API
        --POM.xml
  ----ParentPOM.xml

When I tried to build App project in Azure, I am getting the following error: [ERROR] Failed to execute goal on the project: Could not resolve dependencies for project com.core:jar:1.0: Could not find artifact com.core:jar:1.0 in central (https://repo.maven.apache.org/maven2).

So I tried to create multiple tasks in the same azure build to package for each module (App, Core, API), which also gives the same result. Could someone please help me on how to build the multi-module project and get the App jar file.

2

2 Answers

2
votes

The way I've done it:

with this command: install -pl (module name) -am

where the module name should be one of the submodules. If you want to build all of them then only go with install

-3
votes

I have found the solution for the multi-module maven dependency issue, First We need to build the parent pom.xml, then build the submodules as per hierarchical order. In between each module, add a task to copy and move the jar files to the staging directory. Here shared the image of my build steps. Please take a look and comment on any questions.

Please look into the DevOps configuration for reference