Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MENFORCER-473] Notice about max JDK in custom rules #264

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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>
6 changes: 3 additions & 3 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 -->
<mavenVersion>${mavenVersion}</mavenVersion>
<!-- use JDK 1.8 or 11 -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Expand All @@ -49,7 +49,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>\${maven.version}</version>
<version>\${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
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