Petersaber
Petersaber

Reputation: 893

Non-parent property aggregating Maven project

I have dozens of separate automated tests Maven projects. Many of these projects depend on other projects, as they all test different modules of one, massive system.

Maintaining the cohesion of these dependencies almost became a full-time job. What I want instead, is to create a single aggregate which we will be able to version, which will hold all version numbers.

It could hold dependencies, but that means:

For reasons A and B I don't want to chain dependencies, or expand my parent pom into a gigantic pom. I am aware of the Properties Maven Plugin. I can create a separate project consisting of a pom.xml and a, lets say, versions.yaml files, which I can deploy to Nexus. Versions.yaml would contain entries like:

project-1: 0.4.2-SNAPSHOT
project-2: 0.9.18-SNAPSHOT

and then the dependency in test projects would look like this:

<dependency>
  <groupId>group</groupId>
  <artifactId>artifact</artifactId>
  <version>${project-1}</version>
</dependency>

However, I am unsure how to access said file from another project:

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>properties-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
          <execution>
            <phase>initialize</phase>
            <goals>
              <goal>read-project-properties</goal>
            </goals>
            <configuration>
              <files>
                <file>???</file>  <!--TODO-->
              </files>
            </configuration>
          </execution>
        </executions>
      </plugin>

Upvotes: 1

Views: 21

Answers (0)

Related Questions