Skip to content

Commit 8e6bcf0

Browse files
committed
[Misc] Move deprecated JobManager/DefaultJobManager to legacy modules
1 parent 7040c89 commit 8e6bcf0

File tree

10 files changed

+356
-3
lines changed

10 files changed

+356
-3
lines changed

xwiki-commons-core/xwiki-commons-job/xwiki-commons-job-default/pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@
3232
<packaging>jar</packaging>
3333
<description>XWiki Commons - Job - Default</description>
3434
<properties>
35+
<!-- Skipping revapi since xwiki-commons-legacy-job-default wraps this module and runs checks on it -->
36+
<xwiki.revapi.skip>true</xwiki.revapi.skip>
3537
<xwiki.extension.features>
3638
<!-- Old names of this module used for retro compatibility when resolving dependencies of old extensions -->
3739
org.xwiki.commons:xwiki-commons-job
3840
</xwiki.extension.features>
39-
<xwiki.jacoco.instructionRatio>0.62</xwiki.jacoco.instructionRatio>
41+
<xwiki.jacoco.instructionRatio>0.72</xwiki.jacoco.instructionRatio>
4042
</properties>
4143
<dependencies>
4244
<dependency>
@@ -57,7 +59,6 @@
5759
<groupId>jakarta.annotation</groupId>
5860
<artifactId>jakarta.annotation-api</artifactId>
5961
</dependency>
60-
6162
<!-- Test dependencies -->
6263
<dependency>
6364
<groupId>org.xwiki.commons</groupId>

xwiki-commons-core/xwiki-commons-job/xwiki-commons-job-default/src/main/resources/META-INF/components.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
org.xwiki.job.internal.DefaultJobContext
22
org.xwiki.job.internal.DefaultJobExecutor
3-
org.xwiki.job.internal.DefaultJobManager
43
org.xwiki.job.internal.DefaultJobManagerConfiguration
54
org.xwiki.job.internal.DefaultJobProgressManager
65
org.xwiki.job.internal.DefaultJobStatusStorage

xwiki-commons-core/xwiki-commons-legacy/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@
3636
<xwiki.enforcer.no-legacy-dependencies.skip>true</xwiki.enforcer.no-legacy-dependencies.skip>
3737
</properties>
3838
<modules>
39+
<!-- Sorted Alphabetically -->
3940
<module>xwiki-commons-legacy-classloader</module>
4041
<module>xwiki-commons-legacy-component</module>
4142
<module>xwiki-commons-legacy-configuration</module>
43+
<module>xwiki-commons-legacy-job</module>
4244
<module>xwiki-commons-legacy-properties</module>
4345
<module>xwiki-commons-legacy-velocity</module>
4446
<module>xwiki-commons-legacy-velocity-tools</module>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
* See the NOTICE file distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This is free software; you can redistribute it and/or modify it
8+
* under the terms of the GNU Lesser General Public License as
9+
* published by the Free Software Foundation; either version 2.1 of
10+
* the License, or (at your option) any later version.
11+
*
12+
* This software is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this software; if not, write to the Free
19+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21+
-->
22+
23+
<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/maven-v4_0_0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
<parent>
26+
<groupId>org.xwiki.commons</groupId>
27+
<artifactId>xwiki-commons-legacy</artifactId>
28+
<version>17.10.0-SNAPSHOT</version>
29+
</parent>
30+
<artifactId>xwiki-commons-legacy-job</artifactId>
31+
<name>XWiki Commons - Legacy - Job - Parent POM</name>
32+
<packaging>pom</packaging>
33+
<description>Legacy modules for xwiki-commons-job-*</description>
34+
<modules>
35+
<!-- Sorted Alphabetically -->
36+
<module>xwiki-commons-legacy-job-api</module>
37+
<module>xwiki-commons-legacy-job-default</module>
38+
</modules>
39+
</project>
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
* See the NOTICE file distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This is free software; you can redistribute it and/or modify it
8+
* under the terms of the GNU Lesser General Public License as
9+
* published by the Free Software Foundation; either version 2.1 of
10+
* the License, or (at your option) any later version.
11+
*
12+
* This software is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this software; if not, write to the Free
19+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21+
-->
22+
23+
<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/maven-v4_0_0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
<parent>
26+
<groupId>org.xwiki.commons</groupId>
27+
<artifactId>xwiki-commons-legacy-job</artifactId>
28+
<version>17.10.0-SNAPSHOT</version>
29+
</parent>
30+
<artifactId>xwiki-commons-legacy-job-api</artifactId>
31+
<name>XWiki Commons - Legacy - Job - API</name>
32+
<packaging>jar</packaging>
33+
<description>Legacy module for xwiki-commons-job-api</description>
34+
<properties>
35+
<xwiki.jacoco.instructionRatio>0.00</xwiki.jacoco.instructionRatio>
36+
<!-- The features provided by this module so that it's found when resolving extension -->
37+
<xwiki.extension.features>org.xwiki.commons:xwiki-commons-job-api</xwiki.extension.features>
38+
</properties>
39+
<dependencies>
40+
<!-- Trigger xwiki-commons-job-api (but without xwiki-commons-job-api jar itself) -->
41+
<dependency>
42+
<groupId>org.xwiki.commons</groupId>
43+
<artifactId>xwiki-commons-job-api</artifactId>
44+
<version>${project.version}</version>
45+
<type>pom</type>
46+
</dependency>
47+
<!-- Needed for backward compatibility Aspects -->
48+
<dependency>
49+
<groupId>org.aspectj</groupId>
50+
<artifactId>aspectjrt</artifactId>
51+
</dependency>
52+
<!-- We need this dependency so that the wrapped module is built before this one -->
53+
<dependency>
54+
<groupId>org.xwiki.commons</groupId>
55+
<artifactId>xwiki-commons-job-api</artifactId>
56+
<version>${project.version}</version>
57+
<scope>provided</scope>
58+
</dependency>
59+
</dependencies>
60+
<build>
61+
<plugins>
62+
<!-- Apply Compatibility Aspects -->
63+
<plugin>
64+
<groupId>org.codehaus.mojo</groupId>
65+
<artifactId>aspectj-maven-plugin</artifactId>
66+
<executions>
67+
<execution>
68+
<id>backward-compatibility-aspects</id>
69+
<goals>
70+
<goal>compile</goal>
71+
</goals>
72+
</execution>
73+
</executions>
74+
<configuration>
75+
<weaveDependencies>
76+
<weaveDependency>
77+
<groupId>org.xwiki.commons</groupId>
78+
<artifactId>xwiki-commons-job-api</artifactId>
79+
</weaveDependency>
80+
</weaveDependencies>
81+
</configuration>
82+
</plugin>
83+
<!-- Exclude AspectJ's builddef.lst file form the generated JAR since it's not useful there. -->
84+
<plugin>
85+
<groupId>org.apache.maven.plugins</groupId>
86+
<artifactId>maven-jar-plugin</artifactId>
87+
<configuration>
88+
<excludes>
89+
<exclude>**/builddef.lst</exclude>
90+
</excludes>
91+
</configuration>
92+
</plugin>
93+
<!-- Make sure we run the tests only with the aspectified JARs since otherwise components will be registered
94+
twice for example. -->
95+
<plugin>
96+
<groupId>org.apache.maven.plugins</groupId>
97+
<artifactId>maven-surefire-plugin</artifactId>
98+
<configuration>
99+
<classpathDependencyExcludes>
100+
<classpathDependencyExcludes>org.xwiki.commons:xwiki-commons-job-api:jar</classpathDependencyExcludes>
101+
</classpathDependencyExcludes>
102+
</configuration>
103+
</plugin>
104+
</plugins>
105+
</build>
106+
</project>
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
* See the NOTICE file distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This is free software; you can redistribute it and/or modify it
8+
* under the terms of the GNU Lesser General Public License as
9+
* published by the Free Software Foundation; either version 2.1 of
10+
* the License, or (at your option) any later version.
11+
*
12+
* This software is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this software; if not, write to the Free
19+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21+
-->
22+
23+
<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/maven-v4_0_0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
<parent>
26+
<groupId>org.xwiki.commons</groupId>
27+
<artifactId>xwiki-commons-legacy-job</artifactId>
28+
<version>17.10.0-SNAPSHOT</version>
29+
</parent>
30+
<artifactId>xwiki-commons-legacy-job-default</artifactId>
31+
<name>XWiki Commons - Legacy - Job - Default Implementation</name>
32+
<packaging>jar</packaging>
33+
<description>Legacy module for xwiki-commons-job-default</description>
34+
<properties>
35+
<xwiki.jacoco.instructionRatio>0.01</xwiki.jacoco.instructionRatio>
36+
<!-- The features provided by this module so that it's found when resolving extension -->
37+
<xwiki.extension.features>org.xwiki.commons:xwiki-commons-job-default</xwiki.extension.features>
38+
</properties>
39+
<dependencies>
40+
<!-- Trigger xwiki-commons-job-default dependencies (but without xwiki-commons-job-default jar itself) -->
41+
<dependency>
42+
<groupId>org.xwiki.commons</groupId>
43+
<artifactId>xwiki-commons-job-default</artifactId>
44+
<version>${project.version}</version>
45+
<type>pom</type>
46+
<exclusions>
47+
<!-- Trigger legacy version -->
48+
<exclusion>
49+
<groupId>org.xwiki.commons</groupId>
50+
<artifactId>xwiki-commons-job-api</artifactId>
51+
</exclusion>
52+
</exclusions>
53+
</dependency>
54+
<dependency>
55+
<groupId>org.xwiki.commons</groupId>
56+
<artifactId>xwiki-commons-legacy-job-api</artifactId>
57+
<version>${project.version}</version>
58+
</dependency>
59+
<!-- We need this dependency so that the wrapped module is built before this one -->
60+
<dependency>
61+
<groupId>org.xwiki.commons</groupId>
62+
<artifactId>xwiki-commons-job-default</artifactId>
63+
<version>${project.version}</version>
64+
<scope>provided</scope>
65+
<exclusions>
66+
<!-- Trigger legacy version -->
67+
<exclusion>
68+
<groupId>org.xwiki.commons</groupId>
69+
<artifactId>xwiki-commons-job-api</artifactId>
70+
</exclusion>
71+
</exclusions>
72+
</dependency>
73+
<!-- Needed for backward compatibility Aspects -->
74+
<dependency>
75+
<groupId>org.aspectj</groupId>
76+
<artifactId>aspectjrt</artifactId>
77+
</dependency>
78+
<!-- Test dependencies -->
79+
<dependency>
80+
<groupId>org.xwiki.commons</groupId>
81+
<artifactId>xwiki-commons-tool-test-component</artifactId>
82+
<version>${project.version}</version>
83+
<scope>test</scope>
84+
</dependency>
85+
</dependencies>
86+
<build>
87+
<plugins>
88+
<!-- Apply Compatibility Aspects -->
89+
<plugin>
90+
<groupId>org.codehaus.mojo</groupId>
91+
<artifactId>aspectj-maven-plugin</artifactId>
92+
<executions>
93+
<execution>
94+
<id>backward-compatibility-aspects</id>
95+
<goals>
96+
<goal>compile</goal>
97+
</goals>
98+
</execution>
99+
</executions>
100+
<configuration>
101+
<weaveDependencies>
102+
<weaveDependency>
103+
<groupId>org.xwiki.commons</groupId>
104+
<artifactId>xwiki-commons-job-default</artifactId>
105+
</weaveDependency>
106+
</weaveDependencies>
107+
</configuration>
108+
</plugin>
109+
<!-- Exclude AspectJ's builddef.lst file form the generated JAR since it's not useful there. -->
110+
<plugin>
111+
<groupId>org.apache.maven.plugins</groupId>
112+
<artifactId>maven-jar-plugin</artifactId>
113+
<configuration>
114+
<excludes>
115+
<exclude>**/builddef.lst</exclude>
116+
</excludes>
117+
</configuration>
118+
</plugin>
119+
<plugin>
120+
<!-- Merge components.txt files -->
121+
<groupId>org.apache.maven.plugins</groupId>
122+
<artifactId>maven-antrun-plugin</artifactId>
123+
<executions>
124+
<execution>
125+
<phase>process-classes</phase>
126+
<configuration>
127+
<target>
128+
<!-- Add a line separator before appending the legacy components.
129+
NOTE: The following solutions didn't work:
130+
* the fixlastline parameter of the concat task affects only the appended files, NOT the destination
131+
file; we need the new line at the end of the destination file!
132+
* the text content of the header element inside the concat task is trimmed when the POM is parsed.
133+
See http://jira.codehaus.org/browse/PLX-461 -->
134+
<echo message="${line.separator}" file="${project.build.directory}/classes/META-INF/components.txt" append="true" />
135+
<concat destfile="${project.build.directory}/classes/META-INF/components.txt" append="true">
136+
<filelist dir="${basedir}/src/main/resources/META-INF/" files="components.txt" />
137+
</concat>
138+
</target>
139+
</configuration>
140+
<goals>
141+
<goal>run</goal>
142+
</goals>
143+
</execution>
144+
</executions>
145+
</plugin>
146+
<!-- Make sure we run the tests only with the aspectified JARs since otherwise components will be registered
147+
twice for example. -->
148+
<plugin>
149+
<groupId>org.apache.maven.plugins</groupId>
150+
<artifactId>maven-surefire-plugin</artifactId>
151+
<configuration>
152+
<classpathDependencyExcludes>
153+
<classpathDependencyExcludes>org.xwiki.commons:xwiki-commons-job-api</classpathDependencyExcludes>
154+
<classpathDependencyExcludes>org.xwiki.commons:xwiki-commons-job-default</classpathDependencyExcludes>
155+
</classpathDependencyExcludes>
156+
</configuration>
157+
</plugin>
158+
<plugin>
159+
<groupId>fr.inria.gforge.spoon</groupId>
160+
<artifactId>spoon-maven-plugin</artifactId>
161+
<executions>
162+
<execution>
163+
<id>spoon-main</id>
164+
<configuration>
165+
<processorProperties combine.children="append">
166+
<processorProperty>
167+
<name>org.xwiki.tool.spoon.ComponentAnnotationProcessor</name>
168+
<properties>
169+
<property>
170+
<!-- Skip foreign declaration checks since we merge the components.txt -->
171+
<name>skipForeignDeclarations</name>
172+
<value>true</value>
173+
</property>
174+
<!-- TODO: Ideally inherit this from the top level pom but I couldn't find how to do it, or remove
175+
it when spoon is fixed, see https://github.com/INRIA/spoon/issues/3339 -->
176+
<property>
177+
<name>componentsTxtPath</name>
178+
<value>target/classes/META-INF/components.txt</value>
179+
</property>
180+
</properties>
181+
</processorProperty>
182+
</processorProperties>
183+
</configuration>
184+
</execution>
185+
<execution>
186+
<id>spoon-test</id>
187+
<configuration>
188+
<!-- TODO: Remove once https://github.com/INRIA/spoon/issues/3583 is fixed -->
189+
<skip>true</skip>
190+
</configuration>
191+
</execution>
192+
</executions>
193+
</plugin>
194+
<!-- Since we have runtime dependencies defined above this could lead to some problems for revapi by causing
195+
classpath ordering problems. So we need to avoid this. -->
196+
<plugin>
197+
<groupId>org.revapi</groupId>
198+
<artifactId>revapi-maven-plugin</artifactId>
199+
<configuration>
200+
<resolveProvidedDependencies>false</resolveProvidedDependencies>
201+
</configuration>
202+
</plugin>
203+
</plugins>
204+
</build>
205+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.xwiki.job.internal.DefaultJobManager

0 commit comments

Comments
 (0)