Skip to content

Commit f4fff47

Browse files
committed
ARIES-2165: Make proxy build and pass tests on java 11, 17 and 21
1 parent 1151543 commit f4fff47

File tree

2 files changed

+126
-69
lines changed

2 files changed

+126
-69
lines changed

proxy/proxy-impl/pom.xml

+87-27
Original file line numberDiff line numberDiff line change
@@ -146,33 +146,6 @@
146146

147147
<build>
148148
<plugins>
149-
<plugin>
150-
<groupId>org.apache.maven.plugins</groupId>
151-
<artifactId>maven-compiler-plugin</artifactId>
152-
</plugin>
153-
<plugin>
154-
<groupId>org.apache.maven.plugins</groupId>
155-
<artifactId>maven-antrun-plugin</artifactId>
156-
<executions>
157-
<execution>
158-
<phase>process-classes</phase>
159-
<configuration>
160-
<target>
161-
<!-- run the Synthesizer on the WovenProxy class -->
162-
<java classname="org.apache.aries.proxy.synthesizer.Synthesizer" classpathref="maven.runtime.classpath" fork="false">
163-
<arg value="${project.build.outputDirectory}/org/apache/aries/proxy/weaving/WovenProxy.class"/>
164-
</java>
165-
166-
<delete dir="${project.build.outputDirectory}/org/apache/aries/proxy/synthesizer"/>
167-
168-
</target>
169-
</configuration>
170-
<goals>
171-
<goal>run</goal>
172-
</goals>
173-
</execution>
174-
</executions>
175-
</plugin>
176149
<plugin>
177150
<groupId>org.apache.aries.versioning</groupId>
178151
<artifactId>org.apache.aries.versioning.plugin</artifactId>
@@ -210,4 +183,91 @@
210183
</plugins>
211184
</build>
212185

186+
<profiles>
187+
<profile>
188+
<id>java9To21</id>
189+
<activation>
190+
<jdk>(8,22)</jdk>
191+
</activation>
192+
<build>
193+
<plugins>
194+
<plugin>
195+
<groupId>org.apache.maven.plugins</groupId>
196+
<artifactId>maven-surefire-plugin</artifactId>
197+
<configuration>
198+
<!-- necessary for making method defineClass accessible -->
199+
<argLine>
200+
--add-opens java.base/java.lang=ALL-UNNAMED
201+
</argLine>
202+
</configuration>
203+
</plugin>
204+
</plugins>
205+
</build>
206+
</profile>
207+
<profile>
208+
<id>java8To17</id>
209+
<activation>
210+
<jdk>[1.8,18)</jdk>
211+
</activation>
212+
<build>
213+
<plugins>
214+
<plugin>
215+
<groupId>org.apache.maven.plugins</groupId>
216+
<artifactId>maven-antrun-plugin</artifactId>
217+
<executions>
218+
<execution>
219+
<phase>process-classes</phase>
220+
<configuration>
221+
<target>
222+
<!-- run the Synthesizer on the WovenProxy class -->
223+
<java classname="org.apache.aries.proxy.synthesizer.Synthesizer" classpathref="maven.runtime.classpath" fork="false">
224+
<arg value="${project.build.outputDirectory}/org/apache/aries/proxy/weaving/WovenProxy.class"/>
225+
</java>
226+
<delete dir="${project.build.outputDirectory}/org/apache/aries/proxy/synthesizer"/>
227+
</target>
228+
</configuration>
229+
<goals>
230+
<goal>run</goal>
231+
</goals>
232+
</execution>
233+
</executions>
234+
</plugin>
235+
</plugins>
236+
</build>
237+
</profile>
238+
<profile>
239+
<id>java21+</id>
240+
<activation>
241+
<jdk>21</jdk>
242+
</activation>
243+
<build>
244+
<plugins>
245+
<plugin>
246+
<groupId>org.apache.maven.plugins</groupId>
247+
<artifactId>maven-antrun-plugin</artifactId>
248+
<executions>
249+
<execution>
250+
<phase>process-classes</phase>
251+
<configuration>
252+
<target>
253+
<!-- run the Synthesizer on the WovenProxy class -->
254+
<!-- diff from previous java versions: fork and jvmarg -->
255+
<java classname="org.apache.aries.proxy.synthesizer.Synthesizer" classpathref="maven.runtime.classpath" fork="true">
256+
<jvmarg value="-Djava.security.manager=allow" />
257+
<arg value="${project.build.outputDirectory}/org/apache/aries/proxy/weaving/WovenProxy.class"/>
258+
</java>
259+
<delete dir="${project.build.outputDirectory}/org/apache/aries/proxy/synthesizer"/>
260+
</target>
261+
</configuration>
262+
<goals>
263+
<goal>run</goal>
264+
</goals>
265+
</execution>
266+
</executions>
267+
</plugin>
268+
</plugins>
269+
</build>
270+
</profile>
271+
</profiles>
272+
213273
</project>

proxy/proxy-itests/pom.xml

+39-42
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@
4545
<properties>
4646
<asm.version>9.7.1</asm.version>
4747
<depends-maven-plugin.version>1.5.0</depends-maven-plugin.version>
48-
<exam.version>4.13.3</exam.version>
48+
<exam.version>4.13.5</exam.version>
4949
<javax.inject.version>1</javax.inject.version>
50-
<logback.version>1.5.16</logback.version>
5150
<org.apache.aries.proxy.api.version>1.1.2-SNAPSHOT</org.apache.aries.proxy.api.version>
5251
<org.apache.aries.proxy.version>1.1.15-SNAPSHOT</org.apache.aries.proxy.version>
5352
<org.eclipse.osgi.version>3.22.0</org.eclipse.osgi.version>
54-
<slf4j-api.version>1.7.7</slf4j-api.version>
5553
<tinybundles.version>2.0.0</tinybundles.version>
5654
<url.version>2.6.16</url.version>
5755
</properties>
@@ -61,12 +59,6 @@
6159
<groupId>org.eclipse.platform</groupId>
6260
<artifactId>org.eclipse.osgi</artifactId>
6361
<version>${org.eclipse.osgi.version}</version>
64-
<scope>provided</scope>
65-
</dependency>
66-
<dependency>
67-
<groupId>org.osgi</groupId>
68-
<artifactId>org.osgi.compendium</artifactId>
69-
<scope>provided</scope>
7062
</dependency>
7163
<dependency>
7264
<groupId>org.apache.aries.proxy</groupId>
@@ -80,22 +72,37 @@
8072
<scope>test</scope>
8173
<version>${org.apache.aries.proxy.version}</version>
8274
</dependency>
83-
84-
<!-- pax exam -->
8575
<dependency>
86-
<groupId>org.slf4j</groupId>
87-
<artifactId>slf4j-api</artifactId>
88-
<version>${slf4j-api.version}</version>
76+
<groupId>org.osgi</groupId>
77+
<artifactId>org.osgi.compendium</artifactId>
78+
<scope>provided</scope>
79+
</dependency>
80+
<dependency>
81+
<groupId>junit</groupId>
82+
<artifactId>junit</artifactId>
83+
<scope>provided</scope>
8984
</dependency>
9085
<dependency>
86+
<groupId>org.ops4j.pax.logging</groupId>
87+
<artifactId>pax-logging-api</artifactId>
88+
<scope>test</scope>
89+
</dependency>
90+
<dependency>
91+
<groupId>org.ops4j.pax.logging</groupId>
92+
<artifactId>pax-logging-service</artifactId>
93+
<scope>test</scope>
94+
</dependency>
95+
96+
<!-- pax exam -->
97+
<dependency>
9198
<groupId>org.ops4j.pax.exam</groupId>
9299
<artifactId>pax-exam</artifactId>
93100
<version>${exam.version}</version>
94101
<scope>test</scope>
95102
</dependency>
96103
<dependency>
97104
<groupId>org.ops4j.pax.exam</groupId>
98-
<artifactId>pax-exam-container-forked</artifactId>
105+
<artifactId>pax-exam-container-native</artifactId>
99106
<version>${exam.version}</version>
100107
<scope>test</scope>
101108
</dependency>
@@ -117,28 +124,11 @@
117124
<version>${url.version}</version>
118125
<scope>test</scope>
119126
</dependency>
120-
<dependency>
121-
<groupId>ch.qos.logback</groupId>
122-
<artifactId>logback-core</artifactId>
123-
<version>${logback.version}</version>
124-
<scope>test</scope>
125-
</dependency>
126-
<dependency>
127-
<groupId>ch.qos.logback</groupId>
128-
<artifactId>logback-classic</artifactId>
129-
<version>${logback.version}</version>
130-
<scope>test</scope>
131-
</dependency>
132127
<dependency>
133128
<groupId>org.ops4j.pax.tinybundles</groupId>
134129
<artifactId>tinybundles</artifactId>
135130
<version>${tinybundles.version}</version>
136131
</dependency>
137-
<dependency>
138-
<groupId>junit</groupId>
139-
<artifactId>junit</artifactId>
140-
<scope>test</scope>
141-
</dependency>
142132

143133
<dependency>
144134
<groupId>org.ow2.asm</groupId>
@@ -170,16 +160,6 @@
170160
<version>${javax.inject.version}</version>
171161
<scope>test</scope>
172162
</dependency>
173-
<dependency>
174-
<groupId>org.ops4j.pax.logging</groupId>
175-
<artifactId>pax-logging-api</artifactId>
176-
<scope>test</scope>
177-
</dependency>
178-
<dependency>
179-
<groupId>org.ops4j.pax.logging</groupId>
180-
<artifactId>pax-logging-service</artifactId>
181-
<scope>test</scope>
182-
</dependency>
183163
</dependencies>
184164

185165
<build>
@@ -201,6 +181,23 @@
201181
</build>
202182

203183
<profiles>
184+
<profile>
185+
<id>java9To21</id>
186+
<activation>
187+
<jdk>(8,22)</jdk>
188+
</activation>
189+
<build>
190+
<plugins>
191+
<plugin>
192+
<groupId>org.apache.maven.plugins</groupId>
193+
<artifactId>maven-surefire-plugin</artifactId>
194+
<configuration>
195+
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
196+
</configuration>
197+
</plugin>
198+
</plugins>
199+
</build>
200+
</profile>
204201
<profile>
205202
<id>ci-build-profile</id>
206203
<activation>

0 commit comments

Comments
 (0)