Skip to content

Commit 5ab01b7

Browse files
Feature/jakarta artifiakter (#166)
* fix: initial version jakarta artefakter * deploy jakarta artefakter
1 parent b1e63f1 commit 5ab01b7

7 files changed

+692
-0
lines changed

pom.xml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,183 @@
257257
</execution>
258258
</executions>
259259
</plugin>
260+
261+
<plugin>
262+
<groupId>org.apache.maven.plugins</groupId>
263+
<artifactId>maven-antrun-plugin</artifactId>
264+
<version>3.0.0</version>
265+
<executions>
266+
<execution>
267+
<id>transform-jar</id>
268+
<phase>package</phase>
269+
<goals>
270+
<goal>run</goal>
271+
</goals>
272+
<configuration>
273+
<target>
274+
<property name="plugin_classpath" refid="maven.plugin.classpath"/>
275+
<java classname="org.eclipse.transformer.jakarta.JakartaTransformer">
276+
<arg value="${project.build.directory}/${project.build.finalName}.jar"/>
277+
<arg value="${project.build.directory}/${project.artifactId}-jakarta-${project.version}.jar"/>
278+
<arg value="-q"/>
279+
<arg value="-o"/>
280+
<arg value="-tr"/>
281+
<arg value="${maven.multiModuleProjectDirectory}/rules/jakarta-renames.properties"/>
282+
<arg value="-tv"/>
283+
<arg value="${maven.multiModuleProjectDirectory}/rules/jakarta-versions.properties"/>
284+
<arg value="-td"/>
285+
<arg value="${maven.multiModuleProjectDirectory}/rules/jakarta-direct.properties"/>
286+
<arg value="-tf"/>
287+
<arg value="${maven.multiModuleProjectDirectory}/rules/pom.properties"/>
288+
<classpath>
289+
<pathelement path="${plugin_classpath}"/>
290+
</classpath>
291+
</java>
292+
</target>
293+
</configuration>
294+
</execution>
295+
<execution>
296+
<id>transform-sources-jar</id>
297+
<phase>package</phase>
298+
<goals>
299+
<goal>run</goal>
300+
</goals>
301+
<configuration>
302+
<target>
303+
<property name="plugin_classpath" refid="maven.plugin.classpath"/>
304+
<java classname="org.eclipse.transformer.jakarta.JakartaTransformer">
305+
<arg value="${project.build.directory}/${project.build.finalName}-sources.jar"/>
306+
<arg value="${project.build.directory}/${project.artifactId}-jakarta-${project.version}-sources.jar"/>
307+
<arg value="-q"/>
308+
<arg value="-o"/>
309+
<arg value="-tr"/>
310+
<arg value="${maven.multiModuleProjectDirectory}/rules/jakarta-renames.properties"/>
311+
<arg value="-tv"/>
312+
<arg value="${maven.multiModuleProjectDirectory}/rules/jakarta-versions.properties"/>
313+
<arg value="-td"/>
314+
<arg value="${maven.multiModuleProjectDirectory}/rules/jakarta-direct.properties"/>
315+
<arg value="-tf"/>
316+
<arg value="${maven.multiModuleProjectDirectory}/rules/pom.properties"/>
317+
<classpath>
318+
<pathelement path="${plugin_classpath}"/>
319+
</classpath>
320+
</java>
321+
</target>
322+
</configuration>
323+
</execution>
324+
</executions>
325+
<dependencies>
326+
<dependency>
327+
<groupId>org.eclipse.transformer</groupId>
328+
<artifactId>org.eclipse.transformer.cli</artifactId>
329+
<version>0.2.0</version>
330+
</dependency>
331+
<dependency>
332+
<groupId>ant-contrib</groupId>
333+
<artifactId>ant-contrib</artifactId>
334+
<version>1.0b3</version>
335+
<exclusions>
336+
<exclusion>
337+
<groupId>ant</groupId>
338+
<artifactId>ant</artifactId>
339+
</exclusion>
340+
</exclusions>
341+
</dependency>
342+
</dependencies>
343+
</plugin>
260344
</plugins>
261345
</build>
346+
347+
<profiles>
348+
<profile>
349+
<id>jar-module</id>
350+
<activation>
351+
<file>
352+
<exists>src/main/java/</exists>
353+
</file>
354+
</activation>
355+
<build>
356+
<plugins>
357+
<plugin>
358+
<groupId>org.apache.maven.plugins</groupId>
359+
<artifactId>maven-install-plugin</artifactId>
360+
<executions>
361+
<execution>
362+
<phase>install</phase>
363+
<goals>
364+
<goal>install-file</goal>
365+
</goals>
366+
<configuration>
367+
<packaging>jar</packaging>
368+
<artifactId>${project.artifactId}-jakarta</artifactId>
369+
<groupId>${project.groupId}</groupId>
370+
<version>${project.version}</version>
371+
<file>
372+
${project.build.directory}/${project.artifactId}-jakarta-${project.version}.jar
373+
</file>
374+
</configuration>
375+
</execution>
376+
<execution>
377+
<phase>install</phase>
378+
<id>install-jakarta-sources</id>
379+
<goals>
380+
<goal>install-file</goal>
381+
</goals>
382+
<configuration>
383+
<packaging>jar</packaging>
384+
<artifactId>${project.artifactId}-jakarta</artifactId>
385+
<groupId>${project.groupId}</groupId>
386+
<version>${project.version}</version>
387+
<classifier>sources</classifier>
388+
<file>
389+
${project.build.directory}/${project.artifactId}-jakarta-${project.version}-sources.jar
390+
</file>
391+
</configuration>
392+
</execution>
393+
</executions>
394+
</plugin>
395+
<plugin>
396+
<groupId>org.apache.maven.plugins</groupId>
397+
<artifactId>maven-deploy-plugin</artifactId>
398+
<executions>
399+
<execution>
400+
<phase>deploy</phase>
401+
<goals>
402+
<goal>deploy-file</goal>
403+
</goals>
404+
<configuration>
405+
<packaging>jar</packaging>
406+
<generatePom>true</generatePom>
407+
<url>${project.distributionManagement.repository.url}</url>
408+
<artifactId>${project.artifactId}-jakarta</artifactId>
409+
<groupId>${project.groupId}</groupId>
410+
<version>${project.version}</version>
411+
<file>${project.build.directory}/${project.artifactId}-jakarta-${project.version}.jar</file>
412+
</configuration>
413+
</execution>
414+
<execution>
415+
<phase>deploy</phase>
416+
<id>deploy-jakarta-sources</id>
417+
<goals>
418+
<goal>deploy-file</goal>
419+
</goals>
420+
<configuration>
421+
<packaging>jar</packaging>
422+
<generatePom>true</generatePom>
423+
<url>${project.distributionManagement.repository.url}</url>
424+
<artifactId>${project.artifactId}-jakarta</artifactId>
425+
<classifier>sources</classifier>
426+
<groupId>${project.groupId}</groupId>
427+
<version>${project.version}</version>
428+
<file>${project.build.directory}/${project.artifactId}-jakarta-${project.version}-sources.jar</file>
429+
</configuration>
430+
</execution>
431+
</executions>
432+
</plugin>
433+
</plugins>
434+
</build>
435+
</profile>
436+
</profiles>
262437

263438
<distributionManagement>
264439
<repository>

rules/jakarta-direct.properties

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Taken from https://github.com/OpenLiberty/open-liberty/tree/30ca58383f9018227afd4b511bdedf33363b747e/dev/wlp-jakartaee-transform/rules
2+
3+
# Direct String Replacement
4+
5+
http\://java.sun.com/xml/ns/jaxb=https://jakarta.ee/xml/ns/jaxb
6+
7+
# xmlBinding-3.0 properties
8+
javax.xml.bind.JAXBElement=jakarta.xml.bind.JAXBElement
9+
10+
com.sun.xml.bind.v2.ContextFactory=org.glassfish.jaxb.runtime.v2.JAXBContextFactory
11+
12+
javax.annotation.security.RolesAllowed=jakarta.annotation.security.RolesAllowed

0 commit comments

Comments
 (0)