Skip to content

Commit bc94340

Browse files
authored
Adopt jakarta packages in EclipseLink (#745)
Signed-off-by: Maxim Nesen <[email protected]>
1 parent a04f529 commit bc94340

File tree

4,433 files changed

+20472
-20440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,433 files changed

+20472
-20440
lines changed

bundles/distribution/pom.xml

+109-55
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0 which is available at
@@ -43,6 +43,14 @@
4343
<dependencies>
4444
<!--Binary dependencies-->
4545
<!--Other modules-->
46+
<dependency>
47+
<groupId>jakarta.persistence</groupId>
48+
<artifactId>jakarta.persistence-api</artifactId>
49+
</dependency>
50+
<dependency>
51+
<groupId>jakarta.annotation</groupId>
52+
<artifactId>jakarta.annotation-api</artifactId>
53+
</dependency>
4654
<dependency>
4755
<groupId>org.eclipse.persistence</groupId>
4856
<artifactId>eclipselink</artifactId>
@@ -199,7 +207,7 @@
199207
<dependency>
200208
<groupId>jakarta.xml.bind</groupId>
201209
<artifactId>jakarta.xml.bind-api</artifactId>
202-
<version>${jaxb.version}</version>
210+
<version>${jaxb.api.version}</version>
203211
</dependency>
204212
<dependency>
205213
<groupId>org.apache.ant</groupId>
@@ -458,7 +466,7 @@
458466
<dependency>
459467
<groupId>jakarta.xml.bind</groupId>
460468
<artifactId>jakarta.xml.bind-api</artifactId>
461-
<version>${jaxb.version}</version>
469+
<version>${jaxb.api.version}</version>
462470
<classifier>sources</classifier>
463471
</dependency>
464472
<!--Javadoc dependencies-->
@@ -468,6 +476,12 @@
468476
<version>${project.version}</version>
469477
<classifier>javadoc</classifier>
470478
</dependency>
479+
<dependency> <!-- TODO: jakartify after PaxExam supports jakarta.* Inject-->
480+
<groupId>jakarta.inject</groupId>
481+
<artifactId>jakarta.inject-api</artifactId>
482+
<version>1.0</version>
483+
<scope>test</scope>
484+
</dependency>
471485
</dependencies>
472486

473487
<build>
@@ -668,58 +682,98 @@
668682
</execution>
669683
</executions>
670684
</plugin>
671-
<plugin>
672-
<groupId>org.apache.maven.plugins</groupId>
673-
<artifactId>maven-failsafe-plugin</artifactId>
674-
<executions>
675-
<execution>
676-
<id>installer-test</id>
677-
<phase>integration-test</phase>
678-
<goals>
679-
<goal>integration-test</goal>
680-
</goals>
681-
<configuration>
682-
<environmentVariables>
683-
<ECLIPSELINK_UNZIP_DIR>${eclipselink.unzip.dir}</ECLIPSELINK_UNZIP_DIR>
684-
</environmentVariables>
685-
<includes>
686-
<include>org.eclipse.persistence.testing.jaxb.installer.InstallerTestSuite</include>
687-
</includes>
688-
</configuration>
689-
</execution>
690-
<execution>
691-
<id>osgi-test</id>
692-
<phase>integration-test</phase>
693-
<goals>
694-
<goal>integration-test</goal>
695-
</goals>
696-
<configuration>
697-
<!--<skip>true</skip>-->
698-
<systemProperties>
699-
<moxytest.2.common.plugins.dir>${project.build.directory}/${osgi.test.plugins.dir}</moxytest.2.common.plugins.dir>
700-
<build.qualifier>${build.type}</build.qualifier>
701-
<release.version>${release.version}</release.version>
702-
<jaxb-api.jar>jakarta.xml.bind-api.jar</jaxb-api.jar>
703-
<jaxrs.jar>jakarta.ws.rs-api.jar</jaxrs.jar>
704-
<asm.jar>org.eclipse.persistence.asm_${release.version}.${build.type}.jar</asm.jar>
705-
<asm.version>${asm.bundle.version}</asm.version>
706-
<javax.validation.lib>${project.build.directory}/${osgi.test.plugins.dir}/jakarta.validation-api.jar</javax.validation.lib>
707-
</systemProperties>
708-
<includes>
709-
<include>org.eclipse.persistence.testing.osgi.beanvalidation.NoBeanValidationTest</include>
710-
<include>org.eclipse.persistence.testing.osgi.beanvalidation.BeanValidationTest</include>
711-
<include>org.eclipse.persistence.testing.osgi.OSGiBundleTest</include>
712-
</includes>
713-
</configuration>
714-
</execution>
715-
<execution>
716-
<id>verify-installer-osgi-tests</id>
717-
<goals>
718-
<goal>verify</goal>
719-
</goals>
720-
</execution>
721-
</executions>
722-
</plugin>
723685
</plugins>
724686
</build>
687+
<profiles>
688+
<profile>
689+
<id>jdk1.8</id>
690+
<activation>
691+
<jdk>1.8</jdk>
692+
</activation>
693+
<build>
694+
<plugins>
695+
<plugin>
696+
<groupId>org.apache.maven.plugins</groupId>
697+
<artifactId>maven-failsafe-plugin</artifactId>
698+
<executions>
699+
<execution>
700+
<id>installer-test</id>
701+
<phase>integration-test</phase>
702+
<goals>
703+
<goal>integration-test</goal>
704+
</goals>
705+
<configuration>
706+
<environmentVariables>
707+
<ECLIPSELINK_UNZIP_DIR>${eclipselink.unzip.dir}</ECLIPSELINK_UNZIP_DIR>
708+
</environmentVariables>
709+
<includes>
710+
<include>org.eclipse.persistence.testing.jaxb.installer.InstallerTestSuite
711+
</include>
712+
</includes>
713+
</configuration>
714+
</execution>
715+
</executions>
716+
</plugin>
717+
</plugins>
718+
</build>
719+
</profile>
720+
<profile>
721+
<id>jdk11+</id>
722+
<!--
723+
OSGi tests after jakartification can be run only under JDK 11 or higher due to
724+
jakartified dependencies which from now on requires JDK 11 environment
725+
-->
726+
<activation>
727+
<jdk>[11,)</jdk>
728+
</activation>
729+
<build>
730+
<plugins>
731+
<plugin>
732+
<groupId>org.apache.maven.plugins</groupId>
733+
<artifactId>maven-failsafe-plugin</artifactId>
734+
<executions>
735+
<execution>
736+
<id>osgi-test</id>
737+
<phase>integration-test</phase>
738+
<goals>
739+
<goal>integration-test</goal>
740+
</goals>
741+
<configuration>
742+
<!--<skip>true</skip>-->
743+
<systemProperties>
744+
<moxytest.2.common.plugins.dir>
745+
${project.build.directory}/${osgi.test.plugins.dir}
746+
</moxytest.2.common.plugins.dir>
747+
<build.qualifier>${build.type}</build.qualifier>
748+
<release.version>${release.version}</release.version>
749+
<jaxb-api.jar>jakarta.xml.bind-api.jar</jaxb-api.jar>
750+
<jaxrs.jar>jakarta.ws.rs-api.jar</jaxrs.jar>
751+
<asm.jar>org.eclipse.persistence.asm_${release.version}.${build.type}.jar
752+
</asm.jar>
753+
<asm.version>${asm.bundle.version}</asm.version>
754+
<jakarta.validation.lib>
755+
${project.build.directory}/${osgi.test.plugins.dir}/jakarta.validation-api.jar
756+
</jakarta.validation.lib>
757+
</systemProperties>
758+
<includes>
759+
<include>
760+
org.eclipse.persistence.testing.osgi.beanvalidation.NoBeanValidationTest
761+
</include>
762+
<!-- <include>org.eclipse.persistence.testing.osgi.beanvalidation.BeanValidationTest</include>-->
763+
<include>org.eclipse.persistence.testing.osgi.OSGiBundleTest</include>
764+
</includes>
765+
</configuration>
766+
</execution>
767+
<execution>
768+
<id>verify-installer-osgi-tests</id>
769+
<goals>
770+
<goal>verify</goal>
771+
</goals>
772+
</execution>
773+
</executions>
774+
</plugin>
775+
</plugins>
776+
</build>
777+
</profile>
778+
</profiles>
725779
</project>

bundles/distribution/src/main/scripts/dbws/dbwsbuilder.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
44
#
55
# This program and the accompanying materials are made available under the
66
# terms of the Eclipse Public License v. 2.0 which is available at

bundles/distribution/src/main/scripts/jaxb-compiler.cmd

100755100644
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@REM
2-
@REM Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
2+
@REM Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
33
@REM
44
@REM This program and the accompanying materials are made available under the
55
@REM terms of the Eclipse Public License v. 2.0 which is available at

bundles/distribution/src/main/scripts/jaxb-compiler.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
44
#
55
# This program and the accompanying materials are made available under the
66
# terms of the Eclipse Public License v. 2.0 which is available at
@@ -24,8 +24,8 @@ CLASSPATH=`dirname $0`/../jlib/moxy/jaxb-osgi.jar:\
2424
`dirname $0`/../jlib/moxy/jakarta.activation.jar:\
2525
`dirname $0`/../jlib/moxy/jakarta.json.jar:\
2626
`dirname $0`/../jlib/moxy/jakarta.validation-api.jar:\
27-
`dirname $0`/../jlib/eclipselink.jar
28-
JAXB_API=`dirname $0`/../jlib/moxy/api/jakarta.xml.bind-api.jar
27+
`dirname $0`/../jlib/eclipselink.jar:\
28+
`dirname $0`/../jlib/moxy/api/jakarta.xml.bind-api.jar
2929
ENDORSED_DIR=../jlib/moxy/api
3030
MAIN_CLASS=org.eclipse.persistence.jaxb.xjc.MOXyXJC
3131
JAVA_ARGS="$@"
@@ -40,5 +40,5 @@ then
4040
${JAVA_HOME}/bin/java ${JVM_ARGS} -cp ${CLASSPATH} -Djava.endorsed.dirs=${ENDORSED_DIR} ${MAIN_CLASS} ${JAVA_ARGS}
4141
else
4242
#Java >8
43-
${JAVA_HOME}/bin/java ${JVM_ARGS} -cp ${CLASSPATH}:${JAXB_API} ${MAIN_CLASS} ${JAVA_ARGS}
43+
${JAVA_HOME}/bin/java ${JVM_ARGS} -cp ${CLASSPATH} ${MAIN_CLASS} ${JAVA_ARGS}
4444
fi

bundles/distribution/src/main/scripts/rename/packageRename.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
44
#
55
# This program and the accompanying materials are made available under the
66
# terms of the Eclipse Public License v. 2.0 which is available at

bundles/distribution/src/main/scripts/sdo-compiler.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
44
#
55
# This program and the accompanying materials are made available under the
66
# terms of the Eclipse Public License v. 2.0 which is available at

bundles/distribution/src/main/scripts/sdo-jaxb-compiler.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
44
#
55
# This program and the accompanying materials are made available under the
66
# terms of the Eclipse Public License v. 2.0 which is available at

bundles/distribution/src/main/scripts/setenv.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
44
#
55
# This program and the accompanying materials are made available under the
66
# terms of the Eclipse Public License v. 2.0 which is available at

bundles/distribution/src/test/java/org/eclipse/persistence/testing/jaxb/installer/JaxbCompilerTestCase.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -35,16 +35,16 @@ public class JaxbCompilerTestCase extends junit.framework.TestCase {
3535
*/
3636
public void testJaxbCompiler() throws Exception {
3737

38-
String eclipselinkUnzipDir = System.getenv("ECLIPSELINK_UNZIP_DIR");
38+
String eclipselinkUnzipDir = "target/eclipselink.zip-tmp";//System.getenv("ECLIPSELINK_UNZIP_DIR");
3939

4040
String jaxbCompiler = "jaxb-compiler";
4141

4242
// run jaxb-compiler.cmd or jaxb-compiler.sh
4343
String osName = System.getProperty("os.name");
4444
if (null != osName && osName.startsWith("Windows")) {
45-
jaxbCompiler = jaxbCompiler += ".cmd";
45+
jaxbCompiler += ".cmd";
4646
} else {
47-
jaxbCompiler = jaxbCompiler += ".sh";
47+
jaxbCompiler += ".sh";
4848
}
4949

5050
File resourceFile = new File(Thread.currentThread().getContextClassLoader().getResource(WORK_ITEM_RESOURCE_XSD).toURI());

bundles/distribution/src/test/java/org/eclipse/persistence/testing/osgi/OSGITestHelper.java

+21-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -21,11 +21,8 @@
2121
import static org.ops4j.pax.exam.CoreOptions.junitBundles;
2222
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
2323
import static org.ops4j.pax.exam.CoreOptions.options;
24+
import static org.ops4j.pax.exam.CoreOptions.systemPackage;
2425
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
25-
import static org.ops4j.pax.exam.CoreOptions.vmOptions;
26-
import static org.ops4j.pax.exam.CoreOptions.when;
27-
28-
import org.eclipse.persistence.internal.helper.JavaSEPlatform;
2926

3027
/**
3128
* Helper class with PAX options for different kind of OSGi tests.
@@ -35,23 +32,35 @@
3532
*/
3633
public class OSGITestHelper {
3734
// Environment variables defined in antbuild.properties/antbuild.xml
38-
private static final String PLUGINS_DIR = System.getProperty("moxytest.2.common.plugins.dir");
39-
private static final String QUALIFIER = System.getProperty("build.qualifier", "qualifier");
40-
private static final String RELEASE_VERSION = System.getProperty("release.version", "2.7.0");
41-
private static final String ACTIVATION_JAR = System.getProperty("activation.jar", "jakarta.activation.jar");
35+
private static final String PLUGINS_DIR = System.getProperty("moxytest.2.common.plugins.dir","target/osgi-test-plugins/");
36+
private static final String QUALIFIER = System.getProperty("build.qualifier", "SNAPSHOT");
37+
private static final String RELEASE_VERSION = System.getProperty("release.version", "3.0.0");
38+
private static final String ACTIVATION_JAR = System.getProperty("activation.jar", "jakarta.activation-api.jar");
39+
private static final String PERSISTENCE_JAR = System.getProperty("persistence.jar", "jakarta.persistence-api.jar");
4240
private static final String JAXB_API_JAR = System.getProperty("jaxb-api.jar", "jakarta.xml.bind-api.jar");
41+
private static final String JAXB_OSGI = System.getProperty("jaxb-osgi.jar", "jaxb-osgi.jar");
4342
private static final String JAXRS_JAR = System.getProperty("jaxrs.jar", "jakarta.ws.rs-api.jar");
44-
private static final String ASM_JAR = System.getProperty("asm.jar", "org.eclipse.persistence.asm_7.1.0.v201909231337.jar");
43+
private static final String ASM_JAR = System.getProperty("asm.jar", "org.eclipse.persistence.asm_3.0.0.SNAPSHOT.jar");
4544
private static final String ASM_VERSION = System.getProperty("asm.version", "7.1.0.v201909231337");
46-
private static final String BEAN_VALIDATION_LIB = System.getProperty("javax.validation.lib", "jakarta.validation-api.jar");
45+
private static final String BEAN_VALIDATION_LIB = System.getProperty("jakarta.validation.lib", "jakarta.validation-api.jar");
4746

4847
public static Option[] getDefaultOptions() {
48+
4949
return options(
50+
5051
systemProperty("asm.version").value(ASM_VERSION),
5152
// JAXB API
5253
bundle("file:" + PLUGINS_DIR + ACTIVATION_JAR),
5354
bundle("file:" + PLUGINS_DIR + JAXB_API_JAR),
54-
55+
//JAXB_OSGI
56+
bundle("file:" + PLUGINS_DIR + JAXB_OSGI),
57+
// Jakarta Persistence api
58+
bundle("file:" + PLUGINS_DIR + PERSISTENCE_JAR),
59+
systemPackage("javax.rmi"),
60+
systemPackage("javax.rmi.CORBA"),
61+
systemPackage("org.omg.CORBA"),
62+
systemPackage("org.omg.CORBA.portable"),
63+
systemPackage("org.omg.CORBA_2_3.portable"),
5564
// JAX-RS API
5665
bundle("file:" + PLUGINS_DIR + JAXRS_JAR),
5766

bundles/distribution/src/test/java/org/eclipse/persistence/testing/osgi/OSGiBundleTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -16,7 +16,8 @@
1616

1717
import java.util.logging.Level;
1818
import java.util.logging.Logger;
19-
import javax.inject.Inject;
19+
import javax.inject.Inject; //TODO - this shall be jakartified as soon as PaxExam supports Injection
20+
// from jakarta.inject jakartified API
2021

2122
import org.junit.Assert;
2223
import org.junit.Test;
@@ -180,7 +181,6 @@ private Bundle getMoxyBundle() {
180181
if (this.moxyBundle != null) {
181182
return this.moxyBundle;
182183
}
183-
184184
for (Bundle b : ctx.getBundles()) {
185185
if (b.getSymbolicName().equals(MOXY_BUNDLE_NAME)) {
186186
this.moxyBundle = b;

0 commit comments

Comments
 (0)