Skip to content

Commit

Permalink
[MENFORCER-473] Notice about max JDK in custom rules
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Mar 27, 2023
1 parent 435807f commit 5c473fc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
9 changes: 0 additions & 9 deletions enforcer-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<attributes>
<mavenPrerequisite>${maven.version}</mavenPrerequisite>
</attributes>
</configuration>
</plugin>
</plugins>
</build>
</project>
4 changes: 2 additions & 2 deletions enforcer-api/src/custom-rule-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

<properties>
<api.version>${project.version}</api.version>
<maven.version>${maven.version}</maven.version>
<!-- use JDK 1.8 at least -->
<maven.version>${mavenVersion}</maven.version>
<!-- use JDK 1.8 or 11 -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Expand Down
2 changes: 2 additions & 0 deletions enforcer-api/src/site/apt/writing-a-custom-rule.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Writing a custom rule

%{snippet|id=project-pom|file=enforcer-api/target/custom-rule-sample/pom.xml}

Target bytecode version of rule must be <<<1.8>>> or <<<11>>> - due to {{{https://issues.apache.org/jira/browse/MENFORCER-473}MENFORCER-473}}.

Note that the classloader is shared with the embedding <<<maven-enforcer-plugin>>> (a regular {{{https://maven.apache.org/guides/mini/guide-maven-classloading.html#Plugin_Classloaders}plugin classloader}})
and therefore the artifacts <<<org.apache.maven.enforcer:enforcer-api>>> are always loaded in the same version as the embedding <<<maven-enforcer-plugin>>>.

Expand Down
2 changes: 1 addition & 1 deletion maven-enforcer-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<description>The Loving Iron Fist of Maven</description>

<prerequisites>
<maven>${maven.version}</maven>
<maven>${mavenVersion}</maven>
</prerequisites>

<dependencies>
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</distributionManagement>

<properties>
<maven.version>3.2.5</maven.version>
<mavenVersion>3.2.5</mavenVersion>
<maven.site.path>enforcer-archives/enforcer-LATEST</maven.site.path>
<javaVersion>8</javaVersion>
<mockito.version>4.11.0</mockito.version>
Expand Down Expand Up @@ -111,19 +111,19 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${maven.version}</version>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven.version}</version>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down

0 comments on commit 5c473fc

Please sign in to comment.