Skip to content

Commit ac78884

Browse files
committed
fix issues/779 using Multi-Release jar
Signed-off-by: Ceki Gulcu <[email protected]>
1 parent 9078f68 commit ac78884

File tree

3 files changed

+309
-196
lines changed

3 files changed

+309
-196
lines changed

logback-core/pom.xml

Lines changed: 185 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -3,156 +3,190 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55

6-
<modelVersion>4.0.0</modelVersion>
7-
8-
<parent>
9-
<groupId>ch.qos.logback</groupId>
10-
<artifactId>logback-parent</artifactId>
11-
<version>1.5.0-SNAPSHOT</version>
12-
</parent>
13-
14-
<artifactId>logback-core</artifactId>
15-
<packaging>jar</packaging>
16-
<name>Logback Core Module</name>
17-
<description>logback-core module</description>
18-
19-
<properties>
20-
<module-name>ch.qos.logback.core</module-name>
21-
</properties>
22-
23-
<dependencies>
24-
25-
<dependency>
26-
<groupId>org.codehaus.janino</groupId>
27-
<artifactId>janino</artifactId>
28-
<scope>compile</scope>
29-
<optional>true</optional>
30-
</dependency>
31-
<dependency>
32-
<groupId>org.codehaus.janino</groupId>
33-
<artifactId>commons-compiler</artifactId>
34-
<scope>compile</scope>
35-
<optional>true</optional>
36-
</dependency>
37-
<dependency>
38-
<groupId>org.fusesource.jansi</groupId>
39-
<artifactId>jansi</artifactId>
40-
<optional>true</optional>
41-
</dependency>
42-
43-
<dependency>
44-
<groupId>jakarta.mail</groupId>
45-
<artifactId>jakarta.mail-api</artifactId>
46-
<scope>compile</scope>
47-
<optional>true</optional>
48-
</dependency>
49-
50-
<dependency>
51-
<groupId>org.eclipse.angus</groupId>
52-
<artifactId>angus-mail</artifactId>
53-
<scope>test</scope>
54-
</dependency>
55-
56-
<dependency>
57-
<groupId>jakarta.servlet</groupId>
58-
<artifactId>jakarta.servlet-api</artifactId>
59-
<scope>compile</scope>
60-
<optional>true</optional>
61-
</dependency>
62-
63-
64-
<dependency>
65-
<groupId>org.mockito</groupId>
66-
<artifactId>mockito-core</artifactId>
67-
<scope>test</scope>
68-
</dependency>
69-
70-
</dependencies>
71-
72-
<build>
73-
<plugins>
74-
75-
<plugin>
76-
<groupId>org.apache.maven.plugins</groupId>
77-
<artifactId>maven-surefire-plugin</artifactId>
78-
<configuration>
79-
80-
<!--<argLine>XXadd-opens ch.qos.logback.core/ch.qos.logback.core.testUtil=java.naming</argLine>-->
81-
<!--<argLine>add-opens ch.qos.logback.core/ch.qos.logback.core.testUtil=java.naming
82-
add-reads ch.qos.logback.core=ALL-UNNAMED</argLine>-->
83-
<argLine>
84-
--add-opens ch.qos.logback.core/ch.qos.logback.core.testUtil=java.naming
85-
--add-reads ch.qos.logback.core=ALL-UNNAMED
86-
</argLine>
87-
<parallel>classes</parallel>
88-
<threadCount>8</threadCount>
89-
<!--<useUnlimitedThreads>false</useUnlimitedThreads>-->
90-
<forkCount>1</forkCount>
91-
<reuseForks>true</reuseForks>
92-
<reportFormat>plain</reportFormat>
93-
<trimStackTrace>false</trimStackTrace>
94-
<!-- See https://issues.apache.org/jira/browse/SUREFIRE-1265 -->
95-
<childDelegation>true</childDelegation>
96-
<excludes>
97-
<exclude>**/All*Test.java</exclude>
98-
<exclude>**/PackageTest.java</exclude>
99-
<!-- ConsoleAppenderTest redirects System.out which is not well tolerated by Maven -->
100-
<exclude>**/ConsoleAppenderTest.java</exclude>
101-
102-
103-
</excludes>
104-
</configuration>
105-
</plugin>
106-
<plugin>
107-
<groupId>org.apache.maven.plugins</groupId>
108-
<artifactId>maven-jar-plugin</artifactId>
109-
110-
<configuration>
111-
<archive>
112-
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
113-
</archive>
114-
</configuration>
115-
116-
<executions>
117-
<execution>
118-
<id>bundle-test-jar</id>
119-
<phase>package</phase>
120-
<goals>
121-
<goal>test-jar</goal>
122-
</goals>
123-
</execution>
124-
</executions>
125-
</plugin>
126-
127-
<plugin>
128-
<groupId>org.apache.felix</groupId>
129-
<artifactId>maven-bundle-plugin</artifactId>
130-
131-
<executions>
132-
<execution>
133-
<id>bundle-manifest</id>
134-
<phase>process-classes</phase>
135-
<goals>
136-
<goal>manifest</goal>
137-
</goals>
138-
</execution>
139-
</executions>
140-
<configuration>
141-
<instructions>
142-
<Export-Package>ch.qos.logback.core*</Export-Package>
143-
<Import-Package>
144-
ch.qos.logback.core*;version="${range;[==,+);${version_cleanup;${project.version}}}",
145-
jakarta.*;resolution:=optional,
146-
org.xml.*;resolution:=optional,
147-
org.fusesource.jansi;resolution:=optional,
148-
org.codehaus.janino;resolution:=optional,
149-
org.codehaus.commons.compiler;resolution:=optional,
150-
*
151-
</Import-Package>
152-
</instructions>
153-
</configuration>
154-
</plugin>
155-
</plugins>
156-
</build>
6+
<modelVersion>4.0.0</modelVersion>
7+
8+
<parent>
9+
<groupId>ch.qos.logback</groupId>
10+
<artifactId>logback-parent</artifactId>
11+
<version>1.5.0-SNAPSHOT</version>
12+
</parent>
13+
14+
<artifactId>logback-core</artifactId>
15+
<packaging>jar</packaging>
16+
<name>Logback Core Module</name>
17+
<description>logback-core module</description>
18+
19+
<properties>
20+
<module-name>ch.qos.logback.core</module-name>
21+
</properties>
22+
23+
<dependencies>
24+
25+
<dependency>
26+
<groupId>org.codehaus.janino</groupId>
27+
<artifactId>janino</artifactId>
28+
<scope>compile</scope>
29+
<optional>true</optional>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.codehaus.janino</groupId>
33+
<artifactId>commons-compiler</artifactId>
34+
<scope>compile</scope>
35+
<optional>true</optional>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.fusesource.jansi</groupId>
39+
<artifactId>jansi</artifactId>
40+
<optional>true</optional>
41+
</dependency>
42+
43+
<dependency>
44+
<groupId>jakarta.mail</groupId>
45+
<artifactId>jakarta.mail-api</artifactId>
46+
<scope>compile</scope>
47+
<optional>true</optional>
48+
</dependency>
49+
50+
<dependency>
51+
<groupId>org.eclipse.angus</groupId>
52+
<artifactId>angus-mail</artifactId>
53+
<scope>test</scope>
54+
</dependency>
55+
56+
<dependency>
57+
<groupId>jakarta.servlet</groupId>
58+
<artifactId>jakarta.servlet-api</artifactId>
59+
<scope>compile</scope>
60+
<optional>true</optional>
61+
</dependency>
62+
63+
64+
<dependency>
65+
<groupId>org.mockito</groupId>
66+
<artifactId>mockito-core</artifactId>
67+
<scope>test</scope>
68+
</dependency>
69+
70+
</dependencies>
71+
72+
<build>
73+
<plugins>
74+
75+
<plugin>
76+
<groupId>org.apache.maven.plugins</groupId>
77+
<artifactId>maven-compiler-plugin</artifactId>
78+
<version>${maven-compiler-plugin.version}</version>
79+
<executions>
80+
81+
<execution>
82+
<id>default-compile</id>
83+
<goals>
84+
<goal>compile</goal>
85+
</goals>
86+
<configuration>
87+
<source>${jdk.version}</source>
88+
<target>${jdk.version}</target>
89+
</configuration>
90+
</execution>
91+
92+
<execution>
93+
<id>java21-compile</id>
94+
<phase>compile</phase>
95+
<goals>
96+
<goal>compile</goal>
97+
</goals>
98+
<configuration>
99+
<release>21</release>
100+
<compileSourceRoots>
101+
<compileSourceRoot>${project.basedir}/src/main/java21</compileSourceRoot>
102+
</compileSourceRoots>
103+
<multiReleaseOutput>true</multiReleaseOutput>
104+
</configuration>
105+
</execution>
106+
</executions>
107+
</plugin>
108+
<plugin>
109+
<groupId>org.apache.maven.plugins</groupId>
110+
<artifactId>maven-surefire-plugin</artifactId>
111+
<configuration>
112+
113+
<!--<argLine>XXadd-opens ch.qos.logback.core/ch.qos.logback.core.testUtil=java.naming</argLine>-->
114+
<!--<argLine>add-opens ch.qos.logback.core/ch.qos.logback.core.testUtil=java.naming
115+
add-reads ch.qos.logback.core=ALL-UNNAMED</argLine>-->
116+
<argLine>
117+
--add-opens ch.qos.logback.core/ch.qos.logback.core.testUtil=java.naming
118+
--add-reads ch.qos.logback.core=ALL-UNNAMED
119+
</argLine>
120+
<parallel>classes</parallel>
121+
<threadCount>8</threadCount>
122+
<!--<useUnlimitedThreads>false</useUnlimitedThreads>-->
123+
<forkCount>1</forkCount>
124+
<reuseForks>true</reuseForks>
125+
<reportFormat>plain</reportFormat>
126+
<trimStackTrace>false</trimStackTrace>
127+
<!-- See https://issues.apache.org/jira/browse/SUREFIRE-1265 -->
128+
<childDelegation>true</childDelegation>
129+
<excludes>
130+
<exclude>**/All*Test.java</exclude>
131+
<exclude>**/PackageTest.java</exclude>
132+
<!-- ConsoleAppenderTest redirects System.out which is not well tolerated by Maven -->
133+
<exclude>**/ConsoleAppenderTest.java</exclude>
134+
135+
136+
</excludes>
137+
</configuration>
138+
</plugin>
139+
<plugin>
140+
<groupId>org.apache.maven.plugins</groupId>
141+
<artifactId>maven-jar-plugin</artifactId>
142+
143+
<configuration>
144+
<archive>
145+
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
146+
</archive>
147+
</configuration>
148+
149+
<executions>
150+
<execution>
151+
<id>bundle-test-jar</id>
152+
<phase>package</phase>
153+
<goals>
154+
<goal>test-jar</goal>
155+
</goals>
156+
</execution>
157+
</executions>
158+
</plugin>
159+
160+
<plugin>
161+
<groupId>org.apache.felix</groupId>
162+
<artifactId>maven-bundle-plugin</artifactId>
163+
164+
<executions>
165+
<execution>
166+
<id>bundle-manifest</id>
167+
<phase>process-classes</phase>
168+
<goals>
169+
<goal>manifest</goal>
170+
</goals>
171+
</execution>
172+
</executions>
173+
<configuration>
174+
<instructions>
175+
<Multi-Release>true</Multi-Release>
176+
<Export-Package>ch.qos.logback.core*</Export-Package>
177+
<Import-Package>
178+
ch.qos.logback.core*;version="${range;[==,+);${version_cleanup;${project.version}}}",
179+
jakarta.*;resolution:=optional,
180+
org.xml.*;resolution:=optional,
181+
org.fusesource.jansi;resolution:=optional,
182+
org.codehaus.janino;resolution:=optional,
183+
org.codehaus.commons.compiler;resolution:=optional,
184+
*
185+
</Import-Package>
186+
</instructions>
187+
</configuration>
188+
</plugin>
189+
</plugins>
190+
</build>
157191

158192
</project>

0 commit comments

Comments
 (0)