gemmellr commented on pull request #3846: URL: https://github.com/apache/activemq-artemis/pull/3846#issuecomment-972852060
I tried poking at it and came up with some changes that pass the PR build+tests. It is failing because the -osgi modules have an entry in their manifest saying they should import the org.glashfish.json package, which the build (in disabled module, now enabled) and karaf tests module cant then resolve. I dont really understand that since nothing seems to reference that package to cause it to be imported, and it doesnt look like the deps which were shaded and removed actually provided it anyway, so its unclear to me why that behaviour arises or would now differ. I just blindly changed it so that particular package is listed as optional, meaning it will only fail if something needing it is actually used and its not present at the time. Things seem happy with that along with some other cleanup to remove imports/deps that it seems the shading should be removing need of. With all these the build works and the karaf client integration tests pass. Not sure about the broker module, its not clear its tested, but since nothing obviously uses the package and the real change is all in artemis-common it seems like it should be much the same. I added the changes on a branch in my fork https://github.com/gemmellr/activemq-artemis/tree/json-fixup-playing-ARTEMIS-3546, or you can find the current delta diff below. <details><summary>Delta diff from prior changes (click to expand)</summary><p> ``` diff --git a/artemis-commons/pom.xml b/artemis-commons/pom.xml index 1b0fe2442f..f40497c79c 100644 --- a/artemis-commons/pom.xml +++ b/artemis-commons/pom.xml @@ -39,11 +39,15 @@ <groupId>org.apache.johnzon</groupId> <artifactId>johnzon-core</artifactId> <version>${johnzon.version}</version> + <scope>compile</scope> + <optional>true</optional> </dependency> <dependency> <groupId>jakarta.json</groupId> <artifactId>jakarta.json-api</artifactId> <version>${jakarta.json-api.version}</version> + <scope>compile</scope> + <optional>true</optional> <!-- License: EPL 2.0 --> </dependency> <!-- ^^ these dependencies are shaded on this JAR --> @@ -69,7 +73,6 @@ <dependency> <groupId>com.google.errorprone</groupId> <artifactId>error_prone_core</artifactId> - <scope>provided</scope> </dependency> <dependency> <groupId>org.wildfly.common</groupId> @@ -127,7 +130,6 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> - <version>3.2.4</version> <executions> <execution> <phase>package</phase> diff --git a/artemis-core-client-osgi/pom.xml b/artemis-core-client-osgi/pom.xml index b84ba94f7b..1fcfd777a4 100644 --- a/artemis-core-client-osgi/pom.xml +++ b/artemis-core-client-osgi/pom.xml @@ -98,8 +98,8 @@ <instructions> <Embed-Dependency>*;scope=compile|runtime;groupId=org.apache.activemq</Embed-Dependency> <Import-Package> + org.glassfish.json*;resolution:=optional, io.netty.buffer;io.netty.*;version="[4.1,5)", - org.apache.johnzon.core, * </Import-Package> <_exportcontents>org.apache.activemq.artemis.*;-noimport:=true</_exportcontents> diff --git a/artemis-features/src/main/resources/features.xml b/artemis-features/src/main/resources/features.xml index 5de867530f..d5894b1fc3 100644 --- a/artemis-features/src/main/resources/features.xml +++ b/artemis-features/src/main/resources/features.xml @@ -53,9 +53,6 @@ <bundle dependency="true">mvn:org.jboss.logging/jboss-logging/${jboss.logging.version}</bundle> <bundle dependency="true">mvn:org.jgroups/jgroups/${jgroups.version}</bundle> - - <bundle dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.json-api-1.1/${servicemix.json-1.1.spec.version}</bundle> - <bundle>mvn:org.apache.johnzon/johnzon-core/${johnzon.version}</bundle> </feature> <feature name="artemis-core" version="${pom.version}" description="ActiveMQ Artemis broker libraries"> diff --git a/artemis-jms-client-osgi/pom.xml b/artemis-jms-client-osgi/pom.xml index 6a43150ecb..e95708fb3e 100644 --- a/artemis-jms-client-osgi/pom.xml +++ b/artemis-jms-client-osgi/pom.xml @@ -107,6 +107,7 @@ <instructions> <Embed-Dependency>*;scope=compile|runtime;groupId=org.apache.activemq</Embed-Dependency> <Import-Package> + org.glassfish.json*;resolution:=optional, io.netty.buffer;io.netty.*;version="[4.1,5)", * </Import-Package> diff --git a/artemis-server-osgi/pom.xml b/artemis-server-osgi/pom.xml index b6dd8e49c8..8a60d7548f 100644 --- a/artemis-server-osgi/pom.xml +++ b/artemis-server-osgi/pom.xml @@ -147,6 +147,7 @@ <Embed-Dependency>*;scope=compile|runtime;groupId=org.apache.activemq</Embed-Dependency> <Import-Package> org.postgresql*;resolution:=optional, + org.glassfish.json*;resolution:=optional, io.netty.buffer;io.netty.*;version="[4.1,5)", * </Import-Package> diff --git a/pom.xml b/pom.xml index 1ee3834ace..8a539d738c 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ <module>integration/activemq-spring-integration</module> <module>artemis-distribution</module> <module>tests</module> - <!-- <module>artemis-features</module> --> + <module>artemis-features</module> <module>artemis-quorum-api</module> <module>artemis-quorum-ri</module> </modules> @@ -105,6 +105,7 @@ <errorprone.version>2.9.0</errorprone.version> <maven.enforcer.plugin.version>3.0.0-M3</maven.enforcer.plugin.version> <maven.bundle.plugin.version>5.1.2</maven.bundle.plugin.version> + <maven.shade.plugin.version>3.2.4</maven.shade.plugin.version> <maven.checkstyle.plugin.version>3.1.1</maven.checkstyle.plugin.version> <sevntu.checks.version>1.39.0</sevntu.checks.version> <checkstyle.version>8.43</checkstyle.version> @@ -1428,7 +1429,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> - <version>3.2.0</version> + <version>${maven.shade.plugin.version}</version> </plugin> <plugin> <groupId>org.eclipse.jetty</groupId> ``` </p></details> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
