Collect dependencies for plugins
fzakaria opened this issue · 8 comments
Looks like the current third party tool only collects dependencies from the <dependencies>
portion of the POM file; however in order to run the full Maven lifecycle; we need to collect plugins as well.
We might need to use Aether directly.
Possibly related. Also <type>pom</type>
seem to be missing, even when inside <dependencies/>
.
The following artifacts could not be resolved: org.camunda.bpm:camunda-bom:pom:7.12.0, org.camunda.spin:camunda-spin-bom:pom:1.8.0, org.springframework.boot:spring-boot-dependencies:pom:2.2.1.RELEASE: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.camunda.bpm:camunda-bom:pom:7.12.0 has not been downloaded from it before...
Just found the new branch with Aether. Trying it out.
Still seems that even with the branch dependencyManagement
abstraction is not supported, forcing me to inline a lot of upstream managed pom versions 🤔
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.2.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
<dependency>
</dependencies>
</dependencyManagement>
Another find: This project seems to need two different version of the same pom package, but mvn2nix only outputs the first one, causing the other to be missing.
@datakurre checkout #8
I wrote about a new strategy I will be coding up today.
Using Aether I hoped would have been a lightweight solution but it's a very small portion of the functionality maven covers; as you have surmized.
I will change to using maven-invoker and using maven directly at a given lifecycle.
Then walk the tree of files downloaded.
I'll add you to the new pull-request
@fzakaria Thanks. I will try it out. Meanwhile I'm grateful your prior blog post that already helped forward until better approach is found.
@datakurre this is now resolved in master with the move to maven-invoker
https://github.com/fzakaria/mvn2nix/pull/9/files