Skip to content

Commit e2f8380

Browse files
authored
Fix sisu-maven-plugin (#203)
The plugin is broken, as it lacks ASM from CP. Added "simple" IT that reveals this. Fix: "demote" ASM to plain dependency, so users even for `sisu-maven-plugin` can change ASM used in their builds. Also, drop the shaded "with ASM" as there is really no need for it. Fixes #201
1 parent 15d4ce5 commit e2f8380

File tree

9 files changed

+88
-59
lines changed

9 files changed

+88
-59
lines changed

org.eclipse.sisu.inject/bnd.bnd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ Main-Class: org.eclipse.sisu.launch.Main
66
org.sonatype.inject;x-internal:=true
77
# remove annotation processor dependencies (never used at runtime)
88
# mark all optional dependencies as optional
9-
# although ASM is required at runtime, mark as optional to reuse the relocated manifest header for the embedded ASM bundle version
109
Import-Package: javax.inject,\
10+
org.objectweb.asm.*,\
1111
com.google.inject.servlet;resolution:=optional,\
1212
javax.servlet.*;resolution:=optional,\
1313
org.slf4j.*;resolution:=optional,\
1414
org.junit.*;resolution:=optional,\
1515
junit.framework.*;resolution:=optional,\
1616
org.testng.*;resolution:=optional,\
17-
org.objectweb.asm.*;resolution:=optional,\
1817
!javax.annotation.processing.*,\
1918
!javax.lang.model.*,\
2019
!javax.tools.*,\

org.eclipse.sisu.inject/pom.xml

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@
3838
<artifactId>guice</artifactId>
3939
<scope>provided</scope>
4040
</dependency>
41+
42+
<!--
43+
| ASM is required
44+
-->
4145
<dependency>
4246
<groupId>org.ow2.asm</groupId>
4347
<artifactId>asm</artifactId>
44-
<version>${asmVersion}</version>
45-
<scope>provided</scope>
46-
<optional>true</optional>
4748
</dependency>
49+
4850
<!--
4951
| Optional support dependencies
5052
-->
@@ -440,51 +442,4 @@
440442
</plugin>
441443
</plugins>
442444
</reporting>
443-
444-
<profiles>
445-
<profile>
446-
<id>sisu-release</id>
447-
<build>
448-
<plugins>
449-
<plugin>
450-
<groupId>org.apache.maven.plugins</groupId>
451-
<artifactId>maven-shade-plugin</artifactId>
452-
<executions>
453-
<execution>
454-
<phase>package</phase>
455-
<goals>
456-
<goal>shade</goal>
457-
</goals>
458-
<configuration>
459-
<!--
460-
| Create 'embedded_asm' jar which embeds and relocates ASM to package org.eclipse.sisu.space.asm.
461-
-->
462-
<shadedArtifactAttached>true</shadedArtifactAttached>
463-
<shadedClassifierName>embedded_asm</shadedClassifierName>
464-
<filters>
465-
<filter>
466-
<artifact>org.eclipse.sisu:org.eclipse.sisu.inject</artifact>
467-
<excludes>
468-
<exclude>org/eclipse/sisu/space/asm/**</exclude>
469-
</excludes>
470-
</filter>
471-
</filters>
472-
<relocations>
473-
<relocation>
474-
<pattern>org.objectweb.asm</pattern>
475-
<shadedPattern>org.eclipse.sisu.space.asm</shadedPattern>
476-
</relocation>
477-
</relocations>
478-
<transformers>
479-
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
480-
</transformer>
481-
</transformers>
482-
</configuration>
483-
</execution>
484-
</executions>
485-
</plugin>
486-
</plugins>
487-
</build>
488-
</profile>
489-
</profiles>
490445
</project>

org.eclipse.sisu.mojos/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,25 @@
121121
</execution>
122122
</executions>
123123
</plugin>
124+
<plugin>
125+
<groupId>org.apache.maven.plugins</groupId>
126+
<artifactId>maven-invoker-plugin</artifactId>
127+
<configuration>
128+
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
129+
<settingsFile>src/it/settings.xml</settingsFile>
130+
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
131+
<postBuildHookScript>verify</postBuildHookScript>
132+
</configuration>
133+
<executions>
134+
<execution>
135+
<id>integration-test</id>
136+
<goals>
137+
<goal>install</goal>
138+
<goal>run</goal>
139+
</goals>
140+
</execution>
141+
</executions>
142+
</plugin>
124143
</plugins>
125144
</build>
126145

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
3+
4+
</settings>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>org.eclipse.sisu.mojos.it</groupId>
4+
<artifactId>simple</artifactId>
5+
<version>1.0.0-SNAPSHOT</version>
6+
7+
<dependencies>
8+
<dependency>
9+
<groupId>javax.inject</groupId>
10+
<artifactId>javax.inject</artifactId>
11+
<version>1</version>
12+
</dependency>
13+
</dependencies>
14+
15+
<build>
16+
<plugins>
17+
<plugin>
18+
<groupId>org.eclipse.sisu</groupId>
19+
<artifactId>sisu-maven-plugin</artifactId>
20+
<version>@project.version@</version>
21+
<executions>
22+
<execution>
23+
<id>index-project</id>
24+
<goals>
25+
<goal>main-index</goal>
26+
<goal>test-index</goal>
27+
</goals>
28+
</execution>
29+
</executions>
30+
</plugin>
31+
</plugins>
32+
</build>
33+
</project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package simple;
2+
3+
import javax.inject.Named;
4+
5+
@Named
6+
public class Test {
7+
8+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Basic IT: index is created and contains one class FQN
2+
3+
File index = new File(basedir, 'target/classes/META-INF/sisu/javax.inject.Named');
4+
assert index.isFile()
5+
assert index.text.contains('simple.Test')
6+

org.eclipse.sisu.plexus/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@
8383
<artifactId>plexus-xml</artifactId>
8484
</dependency>
8585

86-
<dependency>
87-
<groupId>org.ow2.asm</groupId>
88-
<artifactId>asm</artifactId>
89-
<version>${asmVersion}</version>
90-
<scope>test</scope>
91-
</dependency>
9286
<dependency>
9387
<groupId>org.slf4j</groupId>
9488
<artifactId>slf4j-api</artifactId>

pom.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@
164164
<version>4.0</version>
165165
</dependency>
166166

167+
<dependency>
168+
<groupId>org.ow2.asm</groupId>
169+
<artifactId>asm</artifactId>
170+
<version>${asmVersion}</version>
171+
</dependency>
172+
167173
<!--
168174
| Plexus classloading/utilities
169175
-->
@@ -494,6 +500,11 @@ Bundle-DocURL: http://www.eclipse.org/sisu/
494500
<scmBranch>gh-pages</scmBranch>
495501
</configuration>
496502
</plugin>
503+
<plugin>
504+
<groupId>org.apache.maven.plugins</groupId>
505+
<artifactId>maven-invoker-plugin</artifactId>
506+
<version>3.9.0</version>
507+
</plugin>
497508
<plugin>
498509
<groupId>org.apache.maven.plugins</groupId>
499510
<artifactId>maven-source-plugin</artifactId>
@@ -558,7 +569,7 @@ Bundle-DocURL: http://www.eclipse.org/sisu/
558569
<plugin>
559570
<groupId>org.eclipse.sisu</groupId>
560571
<artifactId>sisu-maven-plugin</artifactId>
561-
<version>0.9.0.M2</version>
572+
<version>0.9.0.M3</version>
562573
<executions>
563574
<execution>
564575
<id>index-project</id>

0 commit comments

Comments
 (0)