[Git][java-team/jetty-modify-sources-maven-plugin][upstream] New upstream version 1.0.14
Emmanuel Bourg (@ebourg)
gitlab at salsa.debian.org
Wed Nov 18 08:10:14 GMT 2026
Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / jetty-modify-sources-maven-plugin
Commits:
4b8dc70f by Emmanuel Bourg at 2026-11-18T09:00:59+01:00
New upstream version 1.0.14
- - - - -
16 changed files:
- .github/workflows/maven.yml
- Jenkinsfile
- pom.xml
- src/it/filtering-it/pom.xml
- + src/it/mod-files-it/invoker.properties
- + src/it/mod-files-it/pom.xml
- + src/it/mod-files-it/src/main/config/test.mod
- + src/it/mod-files-it/verify.groovy
- src/main/java/org/eclipse/jetty/toolchain/modifysources/ModFilesFiltering.java
- src/main/java/org/eclipse/jetty/toolchain/modifysources/ModifyEE9ToEE8.java
- src/main/java/org/eclipse/jetty/toolchain/modifysources/ModifyEE9ToEE8ServiceLoaderFiles.java
- src/main/java/org/eclipse/jetty/toolchain/modifysources/ResourcesFiltering.java
- src/test/java/org/eclipse/jetty/toolchain/modifysources/ModifyEE9ToEE8ServiceLoaderFileTest.java
- src/test/java/org/eclipse/jetty/toolchain/modifysources/ModifyEE9ToEE8Test.java
- src/test/resources/project-modify/src/main/java/module-info.java
- src/test/resources/project-modify/src/main/java/org/eclipse/jetty/ee9/jakarta/nested/JakartaScanner.java
Changes:
=====================================
.github/workflows/maven.yml
=====================================
@@ -27,3 +27,5 @@ jobs:
build:
name: Maven Build CI
uses: jetty-project/.github/.github/workflows/maven-ci.yml at master
+ with:
+ jdk-matrix: '[ "17", "21", "25 ]'
=====================================
Jenkinsfile
=====================================
@@ -11,31 +11,31 @@ pipeline {
stages {
stage( "Parallel Stage" ) {
parallel {
- stage( "Build / Test - JDK11" ) {
+ stage( "Build / Test - JDK17" ) {
agent { node { label 'linux-light' } }
options { timeout( time: 120, unit: 'MINUTES' ) }
steps {
- mavenBuild( "jdk11", "clean install javadoc:jar" )
+ mavenBuild( "jdk17", "clean install javadoc:jar" )
warnings consoleParsers: [[parserName: 'Maven'], [parserName: 'Java']]
script {
if (env.BRANCH_NAME == 'main') {
- mavenBuild( "jdk11", "deploy" )
+ mavenBuild( "jdk17", "deploy" )
}
}
}
}
- stage( "Build / Test - JDK17" ) {
+ stage( "Build / Test - JDK21" ) {
agent { node { label 'linux-light' } }
options { timeout( time: 120, unit: 'MINUTES' ) }
steps {
- mavenBuild( "jdk17", "clean install javadoc:jar" )
+ mavenBuild( "jdk21", "clean install javadoc:jar" )
}
}
- stage( "Build / Test - JDK21" ) {
+ stage( "Build / Test - JDK25" ) {
agent { node { label 'linux-light' } }
options { timeout( time: 120, unit: 'MINUTES' ) }
steps {
- mavenBuild( "jdk21", "clean install javadoc:jar" )
+ mavenBuild( "jdk25", "clean install javadoc:jar" )
}
}
}
@@ -55,7 +55,7 @@ pipeline {
def mavenBuild(jdk, cmdline) {
def mvnName = 'maven3'
def localRepo = "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}" // ".repository" //
- def settingsName = 'oss-settings.xml'
+ def settingsName = 'oss-deploy'
def mavenOpts = '-Xms2g -Xmx2g -Djava.awt.headless=true'
withMaven(
@@ -67,7 +67,7 @@ def mavenBuild(jdk, cmdline) {
mavenOpts: mavenOpts,
mavenLocalRepo: localRepo) {
// Some common Maven command line + provided command line
- sh "mvn -V -B -DfailIfNoTests=false -Djetty.testtracker.log=true -e $cmdline"
+ sh "mvn -V -B -e $cmdline"
}
}
=====================================
pom.xml
=====================================
@@ -1,22 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
-
-
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-parent</artifactId>
+ <version>31</version>
+ </parent>
+
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-modify-sources-maven-plugin</artifactId>
- <version>1.0.13</version>
+ <version>1.0.14</version>
<packaging>maven-plugin</packaging>
<name>jetty-modify-sources-maven-plugin Maven Plugin</name>
- <url>https://github.com/jetty-project/${project.artifactId}</url>
-
<description>Maven Plugin used for Jetty 12 to transform sources and resources using jakarta namespace to EE8 javax namespace</description>
- <prerequisites>
- <maven>3.8.2</maven>
- </prerequisites>
+
+ <url>https://github.com/jetty-project/${project.artifactId}</url>
<organization>
<name>Mort Bay Consulting</name>
@@ -33,25 +34,6 @@
</license>
</licenses>
- <scm>
- <connection>scm:git:https://github.com/jetty-project/${project.artifactId}.git</connection>
- <developerConnection>scm:git:git at github.com:jetty-project/${project.artifactId}.git</developerConnection>
- <url>https://github.com/jetty-project/${project.artifactId}</url>
- <tag>jetty-modify-sources-maven-plugin-1.0.13</tag>
- </scm>
- <issueManagement>
- <system>github</system>
- <url>https://github.com/jetty-project/${project.artifactId}/issues</url>
- </issueManagement>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <maven.compiler.source>11</maven.compiler.source>
- <maven.compiler.target>11</maven.compiler.target>
- <maven.version>3.9.5</maven.version>
- <javaparser.version>3.26.4</javaparser.version>
- </properties>
-
<developers>
<developer>
<id>olamy</id>
@@ -62,29 +44,86 @@
<timezone>Australia/Brisbane</timezone>
</developer>
</developers>
+ <prerequisites>
+ <maven>3.9.12</maven>
+ </prerequisites>
+
+ <scm>
+ <connection>scm:git:https://github.com/jetty-project/${project.artifactId}.git</connection>
+ <developerConnection>scm:git:https://github.com/jetty-project/${project.artifactId}.git</developerConnection>
+ <tag>jetty-modify-sources-maven-plugin-1.0.14</tag>
+ <url>https://github.com/jetty-project/${project.artifactId}</url>
+ </scm>
+
+ <issueManagement>
+ <system>github</system>
+ <url>https://github.com/jetty-project/${project.artifactId}/issues</url>
+ </issueManagement>
<distributionManagement>
<repository>
- <id>oss.sonatype.org</id>
- <name>Jetty Staging Repository</name>
- <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+ <id>sonatype-cp</id>
+ <name>Central Portal</name>
+ <url>https://repo.maven.apache.org/maven2</url>
</repository>
<snapshotRepository>
- <id>oss.sonatype.org</id>
- <name>Jetty Snapshot Repository</name>
- <url>https://oss.sonatype.org/content/repositories/jetty-snapshots/</url>
+ <id>sonatype-cp</id>
+ <name>Central Portal</name>
+ <url>https://central.sonatype.com/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
+ <properties>
+ <javaparser.version>3.26.4</javaparser.version>
+ <jdk.version.minimum>17</jdk.version.minimum>
+ <maven.version>3.9.14</maven.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
<dependencies>
<dependency>
<groupId>com.github.javaparser</groupId>
<artifactId>javaparser-core</artifactId>
<version>${javaparser.version}</version>
</dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.20.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.20.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-text</artifactId>
+ <version>1.15.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-filtering</artifactId>
+ <version>3.5.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>4.0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-xml</artifactId>
+ <version>3.0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest</artifactId>
+ <version>3.0</version>
+ </dependency>
<dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
+ <artifactId>maven-artifact</artifactId>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
@@ -96,16 +135,10 @@
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
+ <artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-compat</artifactId>
- <version>${maven.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
@@ -113,35 +146,21 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-filtering</artifactId>
- <version>3.4.0</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.15.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>3.17.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-text</artifactId>
- <version>1.13.1</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.13.2</version>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ <version>${maven.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
- <version>3.3.0</version>
+ <version>3.5.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ <version>5.14.1</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -150,11 +169,6 @@
<version>1.7.36</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest</artifactId>
- <version>3.0</version>
- </dependency>
</dependencies>
<build>
@@ -167,28 +181,28 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>3.3.1</version>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.15.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.12.1</version>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>3.1.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
- <version>3.2.4</version>
+ <version>3.2.8</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>3.11.0</version>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>3.1.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>3.5.3</version>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <version>3.9.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -202,18 +216,26 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-install-plugin</artifactId>
- <version>3.1.4</version>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>3.15.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>3.1.4</version>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>3.1.1</version>
+ <configuration>
+ <useReleaseProfile>false</useReleaseProfile>
+ <goals>deploy</goals>
+ <arguments>-Peclipse-release -DskipTests</arguments>
+ <preparationGoals>clean install</preparationGoals>
+ <mavenExecutorId>forked-path</mavenExecutorId>
+ <localCheckout>true</localCheckout>
+ </configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-invoker-plugin</artifactId>
- <version>3.6.0</version>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -222,43 +244,12 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>3.1.1</version>
- <configuration>
- <useReleaseProfile>false</useReleaseProfile>
- <goals>deploy</goals>
- <arguments>-Peclipse-release -DskipTests</arguments>
- <preparationGoals>clean install</preparationGoals>
- <mavenExecutorId>forked-path</mavenExecutorId>
- <localCheckout>true</localCheckout>
- </configuration>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>3.5.5</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>3.11.0</version>
- <configuration>
- <!-- <goalPrefix>maven-archetype-plugin</goalPrefix> -->
- <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
- </configuration>
- <executions>
- <execution>
- <id>mojo-descriptor</id>
- <goals>
- <goal>descriptor</goal>
- </goals>
- </execution>
- <execution>
- <id>help-goal</id>
- <goals>
- <goal>helpmojo</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
@@ -288,57 +279,43 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>3.15.2</version>
+ <configuration>
+ <!-- <goalPrefix>maven-archetype-plugin</goalPrefix> -->
+ <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+ </configuration>
+ <executions>
+ <execution>
+ <id>help-goal</id>
+ <goals>
+ <goal>helpmojo</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>mojo-descriptor</id>
+ <goals>
+ <goal>descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.sisu</groupId>
+ <artifactId>sisu-maven-plugin</artifactId>
+ <version>1.0.0</version>
+ <executions>
+ <execution>
+ <id>index-project</id>
+ <goals>
+ <goal>main-index</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
- <profiles>
- <profile>
- <id>eclipse-release</id>
- <build>
- <plugins>
- <plugin>
- <inherited>true</inherited>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-gpg-plugin</artifactId>
- <executions>
- <execution>
- <id>sign-artifacts</id>
- <phase>verify</phase>
- <goals>
- <goal>sign</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+
</project>
=====================================
src/it/filtering-it/pom.xml
=====================================
@@ -22,7 +22,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>3.2.0</version>
+ <version>3.5.0</version>
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>p12</nonFilteredFileExtension>
@@ -47,7 +47,7 @@
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
- <version>3.3.0</version>
+ <version>3.5.0</version>
</dependency>
<dependency>
<groupId>@project.groupId@</groupId>
=====================================
src/it/mod-files-it/invoker.properties
=====================================
@@ -0,0 +1 @@
+invoker.goals = generate-test-resources
\ No newline at end of file
=====================================
src/it/mod-files-it/pom.xml
=====================================
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.eclipse.jetty.toolchain.it</groupId>
+ <artifactId>mod-files-it</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <description>A simple IT verifying the mod-files filtering use case.</description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <test.property>hello-world</test.property>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.20.0</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.20.0</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>3.5.0</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-filtering</artifactId>
+ <version>3.5.0</version>
+ </dependency>
+ <dependency>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>@project.artifactId@</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>copy-mod-files</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <mavenFilteringHints>
+ <mavenFilteringHint>mod-files</mavenFilteringHint>
+ </mavenFilteringHints>
+ <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/config</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
=====================================
src/it/mod-files-it/src/main/config/test.mod
=====================================
@@ -0,0 +1,3 @@
+# Test mod file
+lib=@commons-io:commons-io@
+prop=@test.property@
=====================================
src/it/mod-files-it/verify.groovy
=====================================
@@ -0,0 +1,6 @@
+File result = new File(basedir, "target/test-classes/test.mod")
+assert result.isFile()
+assert result.text.contains('commons-io-2.20.0.jar')
+assert result.text.contains('hello-world')
+assert !result.text.contains('@commons-io:commons-io@')
+assert !result.text.contains('@test.property@')
=====================================
src/main/java/org/eclipse/jetty/toolchain/modifysources/ModFilesFiltering.java
=====================================
@@ -1,10 +1,23 @@
+//
+// ========================================================================
+// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under the
+// terms of the Eclipse Public License v. 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
+// which is available at https://www.apache.org/licenses/LICENSE-2.0.
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+
package org.eclipse.jetty.toolchain.modifysources;
-import com.google.inject.Singleton;
import org.apache.commons.text.StringSubstitutor;
import org.apache.commons.text.lookup.StringLookup;
import org.apache.maven.model.Dependency;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.shared.filtering.ChangeDetection;
import org.apache.maven.shared.filtering.DefaultMavenFileFilter;
import org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering;
import org.apache.maven.shared.filtering.FilterWrapper;
@@ -18,6 +31,7 @@ import org.sonatype.plexus.build.incremental.BuildContext;
import javax.inject.Inject;
import javax.inject.Named;
+import javax.inject.Singleton;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
@@ -62,7 +76,7 @@ public class ModFilesFiltering extends DefaultMavenResourcesFiltering implements
@Override
public void copyFile(File from, final File to, boolean filtering, List<FilterWrapper> filterWrappers,
- String encoding, boolean overwrite )
+ String encoding, ChangeDetection changeDetection)
throws MavenFilteringException {
MavenProject mavenProject = CURRENT_PROJECT.get();
=====================================
src/main/java/org/eclipse/jetty/toolchain/modifysources/ModifyEE9ToEE8.java
=====================================
@@ -1,3 +1,16 @@
+//
+// ========================================================================
+// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under the
+// terms of the Eclipse Public License v. 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
+// which is available at https://www.apache.org/licenses/LICENSE-2.0.
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+
package org.eclipse.jetty.toolchain.modifysources;
@@ -708,4 +721,20 @@ public class ModifyEE9ToEE8
protected void setMoveDirectoryStructure(boolean moveDirectoryStructure) {
this.moveDirectoryStructure = moveDirectoryStructure;
}
+
+ public File getSourceProjectLocation() {
+ return sourceProjectLocation;
+ }
+
+ public File getOutputDirectory() {
+ return outputDirectory;
+ }
+
+ public boolean isSkip() {
+ return skip;
+ }
+
+ public boolean isMoveDirectoryStructure() {
+ return moveDirectoryStructure;
+ }
}
=====================================
src/main/java/org/eclipse/jetty/toolchain/modifysources/ModifyEE9ToEE8ServiceLoaderFiles.java
=====================================
@@ -1,3 +1,16 @@
+//
+// ========================================================================
+// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under the
+// terms of the Eclipse Public License v. 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
+// which is available at https://www.apache.org/licenses/LICENSE-2.0.
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+
package org.eclipse.jetty.toolchain.modifysources;
import org.apache.commons.lang3.StringUtils;
@@ -93,4 +106,8 @@ public class ModifyEE9ToEE8ServiceLoaderFiles
public void setOutputDirectory(File outputDirectory) {
this.outputDirectory = outputDirectory;
}
+
+ public File getOutputDirectory() {
+ return outputDirectory;
+ }
}
=====================================
src/main/java/org/eclipse/jetty/toolchain/modifysources/ResourcesFiltering.java
=====================================
@@ -1,11 +1,27 @@
+//
+// ========================================================================
+// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under the
+// terms of the Eclipse Public License v. 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
+// which is available at https://www.apache.org/licenses/LICENSE-2.0.
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+
package org.eclipse.jetty.toolchain.modifysources;
import org.apache.commons.lang3.StringUtils;
+import org.apache.maven.shared.filtering.ChangeDetection;
import org.apache.maven.shared.filtering.DefaultMavenFileFilter;
import org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering;
import org.apache.maven.shared.filtering.FilterWrapper;
import org.apache.maven.shared.filtering.MavenFileFilter;
+import org.apache.maven.shared.filtering.MavenFileFilterRequest;
import org.apache.maven.shared.filtering.MavenFilteringException;
+import org.apache.maven.shared.filtering.MavenResourcesExecution;
import org.apache.maven.shared.filtering.MavenResourcesFiltering;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -32,11 +48,14 @@ public class ResourcesFiltering extends DefaultMavenResourcesFiltering implement
return Collections.emptyList();
}
+ private JettyMavenFileFilter jettyMavenFileFilter;
+
@Inject
public ResourcesFiltering(MavenFileFilter mavenFileFilter, BuildContext buildContext) {
super(new JettyMavenFileFilter(buildContext), buildContext);
+ this.jettyMavenFileFilter = new JettyMavenFileFilter(buildContext);
}
-
+
public static class JettyMavenFileFilter extends DefaultMavenFileFilter implements MavenFileFilter {
private BuildContext buildContext;
@@ -49,7 +68,7 @@ public class ResourcesFiltering extends DefaultMavenResourcesFiltering implement
@Override
public void copyFile(File from, final File to, boolean filtering, List<FilterWrapper> filterWrappers,
- String encoding, boolean overwrite )
+ String encoding, ChangeDetection changeDetection)
throws MavenFilteringException {
try {
// not looking at non filtered files
=====================================
src/test/java/org/eclipse/jetty/toolchain/modifysources/ModifyEE9ToEE8ServiceLoaderFileTest.java
=====================================
@@ -1,9 +1,21 @@
-package org.eclipse.jetty.toolchain.modifysources;
+//
+// ========================================================================
+// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under the
+// terms of the Eclipse Public License v. 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
+// which is available at https://www.apache.org/licenses/LICENSE-2.0.
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+package org.eclipse.jetty.toolchain.modifysources;
-import org.apache.maven.plugin.testing.MojoRule;
-import org.junit.Rule;
-import org.junit.Test;
+import org.apache.maven.api.plugin.testing.InjectMojo;
+import org.apache.maven.api.plugin.testing.MojoTest;
+import org.junit.jupiter.api.Test;
import java.io.File;
import java.nio.file.Files;
@@ -18,42 +30,26 @@ import static org.hamcrest.io.FileMatchers.anExistingFile;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
+ at MojoTest(realRepositorySession = true)
+//@Basedir("/unit")
public class ModifyEE9ToEE8ServiceLoaderFileTest
{
- @Rule
- public MojoRule rule = new MojoRule()
- {
- @Override
- protected void before()
- throws Throwable
- {
-// FileUtils.copyDirectory(new File("src/test/resources/project-modify/"),
-// new File());
- }
-
- @Override
- protected void after()
- {
- }
- };
-
@Test
- public void testChangeToEE8()
+ @InjectMojo(goal = "modify-service-loader-files-ee9-to-ee8")
+ public void testChangeToEE8(ModifyEE9ToEE8ServiceLoaderFiles mojo)
throws Exception
{
File pom = new File( "target/test-classes/project-modify/" );
assertThat(pom, notNullValue());
- ModifyEE9ToEE8ServiceLoaderFiles mojo =
- (ModifyEE9ToEE8ServiceLoaderFiles) rule.lookupConfiguredMojo( pom, "modify-service-loader-files-ee9-to-ee8" );
assertThat(mojo, notNullValue());
mojo.setOutputDirectory(new File("target/test-classes/project-modify/src/main/resources"));
mojo.execute();
- File outputDirectory = (File) rule.getVariableValueFromObject( mojo, "outputDirectory" );
+ File outputDirectory = mojo.getOutputDirectory();
assertThat(outputDirectory, notNullValue());
assertThat(outputDirectory, anExistingDirectory());
=====================================
src/test/java/org/eclipse/jetty/toolchain/modifysources/ModifyEE9ToEE8Test.java
=====================================
@@ -1,9 +1,21 @@
-package org.eclipse.jetty.toolchain.modifysources;
+//
+// ========================================================================
+// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under the
+// terms of the Eclipse Public License v. 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
+// which is available at https://www.apache.org/licenses/LICENSE-2.0.
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+package org.eclipse.jetty.toolchain.modifysources;
-import org.apache.maven.plugin.testing.MojoRule;
-import org.junit.Rule;
-import org.junit.Test;
+import org.apache.maven.api.plugin.testing.InjectMojo;
+import org.apache.maven.api.plugin.testing.MojoTest;
+import org.junit.jupiter.api.Test;
import java.io.File;
import java.nio.file.Files;
@@ -18,42 +30,28 @@ import static org.hamcrest.io.FileMatchers.anExistingFile;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
+ at MojoTest(realRepositorySession = true)
+//@Basedir("/unit")
public class ModifyEE9ToEE8Test
{
- @Rule
- public MojoRule rule = new MojoRule()
- {
- @Override
- protected void before()
- throws Throwable
- {
-// FileUtils.copyDirectory(new File("src/test/resources/project-modify/"),
-// new File());
- }
-
- @Override
- protected void after()
- {
- }
- };
@Test
- public void testChangeToEE8()
+ @InjectMojo(goal = "modify-sources-ee9-to-ee8") //, pom = "basic-surefire-report-test/plugin-config.xml")
+ public void testChangeToEE8(ModifyEE9ToEE8 mojo)
throws Exception
{
File pom = new File( "target/test-classes/project-modify/" );
assertThat(pom, notNullValue());
- ModifyEE9ToEE8 mojo =
- (ModifyEE9ToEE8) rule.lookupConfiguredMojo( pom, "modify-sources-ee9-to-ee8" );
+ //ModifyEE9ToEE8 mojo = rule.lookupConfiguredMojo( pom, "modify-sources-ee9-to-ee8" );
assertThat(mojo, notNullValue());
mojo.setSourceProjectLocation(new File("target/test-classes/project-modify/src/main/java"));
mojo.setMoveDirectoryStructure(true);
mojo.execute();
- File outputDirectory = (File) rule.getVariableValueFromObject( mojo, "outputDirectory" );
+ File outputDirectory = mojo.getOutputDirectory();
assertThat(outputDirectory, notNullValue());
assertThat(outputDirectory, anExistingDirectory());
@@ -135,21 +133,21 @@ public class ModifyEE9ToEE8Test
}
@Test
- public void testChangeToEE8WithNoChangeComment()
+ @InjectMojo(goal = "modify-sources-ee9-to-ee8")
+ public void testChangeToEE8WithNoChangeComment(ModifyEE9ToEE8 mojo)
throws Exception
{
File pom = new File( "target/test-classes/project-modify/" );
assertThat(pom, notNullValue());
- ModifyEE9ToEE8 mojo =
- (ModifyEE9ToEE8) rule.lookupConfiguredMojo( pom, "modify-sources-ee9-to-ee8" );
+// ModifyEE9ToEE8 mojo = rule.lookupConfiguredMojo( pom, "modify-sources-ee9-to-ee8" );
assertThat(mojo, notNullValue());
mojo.setSourceProjectLocation(new File("target/test-classes/project-modify/src/main/java"));
mojo.setMoveDirectoryStructure(true);
mojo.execute();
- File outputDirectory = (File) rule.getVariableValueFromObject( mojo, "outputDirectory" );
+ File outputDirectory = mojo.getOutputDirectory();
{
Path modified = Paths.get(outputDirectory.toString(), "org", "eclipse", "jetty", "ee8", "CrossContextDispatcher.java");
=====================================
src/test/resources/project-modify/src/main/java/module-info.java
=====================================
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others.
+// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
=====================================
src/test/resources/project-modify/src/main/java/org/eclipse/jetty/ee9/jakarta/nested/JakartaScanner.java
=====================================
@@ -1,21 +1,15 @@
//
-// ========================================================================
-// Copyright (c) 1995-2018 Mort Bay Consulting Pty. Ltd.
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
+// ========================================================================
+// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
+// This program and the accompanying materials are made available under the
+// terms of the Eclipse Public License v. 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
+// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
-// The Apache License v2.0 is available at
-// http://www.opensource.org/licenses/apache2.0.php
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-//
-
package org.eclipse.jetty.ee9.jakarta.nested;
View it on GitLab: https://salsa.debian.org/java-team/jetty-modify-sources-maven-plugin/-/commit/4b8dc70ff0b285f3309203e5c4f9e5420946dce0
--
View it on GitLab: https://salsa.debian.org/java-team/jetty-modify-sources-maven-plugin/-/commit/4b8dc70ff0b285f3309203e5c4f9e5420946dce0
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20261118/5419843c/attachment.htm>
More information about the pkg-java-commits
mailing list