Skip to content

Commit

Permalink
Include maven on test artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesbusy committed Jun 22, 2024
1 parent 7ee6417 commit 1d85a7e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
45 changes: 44 additions & 1 deletion plugin-modernizer-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<artifactId>plugin-modernizer-cli</artifactId>
<name>Plugin Modernizer CLI Interface</name>


<dependencies>
<dependency>
<groupId>io.jenkins.plugin-modernizer</groupId>
Expand Down Expand Up @@ -44,10 +43,54 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>apache-maven</artifactId>
<scope>test</scope>
<classifier>bin</classifier>
<type>zip</type>
<version>${maven.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<environmentVariables>
<MAVEN_HOME>${project.build.directory}/apache-maven-${maven.version}</MAVEN_HOME>
<M2_HOME>${project.build.directory}/apache-maven-${maven.version}</M2_HOME>
</environmentVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<goals>
<goal>unpack</goal>
</goals>
<phase>process-test-resources</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.maven</groupId>
<artifactId>apache-maven</artifactId>
<classifier>bin</classifier>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<!-- version specified in parent pom -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ private static Path getDefaultMavenHome() {
if (mavenHome == null) {
mavenHome = System.getenv("M2_HOME");
}
if (mavenHome == null) {
return null;
}
return Path.of(mavenHome);
}
}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<asm.version>9.7</asm.version>
<gson.version>2.11.0</gson.version>
<dataformat.version>2.16.1</dataformat.version>
<maven.version>3.9.8</maven.version>
</properties>

<repositories>
Expand Down

0 comments on commit 1d85a7e

Please sign in to comment.