Skip to content

Commit ecdb63b

Browse files
committed
Fix #207: try to remove Asm dependency from mrbean module
1 parent 72116c8 commit ecdb63b

File tree

3 files changed

+42
-9
lines changed

3 files changed

+42
-9
lines changed

afterburner/pom.xml

+2-4
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ field access and method calls
3535
<!-- 29-Oct-2015, tatu: default export should work fine; but for import may need dynamic/optional
3636
-->
3737

38-
<!-- 09-Oct-2011, tatu: should NOT require "com.fasterxml.jackson.databind.deser.impl", but
39-
Maven Bundle plug-in insists for some reason?!?
40-
Similarly, org.objectweb.asm is shaded... why require?
38+
<!-- 09-Oct-2011, tatu: Similarly, org.objectweb.asm is shaded... why require?
4139
(will try to hide via resolution directive)
4240
-->
4341
<osgi.import>org.objectweb.asm;resolution:=optional,
@@ -64,7 +62,7 @@ field access and method calls
6462
<groupId>org.ow2.asm</groupId>
6563
<artifactId>asm</artifactId>
6664
</dependency>
67-
<dependency> <!-- tests use Jackson annoations -->
65+
<dependency> <!-- tests use Jackson annotations -->
6866
<groupId>com.fasterxml.jackson.core</groupId>
6967
<artifactId>jackson-annotations</artifactId>
7068
<scope>provided</scope>

mrbean/pom.xml

+36-5
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ dynamically ("bean materialization"), integrated with Jackson (although usable e
3636
<osgi.export>
3737
${project.groupId}.mrbean.*;version=${project.version}
3838
</osgi.export>
39-
<!-- default import definitions should work fine -->
40-
<osgi.private>org.objectweb.asm.*</osgi.private>
39+
<!-- 18-May-2023, tatu: As with Afterburner shading, should NOT need to expose via OSGi
40+
-->
41+
<osgi.import>org.objectweb.asm;resolution:=optional,
42+
*
43+
</osgi.import>
44+
<!--
45+
<osgi.private>com.fasterxml.jackson.module.afterburner.asm</osgi.private>
46+
-->
4147
</properties>
4248

4349
<dependencies>
@@ -89,11 +95,9 @@ ${project.groupId}.mrbean.*;version=${project.version}
8995
<goal>shade</goal>
9096
</goals>
9197
<configuration>
92-
<shadedArtifactAttached>false</shadedArtifactAttached>
93-
<shadedArtifactId>foobar-shaded</shadedArtifactId>
9498
<artifactSet>
9599
<includes>
96-
<include>org.objectweb.asm:asm</include>
100+
<include>org.ow2.asm:asm</include>
97101
</includes>
98102
</artifactSet>
99103
<relocations>
@@ -113,6 +117,33 @@ ${project.groupId}.mrbean.*;version=${project.version}
113117
<groupId>org.moditect</groupId>
114118
<artifactId>moditect-maven-plugin</artifactId>
115119
</plugin>
120+
<plugin>
121+
<groupId>io.github.floverfelt</groupId>
122+
<artifactId>find-and-replace-maven-plugin</artifactId>
123+
<version>1.1.0</version>
124+
<executions>
125+
<execution>
126+
<id>exec</id>
127+
<phase>package</phase>
128+
<goals>
129+
<goal>find-and-replace</goal>
130+
</goals>
131+
<configuration>
132+
<replacementType>file-contents</replacementType>
133+
<baseDir>${basedir}</baseDir>
134+
<findRegex><![CDATA[<modelVersion>4.0.0</modelVersion>]]></findRegex>
135+
<fileMask>dependency-reduced-pom.xml</fileMask>
136+
<replaceValue><![CDATA[ <!-- This module was also published with a richer model, Gradle metadata, -->
137+
<!-- which should be used instead. Do not delete the following line which -->
138+
<!-- is to indicate to Gradle or any Gradle module metadata file consumer -->
139+
<!-- that they should prefer consuming it instead. -->
140+
<!-- do_not_remove: published-with-gradle-metadata -->
141+
<modelVersion>4.0.0</modelVersion>]]></replaceValue>
142+
<recursive>false</recursive>
143+
</configuration>
144+
</execution>
145+
</executions>
146+
</plugin>
116147
</plugins>
117148
</build>
118149
</project>

release-notes/VERSION-2.x

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ Active maintainers:
2020
=== Releases ===
2121
------------------------------------------------------------------------
2222

23+
2.15.2 (not yet released)
24+
25+
#207: Mr Bean exposing `Asm` as Maven dependency despite shading
26+
2327
2.15.1 (16-May-2023)
2428

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

0 commit comments

Comments
 (0)