diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-05-16 10:17:12 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-05-16 10:17:12 +0700 |
commit | 45254f588150c944dfde84821308d27cc9d34a37 (patch) | |
tree | 51bfa4cb19820107aa817137e9ffd07b12f7ba10 /aspectjweaver | |
parent | 95fc5eec2de1b46c069f805a0a8657427a1a0a0a (diff) | |
download | aspectj-45254f588150c944dfde84821308d27cc9d34a37.tar.gz aspectj-45254f588150c944dfde84821308d27cc9d34a37.zip |
Replace use of ASM-renamed by original ASM
This involves replacing references in weaver application code as well as
a few tests.
In order to make AspectJ weaver + tools contain a relocated ASM version,
I added a Maven Shade relocation step after Maven Assembly created the
uber JARs. Relocation works for both binaries and sources and also
encompasses Class::forName calls like in class AsmDetector.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'aspectjweaver')
-rw-r--r-- | aspectjweaver/aspectjweaver-assembly.xml | 2 | ||||
-rw-r--r-- | aspectjweaver/pom.xml | 50 |
2 files changed, 48 insertions, 4 deletions
diff --git a/aspectjweaver/aspectjweaver-assembly.xml b/aspectjweaver/aspectjweaver-assembly.xml index 332504316..3433f6555 100644 --- a/aspectjweaver/aspectjweaver-assembly.xml +++ b/aspectjweaver/aspectjweaver-assembly.xml @@ -16,7 +16,7 @@ <!-- Avoid warning when trying to add non-existing main artifact JAR --> <useProjectArtifact>false</useProjectArtifact> <includes> - <include>org.aspectj:asm-renamed</include> + <include>org.ow2.asm:asm</include> </includes> </dependencySet> </dependencySets> diff --git a/aspectjweaver/pom.xml b/aspectjweaver/pom.xml index a9147dd14..6689fbb6e 100644 --- a/aspectjweaver/pom.xml +++ b/aspectjweaver/pom.xml @@ -50,7 +50,8 @@ <configuration> <classifier>sources</classifier> <!--<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>--> - <includeArtifactIds>asm-renamed</includeArtifactIds> + <includeGroupIds>org.ow2.asm</includeGroupIds> + <includeArtifactIds>asm</includeArtifactIds> <outputDirectory>${project.build.directory}/unzipped-sources</outputDirectory> <!-- Avoid accidentally shading test-scoped dependencies like JUnit --> <includeScope>runtime</includeScope> @@ -143,6 +144,49 @@ </executions> </plugin> + <!-- + Relocate ASM from 'org.objectweb.asm' to 'aj.org.objectweb.asm' + + TODO: Using Maven Shade after Maven Assembly instead of creating uber JAR and relocating package names at the + same time is suboptimal and maybe slower than doing both at the same time. Migrating from Assembly to Shade + requires all dependencies to produce source JARs, though, which currently is not the case. Because we also + want to create a complete source JAR, for now we keep Assembly around, because it manually copies project + sources from their respective directories before zipping them up. + --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <configuration> + <createSourcesJar>true</createSourcesJar> + <createDependencyReducedPom>false</createDependencyReducedPom> + <shadedArtifactAttached>false</shadedArtifactAttached> + </configuration> + <executions> + <execution> + <id>asm-relocate</id> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <minimizeJar>false</minimizeJar> + <shadeSourcesContent>true</shadeSourcesContent> + <artifactSet> + <includes> + <include>${project.groupId}:${project.artifactId}</include> + </includes> + </artifactSet> + <relocations> + <relocation> + <pattern>org.objectweb.asm</pattern> + <shadedPattern>aj.org.objectweb.asm</shadedPattern> + </relocation> + </relocations> + </configuration> + </execution> + </executions> + </plugin> + <!-- Caveat: Attaching the flattened POM needs packaging=jar, so do not use packaging=pom for this module --> <plugin> <groupId>org.codehaus.mojo</groupId> @@ -178,8 +222,8 @@ <version>${project.version}</version> </dependency> <dependency> - <groupId>org.aspectj</groupId> - <artifactId>asm-renamed</artifactId> + <groupId>org.ow2.asm</groupId> + <artifactId>asm</artifactId> </dependency> </dependencies> |