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

Generate MANIFEST entries with project information #359

Merged
merged 2 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ multi-release JAR layers.

In order to select the correct class files for the given Java version, the `<release>` property is used.
This prevents accidental usage of APIs which are only present in later versions than the one
being compiled. However there is a limitation to this strategy: Java 9 and later do not provide runtime information
being compiled. However there is a limitation to this strategy: Java 9 and later do not provide runtime information
for non-standard Java 8 classes such as `sun.misc.Unsafe`. If your project needs to compile against these classes,
you must use the dependency plugin as described <<mr-jar-sun-misc,below>>.

Expand All @@ -52,6 +52,10 @@ property or properties are set as needed:
* `java11.home`: this property must be set to the location of a Java 11 JDK installation
* `java12.home`: this property must be set to the location of a Java 12 JDK installation
* `java13.home`: this property must be set to the location of a Java 13 JDK installation
* `java14.home`: this property must be set to the location of a Java 13 JDK installation
* `java15.home`: this property must be set to the location of a Java 13 JDK installation
* `java16.home`: this property must be set to the location of a Java 13 JDK installation
* `java17.home`: this property must be set to the location of a Java 13 JDK installation
radcortez marked this conversation as resolved.
Show resolved Hide resolved

In order to simplify development, it is recommended to project maintainers to set these
properties in your personal Maven `settings.xml` file.
Expand Down Expand Up @@ -203,5 +207,9 @@ Note that this configuration causes the default `JAVA_HOME` environment to be se
|build-test-java11|Run tests for Java 11 when `java11.home` is set and JDK 12 or later is used.|<<mr-jar-testing>>
|build-test-java12|Run tests for Java 12 when `java12.home` is set and JDK 13 or later is used.|<<mr-jar-testing>>
|build-test-java13|Run tests for Java 13 when `java13.home` is set and JDK 14 or later is used.|<<mr-jar-testing>>
|build-test-java14|Run tests for Java 14 when `java14.home` is set and JDK 15 or later is used.|<<mr-jar-testing>>
|build-test-java15|Run tests for Java 15 when `java15.home` is set and JDK 16 or later is used.|<<mr-jar-testing>>
|build-test-java16|Run tests for Java 16 when `java16.home` is set and JDK 17 or later is used.|<<mr-jar-testing>>
|build-test-java17|Run tests for Java 17 when `java17.home` is set and JDK 18 or later is used.|<<mr-jar-testing>>
|===

67 changes: 49 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
child.project.url.inherit.append.path="false">

<modelVersion>4.0.0</modelVersion>

<groupId>io.smallrye</groupId>
Expand All @@ -21,14 +25,12 @@

<properties>
<!-- Plugin versions -->
<version.asciidoctor.plugin>2.2.2</version.asciidoctor.plugin>
<version.compiler.plugin>3.10.1</version.compiler.plugin>
<version.gpg.plugin>3.0.1</version.gpg.plugin>
<version.install.plugin>3.0.1</version.install.plugin>
<version.jar.plugin>3.3.0</version.jar.plugin>
<version.javadoc.plugin>3.4.1</version.javadoc.plugin>
<!-- Do not update: https://issues.sonatype.org/browse/NEXUS-31214 -->
<version.nexus.staging.plugin>1.6.8</version.nexus.staging.plugin>
<version.nexus.staging.plugin>1.6.13</version.nexus.staging.plugin>
<version.release.plugin>2.5.3</version.release.plugin>
<version.source.plugin>3.2.1</version.source.plugin>
<version.site.plugin>3.12.1</version.site.plugin>
Expand All @@ -38,6 +40,7 @@
<version.impsort.plugin>1.6.2</version.impsort.plugin>
<version.jacoco.plugin>0.8.8</version.jacoco.plugin>
<version.smallrye.plugin>1.0.0</version.smallrye.plugin>
<version.buildnumber.plugin>3.0.0</version.buildnumber.plugin>
<version.versions.plugin>2.13.0</version.versions.plugin>

<!-- Cross plugins settings -->
Expand All @@ -56,6 +59,8 @@

<!-- Special version for MR JAR jdk-misc artifact -->
<version.jdk-misc>3.Final</version.jdk-misc>

<format.skip>false</format.skip>
</properties>

<licenses>
Expand Down Expand Up @@ -102,20 +107,6 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>${version.asciidoctor.plugin}</version>
<configuration>
<backend>html</backend>
<sourceHighlighter>highlightjs</sourceHighlighter>
<imagesDir>assets</imagesDir>
<attributes>
<version>${project.version}</version>
<organization>${project.organization.name}</organization>
</attributes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -141,6 +132,26 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${version.jar.plugin}</version>
<configuration>
<archive>
<index>true</index>
<manifest>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-URL>${project.url}</Implementation-URL>
<Java-Version>${java.version}</Java-Version>
<Java-Vendor>${java.vendor}</Java-Vendor>
<Os-Name>${os.name}</Os-Name>
<Os-Arch>${os.arch}</Os-Arch>
<Os-Version>${os.version}</Os-Version>
<Scm-Url>${project.scm.url}</Scm-Url>
<Scm-Connection>${project.scm.connection}</Scm-Connection>
<Scm-Revision>${buildNumber}</Scm-Revision>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -328,6 +339,26 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>${version.buildnumber.plugin}</version>
<executions>
<execution>
<id>get-scm-revision</id>
<phase>initialize</phase>
<goals>
<goal>create</goal>
</goals>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<revisionOnScmFailure>UNKNOWN</revisionOnScmFailure>
<getRevisionOnlyOnce>true</getRevisionOnlyOnce>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
Expand Down