Skip to content

Commit

Permalink
Merge pull request #208 from FasterXML/tatu/2.15/207-mrbean-shading-pom
Browse files Browse the repository at this point in the history
Fix #207: try to remove Asm dependency from mrbean module
  • Loading branch information
cowtowncoder committed May 19, 2023
2 parents 72116c8 + ecdb63b commit 911a0c5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 9 deletions.
6 changes: 2 additions & 4 deletions afterburner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ field access and method calls
<!-- 29-Oct-2015, tatu: default export should work fine; but for import may need dynamic/optional
-->

<!-- 09-Oct-2011, tatu: should NOT require "com.fasterxml.jackson.databind.deser.impl", but
Maven Bundle plug-in insists for some reason?!?
Similarly, org.objectweb.asm is shaded... why require?
<!-- 09-Oct-2011, tatu: Similarly, org.objectweb.asm is shaded... why require?
(will try to hide via resolution directive)
-->
<osgi.import>org.objectweb.asm;resolution:=optional,
Expand All @@ -64,7 +62,7 @@ field access and method calls
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</dependency>
<dependency> <!-- tests use Jackson annoations -->
<dependency> <!-- tests use Jackson annotations -->
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<scope>provided</scope>
Expand Down
41 changes: 36 additions & 5 deletions mrbean/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ dynamically ("bean materialization"), integrated with Jackson (although usable e
<osgi.export>
${project.groupId}.mrbean.*;version=${project.version}
</osgi.export>
<!-- default import definitions should work fine -->
<osgi.private>org.objectweb.asm.*</osgi.private>
<!-- 18-May-2023, tatu: As with Afterburner shading, should NOT need to expose via OSGi
-->
<osgi.import>org.objectweb.asm;resolution:=optional,
*
</osgi.import>
<!--
<osgi.private>com.fasterxml.jackson.module.afterburner.asm</osgi.private>
-->
</properties>

<dependencies>
Expand Down Expand Up @@ -89,11 +95,9 @@ ${project.groupId}.mrbean.*;version=${project.version}
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<shadedArtifactId>foobar-shaded</shadedArtifactId>
<artifactSet>
<includes>
<include>org.objectweb.asm:asm</include>
<include>org.ow2.asm:asm</include>
</includes>
</artifactSet>
<relocations>
Expand All @@ -113,6 +117,33 @@ ${project.groupId}.mrbean.*;version=${project.version}
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.github.floverfelt</groupId>
<artifactId>find-and-replace-maven-plugin</artifactId>
<version>1.1.0</version>
<executions>
<execution>
<id>exec</id>
<phase>package</phase>
<goals>
<goal>find-and-replace</goal>
</goals>
<configuration>
<replacementType>file-contents</replacementType>
<baseDir>${basedir}</baseDir>
<findRegex><![CDATA[<modelVersion>4.0.0</modelVersion>]]></findRegex>
<fileMask>dependency-reduced-pom.xml</fileMask>
<replaceValue><![CDATA[ <!-- This module was also published with a richer model, Gradle metadata, -->
<!-- which should be used instead. Do not delete the following line which -->
<!-- is to indicate to Gradle or any Gradle module metadata file consumer -->
<!-- that they should prefer consuming it instead. -->
<!-- do_not_remove: published-with-gradle-metadata -->
<modelVersion>4.0.0</modelVersion>]]></replaceValue>
<recursive>false</recursive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
4 changes: 4 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Active maintainers:
=== Releases ===
------------------------------------------------------------------------

2.15.2 (not yet released)

#207: Mr Bean exposing `Asm` as Maven dependency despite shading

2.15.1 (16-May-2023)

#204: (afterburner, mrbean) Gradle metadata for `jackson-core` `2.15.0` adds
Expand Down

0 comments on commit 911a0c5

Please sign in to comment.