Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] Different behavior in test and manually when retrieving Dependencies of DependencyManagement

Hello,

In my code, I'm calling:

File pomFile = new File(project.getFile("pom.xml").getLocation().toOSString());
Model m2m = MavenPlugin.getMaven().readModel(pomFile);
List<Dependency> dependencies = m2m.getDependencyManagement().getDependencies();

The dependencyManagement section in my pom is:

<dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jboss.fuse.bom</groupId>
        <artifactId>jboss-fuse-parent</artifactId>
        <version>${jboss.fuse.bom.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

The content of "dependencies" is different when launched in tests and when I try manually. It has been the same content for several other versions of the bom that I use.

So for all versions, except one, 'dependencies' contains the org.jboss.fuse.bom:jboss-fuse-parent artefact only.
And for a single version and only in test, it contains the full list of all dependencies managed by the org.jboss.fuse.bom:jboss-fuse-parent pom.

I don't understand:
- how it is possible to have a different content for the list
- why it is only for a single version in automated test

Any suggestions on what I should have a look and on the reasons explaining the behavior that I don't understand are welcome.


Regards,

--
Aurelien Pupier
Senior Software Engineer in JBoss Fuse Tooling team
@apupier

Back to the top