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.MF build info #3035

Open
wants to merge 3 commits into
base: 3.x
Choose a base branch
from
Open

Generate MANIFEST.MF build info #3035

wants to merge 3 commits into from

Conversation

ascopes
Copy link
Contributor

@ascopes ascopes commented May 7, 2023

  • Include build info and versioning info in the JAR manifest so that applications can inspect it reflectively as needed without needing to check gradle, maven, or OSGi build metadata to find out the active version.

- Include build info and versioning info in the JAR 
  manifest so that applications can inspect it 
  reflectively as needed without needing to check 
  gradle, maven, or OSGi build metadata to find out
  the active version.
- Generate an archive index file for the JAR. 
  Classloaders can exploit this to optimise and speed
  up the act of loading classes from the JAR. Since
  AssertJ has A LOT of classes, this sounds like a
  reasonable thing to be including!
@scordio scordio self-assigned this May 7, 2023
assertj-parent/pom.xml Outdated Show resolved Hide resolved
Comment on lines +211 to +215
<manifest>
<addBuildEnvironmentEntries>true</addBuildEnvironmentEntries>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems none of the manifests contain the new entries.

Most likely, this is due to the bnd-maven-plugin taking care of generating the manifest. We need to check what can be done with that configuration.

assertj-core
Manifest-Version: 1.0
Bundle-Description: Rich and fluent assertions for testing in Java
Bundle-Developers: joel-costigliola;email="joel.costigliola at gmail.c
 om";name="Joel Costigliola";roles="Owner,Developer",scordio;name="Ste
 fano Cordio";roles=Developer,PascalSchumacher;name="Pascal Schumacher
 ";roles=Developer,epeee;name="Erhard Pointl";roles=Developer,croesch;
 name="Christian Rösch";roles=Developer,VanRoy;name="Julien Roy";role
 s=Developer,regis1512;name="Régis Pouiller";roles=Developer,fbiville
 ;name="Florent Biville";roles=Developer,Patouche;name="Patrick Allain
 ";roles=Developer
Bundle-DocURL: https://assertj.github.io/doc/#assertj-core
Bundle-License: "Apache License, Version 2.0";link="https://www.apache
 .org/licenses/LICENSE-2.0.txt"
Bundle-ManifestVersion: 2
Bundle-Name: AssertJ Core
Bundle-SCM: url="https://github.com/assertj/assertj/assertj-parent/ass
 ertj-core",connection="scm:git:https://github.com/assertj/assertj.git
 /assertj-parent/assertj-core",developer-connection="scm:git:https://g
 ithub.com/assertj/assertj.git/assertj-parent/assertj-core",tag=HEAD
Bundle-SymbolicName: assertj-core
Bundle-Vendor: AssertJ
Bundle-Version: 3.25.0.SNAPSHOT
Export-Package: org.assertj.core.annotations;version="3.25.0",org.asse
 rtj.core.api;uses:="net.bytebuddy.implementation.bind.annotation,org.
 assertj.core.api.filter,org.assertj.core.api.iterable,org.assertj.cor
 e.api.recursive.assertion,org.assertj.core.api.recursive.comparison,o
 rg.assertj.core.condition,org.assertj.core.configuration,org.assertj.
 core.data,org.assertj.core.description,org.assertj.core.error,org.ass
 ertj.core.groups,org.assertj.core.presentation,org.hamcrest,org.junit
 .jupiter.api.extension,org.junit.rules,org.junit.runner,org.junit.run
 ners.model";version="3.25.0",org.assertj.core.api.exception;version="
 3.25.0",org.assertj.core.api.filter;uses:="org.assertj.core.api";vers
 ion="3.25.0",org.assertj.core.api.iterable;version="3.25.0",org.asser
 tj.core.api.junit.jupiter;uses:="org.assertj.core.api,org.junit.jupit
 er.api.extension";version="3.25.0",org.assertj.core.api.recursive;use
 s:="org.assertj.core.api.recursive.comparison";version="3.25.0",org.a
 ssertj.core.api.recursive.assertion;uses:="org.assertj.core.api.recur
 sive,org.assertj.core.api.recursive.comparison";version="3.25.0",org.
 assertj.core.api.recursive.comparison;uses:="org.assertj.core.api.rec
 ursive,org.assertj.core.presentation";version="3.25.0",org.assertj.co
 re.condition;uses:="org.assertj.core.api,org.assertj.core.description
 ";version="3.25.0",org.assertj.core.configuration;uses:="org.assertj.
 core.description,org.assertj.core.presentation";version="3.25.0",org.
 assertj.core.data;version="3.25.0",org.assertj.core.description;versi
 on="3.25.0",org.assertj.core.error;uses:="org.assertj.core.api,org.as
 sertj.core.api.recursive.assertion,org.assertj.core.api.recursive.com
 parison,org.assertj.core.data,org.assertj.core.description,org.assert
 j.core.presentation,org.assertj.core.util.diff,org.opentest4j";versio
 n="3.25.0",org.assertj.core.error.array2d;uses:="org.assertj.core.err
 or";version="3.25.0",org.assertj.core.error.future;uses:="org.assertj
 .core.error";version="3.25.0",org.assertj.core.error.uri;uses:="org.a
 ssertj.core.error";version="3.25.0",org.assertj.core.extractor;uses:=
 "org.assertj.core.groups";version="3.25.0",org.assertj.core.groups;ve
 rsion="3.25.0",org.assertj.core.matcher;uses:="org.hamcrest";version=
 "3.25.0",org.assertj.core.presentation;uses:="org.assertj.core.data,o
 rg.assertj.core.groups";version="3.25.0",org.assertj.core.util;uses:=
 "org.assertj.core.api.filter,org.assertj.core.presentation";version="
 3.25.0",org.assertj.core.util.diff;version="3.25.0",org.assertj.core.
 util.diff.myers;uses:="org.assertj.core.util.diff";version="3.25.0",o
 rg.assertj.core.util.introspection;version="3.25.0",org.assertj.core.
 util.xml;version="3.25.0"
Import-Package: net.bytebuddy;version="[1.14,2)",net.bytebuddy.descrip
 tion.method;version="[1.14,2)",net.bytebuddy.description.modifier;ver
 sion="[1.14,2)",net.bytebuddy.description.type;version="[1.14,2)",net
 .bytebuddy.dynamic;version="[1.14,2)",net.bytebuddy.dynamic.loading;v
 ersion="[1.14,2)",net.bytebuddy.dynamic.scaffold;version="[1.14,2)",n
 et.bytebuddy.implementation;version="[1.14,2)",net.bytebuddy.implemen
 tation.auxiliary;version="[1.14,2)",net.bytebuddy.implementation.bind
 .annotation;version="[1.14,2)",net.bytebuddy.matcher;version="[1.14,2
 )",javax.xml.parsers;resolution:=optional,org.hamcrest;resolution:=op
 tional;version="[2.2,3)",org.junit.jupiter.api;resolution:=optional;v
 ersion="[5.9,6)",org.junit.jupiter.api.extension;resolution:=optional
 ;version="[5.9,6)",org.junit.jupiter.api.parallel;resolution:=optiona
 l;version="[5.9,6)",org.junit.platform.commons.annotation;resolution:
 =optional;version="[1.9,2)",org.junit.platform.commons.support;resolu
 tion:=optional;version="[1.9,2)",org.junit.rules;resolution:=optional
 ,org.junit.runner;resolution:=optional,org.junit.runners.model;resolu
 tion:=optional,org.opentest4j;resolution:=optional;version="[1.2,2)",
 org.w3c.dom;resolution:=optional,org.w3c.dom.bootstrap;resolution:=op
 tional,org.w3c.dom.ls;resolution:=optional,org.xml.sax;resolution:=op
 tional
Multi-Release: true
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
assertj-guava
Manifest-Version: 1.0
Bundle-Description: Rich and fluent assertions for testing for Guava
Bundle-Developers: joel-costigliola;email="joel.costigliola at gmail.c
 om";name="Joel Costigliola";roles="Owner,Developer",scordio;name="Ste
 fano Cordio";roles=Developer,PascalSchumacher;name="Pascal Schumacher
 ";roles=Developer,epeee;name="Erhard Pointl";roles=Developer,croesch;
 name="Christian Rösch";roles=Developer,VanRoy;name="Julien Roy";role
 s=Developer,regis1512;name="Régis Pouiller";roles=Developer,fbiville
 ;name="Florent Biville";roles=Developer,Patouche;name="Patrick Allain
 ";roles=Developer
Bundle-DocURL: https://assertj.github.io/doc/#assertj-guava
Bundle-License: "Apache License, Version 2.0";link="https://www.apache
 .org/licenses/LICENSE-2.0.txt"
Bundle-ManifestVersion: 2
Bundle-Name: AssertJ Guava
Bundle-SCM: url="https://github.com/assertj/assertj/assertj-parent/ass
 ertj-guava",connection="scm:git:https://github.com/assertj/assertj.gi
 t/assertj-parent/assertj-guava",developer-connection="scm:git:https:/
 /github.com/assertj/assertj.git/assertj-parent/assertj-guava",tag=HEA
 D
Bundle-SymbolicName: assertj-guava
Bundle-Vendor: AssertJ
Bundle-Version: 3.25.0.SNAPSHOT
Export-Package: org.assertj.guava.api;uses:="com.google.common.base,co
 m.google.common.collect,com.google.common.io,org.assertj.core.api,org
 .assertj.core.data,org.assertj.guava.data";version="3.25.0",org.asser
 tj.guava.data;version="3.25.0",org.assertj.guava.error;uses:="com.goo
 gle.common.base,com.google.common.collect,com.google.common.io,org.as
 sertj.core.error";version="3.25.0"
Import-Package: com.google.common.base;version="[31.1,32)",com.google.
 common.collect;version="[31.1,32)",com.google.common.io;version="[31.
 1,32)",org.assertj.core.api;version="[3.25,4)",org.assertj.core.data;
 version="[3.25,4)",org.assertj.core.error;version="[3.25,4)",org.asse
 rtj.core.util;version="[3.25,4)",org.assertj.guava.data,org.assertj.g
 uava.error
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"

@ascopes ascopes changed the title Generate MANIFEST.MF build info and class indexes Generate MANIFEST.MF build info May 9, 2023
@ascopes ascopes requested a review from scordio May 9, 2023 17:16
Copy link
Member

@scordio scordio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 thanks, @ascopes!

I just want to give it a go locally and then I'll merge it.

@scordio scordio added this to the 3.25.0 milestone May 10, 2023
Comment on lines +211 to +215
<manifest>
<addBuildEnvironmentEntries>true</addBuildEnvironmentEntries>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems none of the manifests contain the new entries.

Most likely, this is due to the bnd-maven-plugin taking care of generating the manifest. We need to check what can be done with that configuration.

assertj-core
Manifest-Version: 1.0
Bundle-Description: Rich and fluent assertions for testing in Java
Bundle-Developers: joel-costigliola;email="joel.costigliola at gmail.c
 om";name="Joel Costigliola";roles="Owner,Developer",scordio;name="Ste
 fano Cordio";roles=Developer,PascalSchumacher;name="Pascal Schumacher
 ";roles=Developer,epeee;name="Erhard Pointl";roles=Developer,croesch;
 name="Christian Rösch";roles=Developer,VanRoy;name="Julien Roy";role
 s=Developer,regis1512;name="Régis Pouiller";roles=Developer,fbiville
 ;name="Florent Biville";roles=Developer,Patouche;name="Patrick Allain
 ";roles=Developer
Bundle-DocURL: https://assertj.github.io/doc/#assertj-core
Bundle-License: "Apache License, Version 2.0";link="https://www.apache
 .org/licenses/LICENSE-2.0.txt"
Bundle-ManifestVersion: 2
Bundle-Name: AssertJ Core
Bundle-SCM: url="https://github.com/assertj/assertj/assertj-parent/ass
 ertj-core",connection="scm:git:https://github.com/assertj/assertj.git
 /assertj-parent/assertj-core",developer-connection="scm:git:https://g
 ithub.com/assertj/assertj.git/assertj-parent/assertj-core",tag=HEAD
Bundle-SymbolicName: assertj-core
Bundle-Vendor: AssertJ
Bundle-Version: 3.25.0.SNAPSHOT
Export-Package: org.assertj.core.annotations;version="3.25.0",org.asse
 rtj.core.api;uses:="net.bytebuddy.implementation.bind.annotation,org.
 assertj.core.api.filter,org.assertj.core.api.iterable,org.assertj.cor
 e.api.recursive.assertion,org.assertj.core.api.recursive.comparison,o
 rg.assertj.core.condition,org.assertj.core.configuration,org.assertj.
 core.data,org.assertj.core.description,org.assertj.core.error,org.ass
 ertj.core.groups,org.assertj.core.presentation,org.hamcrest,org.junit
 .jupiter.api.extension,org.junit.rules,org.junit.runner,org.junit.run
 ners.model";version="3.25.0",org.assertj.core.api.exception;version="
 3.25.0",org.assertj.core.api.filter;uses:="org.assertj.core.api";vers
 ion="3.25.0",org.assertj.core.api.iterable;version="3.25.0",org.asser
 tj.core.api.junit.jupiter;uses:="org.assertj.core.api,org.junit.jupit
 er.api.extension";version="3.25.0",org.assertj.core.api.recursive;use
 s:="org.assertj.core.api.recursive.comparison";version="3.25.0",org.a
 ssertj.core.api.recursive.assertion;uses:="org.assertj.core.api.recur
 sive,org.assertj.core.api.recursive.comparison";version="3.25.0",org.
 assertj.core.api.recursive.comparison;uses:="org.assertj.core.api.rec
 ursive,org.assertj.core.presentation";version="3.25.0",org.assertj.co
 re.condition;uses:="org.assertj.core.api,org.assertj.core.description
 ";version="3.25.0",org.assertj.core.configuration;uses:="org.assertj.
 core.description,org.assertj.core.presentation";version="3.25.0",org.
 assertj.core.data;version="3.25.0",org.assertj.core.description;versi
 on="3.25.0",org.assertj.core.error;uses:="org.assertj.core.api,org.as
 sertj.core.api.recursive.assertion,org.assertj.core.api.recursive.com
 parison,org.assertj.core.data,org.assertj.core.description,org.assert
 j.core.presentation,org.assertj.core.util.diff,org.opentest4j";versio
 n="3.25.0",org.assertj.core.error.array2d;uses:="org.assertj.core.err
 or";version="3.25.0",org.assertj.core.error.future;uses:="org.assertj
 .core.error";version="3.25.0",org.assertj.core.error.uri;uses:="org.a
 ssertj.core.error";version="3.25.0",org.assertj.core.extractor;uses:=
 "org.assertj.core.groups";version="3.25.0",org.assertj.core.groups;ve
 rsion="3.25.0",org.assertj.core.matcher;uses:="org.hamcrest";version=
 "3.25.0",org.assertj.core.presentation;uses:="org.assertj.core.data,o
 rg.assertj.core.groups";version="3.25.0",org.assertj.core.util;uses:=
 "org.assertj.core.api.filter,org.assertj.core.presentation";version="
 3.25.0",org.assertj.core.util.diff;version="3.25.0",org.assertj.core.
 util.diff.myers;uses:="org.assertj.core.util.diff";version="3.25.0",o
 rg.assertj.core.util.introspection;version="3.25.0",org.assertj.core.
 util.xml;version="3.25.0"
Import-Package: net.bytebuddy;version="[1.14,2)",net.bytebuddy.descrip
 tion.method;version="[1.14,2)",net.bytebuddy.description.modifier;ver
 sion="[1.14,2)",net.bytebuddy.description.type;version="[1.14,2)",net
 .bytebuddy.dynamic;version="[1.14,2)",net.bytebuddy.dynamic.loading;v
 ersion="[1.14,2)",net.bytebuddy.dynamic.scaffold;version="[1.14,2)",n
 et.bytebuddy.implementation;version="[1.14,2)",net.bytebuddy.implemen
 tation.auxiliary;version="[1.14,2)",net.bytebuddy.implementation.bind
 .annotation;version="[1.14,2)",net.bytebuddy.matcher;version="[1.14,2
 )",javax.xml.parsers;resolution:=optional,org.hamcrest;resolution:=op
 tional;version="[2.2,3)",org.junit.jupiter.api;resolution:=optional;v
 ersion="[5.9,6)",org.junit.jupiter.api.extension;resolution:=optional
 ;version="[5.9,6)",org.junit.jupiter.api.parallel;resolution:=optiona
 l;version="[5.9,6)",org.junit.platform.commons.annotation;resolution:
 =optional;version="[1.9,2)",org.junit.platform.commons.support;resolu
 tion:=optional;version="[1.9,2)",org.junit.rules;resolution:=optional
 ,org.junit.runner;resolution:=optional,org.junit.runners.model;resolu
 tion:=optional,org.opentest4j;resolution:=optional;version="[1.2,2)",
 org.w3c.dom;resolution:=optional,org.w3c.dom.bootstrap;resolution:=op
 tional,org.w3c.dom.ls;resolution:=optional,org.xml.sax;resolution:=op
 tional
Multi-Release: true
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
assertj-guava
Manifest-Version: 1.0
Bundle-Description: Rich and fluent assertions for testing for Guava
Bundle-Developers: joel-costigliola;email="joel.costigliola at gmail.c
 om";name="Joel Costigliola";roles="Owner,Developer",scordio;name="Ste
 fano Cordio";roles=Developer,PascalSchumacher;name="Pascal Schumacher
 ";roles=Developer,epeee;name="Erhard Pointl";roles=Developer,croesch;
 name="Christian Rösch";roles=Developer,VanRoy;name="Julien Roy";role
 s=Developer,regis1512;name="Régis Pouiller";roles=Developer,fbiville
 ;name="Florent Biville";roles=Developer,Patouche;name="Patrick Allain
 ";roles=Developer
Bundle-DocURL: https://assertj.github.io/doc/#assertj-guava
Bundle-License: "Apache License, Version 2.0";link="https://www.apache
 .org/licenses/LICENSE-2.0.txt"
Bundle-ManifestVersion: 2
Bundle-Name: AssertJ Guava
Bundle-SCM: url="https://github.com/assertj/assertj/assertj-parent/ass
 ertj-guava",connection="scm:git:https://github.com/assertj/assertj.gi
 t/assertj-parent/assertj-guava",developer-connection="scm:git:https:/
 /github.com/assertj/assertj.git/assertj-parent/assertj-guava",tag=HEA
 D
Bundle-SymbolicName: assertj-guava
Bundle-Vendor: AssertJ
Bundle-Version: 3.25.0.SNAPSHOT
Export-Package: org.assertj.guava.api;uses:="com.google.common.base,co
 m.google.common.collect,com.google.common.io,org.assertj.core.api,org
 .assertj.core.data,org.assertj.guava.data";version="3.25.0",org.asser
 tj.guava.data;version="3.25.0",org.assertj.guava.error;uses:="com.goo
 gle.common.base,com.google.common.collect,com.google.common.io,org.as
 sertj.core.error";version="3.25.0"
Import-Package: com.google.common.base;version="[31.1,32)",com.google.
 common.collect;version="[31.1,32)",com.google.common.io;version="[31.
 1,32)",org.assertj.core.api;version="[3.25,4)",org.assertj.core.data;
 version="[3.25,4)",org.assertj.core.error;version="[3.25,4)",org.asse
 rtj.core.util;version="[3.25,4)",org.assertj.guava.data,org.assertj.g
 uava.error
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"

@scordio scordio added the status: not ready A change that requires additional work label May 27, 2023
@scordio scordio removed this from the 3.25.0 milestone May 27, 2023
@scordio scordio force-pushed the main branch 2 times, most recently from 38c7b4b to 3cde5bf Compare July 20, 2023 15:20
@scordio scordio force-pushed the 3.x branch 2 times, most recently from 301ca01 to c730d18 Compare June 1, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: not ready A change that requires additional work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants