Jetty 12.0.x use Maven build cache for PRs and branches except jetty-12.0.x main branch (#9871)

* apply configuration/changes for build cache

Signed-off-by: Olivier Lamy <olamy@apache.org>

Signed-off-by: Olivier Lamy <olamy@apache.org>
This commit is contained in:
Olivier Lamy 2023-08-22 10:46:46 +10:00 committed by GitHub
parent 2178dc2913
commit 97e1527ed6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
48 changed files with 562 additions and 117 deletions

View File

@ -74,14 +74,14 @@ jobs:
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.8.6
maven-version: 3.9.4
- name: Set up Maven
run:
mvn -e -B -V org.apache.maven.plugins:maven-wrapper-plugin:3.1.0:wrapper "-Dmaven=3.8.6"
mvn -e -B -V org.apache.maven.plugins:maven-wrapper-plugin:3.1.0:wrapper "-Dmaven=3.9.4"
- name: Clean install dependencies and build
run: mvn clean install -DskipTests -B -V
run: mvn clean install -DskipTests -B -Dmaven.build.cache.enabled=false
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

View File

@ -8,3 +8,5 @@
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED

View File

@ -0,0 +1,105 @@
<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0 https://maven.apache.org/xsd/build-cache-config-1.0.0.xsd">
<configuration>
<hashAlgorithm>XXMM</hashAlgorithm>
<enabled>true</enabled>
<!-- activated via cli -->
<!-- to disable it just use -Dmaven.build.cache.enabled=false -->
<!--
-Dmaven.build.cache.remote.url=dav:http://nginx-cache-service.jenkins.svc.cluster.local:80 -Dmaven.build.cache.remote.enabled=true
-Dmaven.build.cache.remote.save.enabled=true -Dmaven.build.cache.remote.server.id=remote-build-cache-server
-->
<!-- <remote enabled="true" saveToRemote="true" id="remote-build-cache-server">-->
<!-- <url>dav:http://nginx-cache-service.jenkins.svc.cluster.local:80</url>-->
<!-- </remote>-->
<multiModule>
<discovery>
<scanProfiles>
<scanProfile>ci</scanProfile>
</scanProfiles>
</discovery>
</multiModule>
</configuration>
<input>
<global>
<glob>*.{java,xml,properties,mod,adoc}</glob>
</global>
<plugins>
<plugin groupId="org.apache.maven.plugins" artifactId="maven-invoker-plugin">
<effectivePom>
<excludeProperties>
<excludeProperty>scriptVariables</excludeProperty>
<excludeProperty>settingsFile</excludeProperty>
<excludeProperty>filterProperties</excludeProperty>
</excludeProperties>
</effectivePom>
</plugin>
<plugin groupId="org.apache.maven.plugins" artifactId="maven-surefire-plugin">
<effectivePom>
<excludeProperties>
<excludeProperty>systemPropertyVariables</excludeProperty>
</excludeProperties>
</effectivePom>
</plugin>
<plugin artifactId="asciidoctor-maven-plugin" groupId="org.asciidoctor">
<effectivePom>
<excludeProperties>
<excludeProperty>attributes</excludeProperty>
</excludeProperties>
</effectivePom>
</plugin>
</plugins>
</input>
<executionControl>
<runAlways>
<goalsLists>
<goalsList artifactId="maven-install-plugin">
<goals>
<goal>install</goal>
</goals>
</goalsList>
</goalsLists>
</runAlways>
<reconcile>
<plugins>
<!-- workaround for https://issues.apache.org/jira/browse/MBUILDCACHE-56 -->
<plugin artifactId="maven-enforcer-plugin" goal="enforce">
<nologs>
<nolog propertyName="commandLineRules"/>
</nologs>
</plugin>
<plugin artifactId="maven-invoker-plugin" goal="integration-test">
<nologs>
<nolog propertyName="scriptVariables"/>
<nolog propertyName="settingsFile"/>
<nolog propertyName="filterProperties"/>
</nologs>
</plugin>
<plugin artifactId="maven-surefire-plugin" goal="test">
<reconciles>
<reconcile propertyName="skip" skipValue="true"/>
<reconcile propertyName="skipExec" skipValue="true"/>
<reconcile propertyName="skipTests" skipValue="true"/>
<reconcile propertyName="testFailureIgnore" skipValue="true"/>
</reconciles>
<nologs>
<nolog propertyName="systemPropertyVariables"/>
</nologs>
</plugin>
<plugin artifactId="asciidoctor-maven-plugin" goal="process-asciidoc" groupId="org.asciidoctor">
<nologs>
<nolog propertyName="attributes"/>
</nologs>
</plugin>
</plugins>
</reconcile>
</executionControl>
<output>
<exclude>
<patterns>
<pattern>.*\.zip</pattern>
</patterns>
</exclude>
</output>
</cache>

1
.mvn/maven.config Normal file
View File

@ -0,0 +1 @@
-Daether.dependencyCollector.impl=bf

36
Jenkinsfile vendored
View File

@ -18,7 +18,7 @@ pipeline {
timeout( time: 180, unit: 'MINUTES' ) {
checkout scm
mavenBuild( "jdk21", "clean install -Dspotbugs.skip=true -Djacoco.skip=true", "maven3")
recordIssues id: "jdk21", name: "Static Analysis jdk19", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle()]
recordIssues id: "jdk21", name: "Static Analysis jdk21", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle()]
}
}
}
@ -28,7 +28,7 @@ pipeline {
steps {
timeout( time: 180, unit: 'MINUTES' ) {
checkout scm
mavenBuild( "jdk17", "clean install javadoc:javadoc -Perrorprone", "maven3")
mavenBuild( "jdk17", "clean install -Perrorprone", "maven3") // javadoc:javadoc
// Collect up the jacoco execution results (only on main build)
jacoco inclusionPattern: '**/org/eclipse/jetty/**/*.class',
exclusionPattern: '' +
@ -104,9 +104,21 @@ def mavenBuild(jdk, cmdline, mvnName) {
withEnv(["JAVA_HOME=${ tool "$jdk" }",
"PATH+MAVEN=${ tool "$jdk" }/bin:${tool "$mvnName"}/bin",
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
configFileProvider(
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
sh "mvn -Dmaven.repo.uri=http://10.0.0.15:8081/repository/maven-public/ -Dmaven.test.failure.ignore=true -ntp -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e $cmdline"
configFileProvider(
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS'),
configFile(fileId: 'maven-build-cache-config.xml', variable: 'MVN_BUILD_CACHE_CONFIG')]) {
//sh "cp $MVN_BUILD_CACHE_CONFIG .mvn/maven-build-cache-config.xml"
//-Dmaven.build.cache.configPath=$MVN_BUILD_CACHE_CONFIG
buildCache = useBuildCache()
if (buildCache) {
echo "Using build cache"
extraArgs = " -Dmaven.build.cache.restoreGeneratedSources=false -Dmaven.build.cache.remote.url=dav:http://nginx-cache-service.jenkins.svc.cluster.local:80 -Dmaven.build.cache.remote.enabled=true -Dmaven.build.cache.remote.save.enabled=true -Dmaven.build.cache.remote.server.id=remote-build-cache-server "
} else {
// when not using cache
echo "Not using build cache"
extraArgs = " -Dmaven.test.failure.ignore=true -Dmaven.build.cache.enabled=false "
}
sh "mvn $extraArgs -DsettingsPath=$GLOBAL_MVN_SETTINGS -Dmaven.repo.uri=http://nexus-service.nexus.svc.cluster.local:8081/repository/maven-public/ -ntp -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -U $cmdline"
}
}
}
@ -117,4 +129,18 @@ def mavenBuild(jdk, cmdline, mvnName) {
}
}
/**
* calculate to use cache or not. per default will not run
*/
def useBuildCache() {
def labelNoBuildCache = false
if (env.BRANCH_NAME ==~ /PR-\d+/) {
labelNoBuildCache = pullRequest.labels.contains("build-no-cache")
}
def noBuildCache = (env.BRANCH_NAME == 'jetty-12.0.x') || labelNoBuildCache;
return !noBuildCache;
// want to skip build cache
// return false
}
// vim: et:ts=2:sw=2:ft=groovy

View File

@ -70,4 +70,4 @@ The documentation is divided into three guides, based on use case:
# Commercial Support
Expert advice and production support of Jetty are provided by [Webtide](https://webtide.com).
Expert advice and production support of Jetty are provided by [Webtide](https://webtide.com).

View File

@ -14,28 +14,28 @@ mkdir -p $REPORT_OUTPUT_DIR
echo "HTML Reports can be found in $REPORT_OUTPUT_DIR"
mvn -N -B -Pdependency-updates-reports validate
mvn -N -B -Pdependency-updates-reports validate -Dmaven.build.cache.enabled=false
cp -Rv target/site/* $REPORT_OUTPUT_DIR
mv $REPORT_OUTPUT_DIR/dependency-updates-aggregate-report.html $REPORT_OUTPUT_DIR/dependency-updates-report-root.html
pushd jetty-core
mvn -B -Pdependency-updates-reports validate
mvn -B -Pdependency-updates-reports validate -Dmaven.build.cache.enabled=false
cp target/site/dependency-updates-aggregate-report.html $REPORT_OUTPUT_DIR/dependency-updates-report-core.html
popd
pushd jetty-ee10
mvn -B -Pdependency-updates-reports validate
mvn -B -Pdependency-updates-reports validate -Dmaven.build.cache.enabled=false
cp target/site/dependency-updates-aggregate-report.html $REPORT_OUTPUT_DIR/dependency-updates-report-ee10.html
popd
pushd jetty-ee9
mvn -B -Pdependency-updates-reports validate
mvn -B -Pdependency-updates-reports validate -Dmaven.build.cache.enabled=false
cp target/site/dependency-updates-aggregate-report.html $REPORT_OUTPUT_DIR/dependency-updates-report-ee9.html
popd
pushd jetty-ee8
mvn -B -Pdependency-updates-reports validate
mvn -B -Pdependency-updates-reports validate -Dmaven.build.cache.enabled=false
cp target/site/dependency-updates-aggregate-report.html $REPORT_OUTPUT_DIR/dependency-updates-report-ee8.html
popd

View File

@ -88,7 +88,7 @@ if [ ! -d "$ALT_DEPLOY_DIR" ] ; then
fi
# DEPLOY_OPTS="-Dmaven.test.failure.ignore=true"
DEPLOY_OPTS="-DskipTests -Dasciidoctor.skip=false"
DEPLOY_OPTS="-DskipTests -Dasciidoctor.skip=false -Dmaven.build.cache.enabled=false"
# DEPLOY_OPTS="$DEPLOY_OPTS -DaltDeploymentRepository=intarget::default::file://$ALT_DEPLOY_DIR/"
# Uncomment for Java 1.7
@ -131,10 +131,10 @@ reportMavenTestFailures() {
echo ""
if proceedyn "Are you sure you want to release using above? (y/N)" n; then
mvn clean install -pl build
mvn clean install -pl build -Dmaven.build.cache.enabled=false
echo ""
if proceedyn "Update VERSION.txt for $VER_RELEASE? (Y/n)" y; then
mvn -N -Pupdate-version generate-resources
mvn -N -Pupdate-version generate-resources -Dmaven.build.cache.enabled=false
cp VERSION.txt VERSION.txt.backup
cat VERSION.txt.backup | sed -e "s/$VER_CURRENT/$VER_RELEASE/" > VERSION.txt
rm VERSION.txt.backup
@ -146,6 +146,7 @@ if proceedyn "Are you sure you want to release using above? (y/N)" n; then
# This is equivalent to 'mvn release:prepare'
if proceedyn "Update project.versions for $VER_RELEASE? (Y/n)" y; then
mvn org.codehaus.mojo:versions-maven-plugin:2.7:set \
-Dmaven.build.cache.enabled=false \
-Peclipse-release \
-DoldVersion="$VER_CURRENT" \
-DnewVersion="$VER_RELEASE" \
@ -175,6 +176,7 @@ if proceedyn "Are you sure you want to release using above? (y/N)" n; then
cat VERSION.txt.backup >> VERSION.txt
echo "Update project.versions for $VER_NEXT"
mvn org.codehaus.mojo:versions-maven-plugin:2.7:set \
-Dmaven.build.cache.enabled=false \
-Peclipse-release \
-DoldVersion="$VER_RELEASE" \
-DnewVersion="$VER_NEXT" \

View File

@ -14,6 +14,7 @@
<properties>
<bundle-symbolic-name>${project.groupId}</bundle-symbolic-name>
<asciidoctor.skip>${skipTests}</asciidoctor.skip>
<jacoco.skip>true</jacoco.skip>
</properties>
<profiles>
@ -137,11 +138,13 @@
<attributes>
<project-basedir>${project.basedir}</project-basedir>
<project-version>${project.version}</project-version>
<maven-local-repo>${settings.localRepository}</maven-local-repo>
<maven-local-repo>${session.repositorySession.localRepository.basedir.absolutePath}</maven-local-repo>
<version>${project.version}</version>
<!-- <SRCDIR>./src/main/asciidoc</SRCDIR>-->
<prog-guide>../programming-guide/index.html</prog-guide>
<op-guide>../operations-guide/index.html</op-guide>
<javadoc-url>https://eclipse.dev/jetty/javadoc/jetty-12</javadoc-url>
<!-- <TIMESTAMP>2023-07-31T06:06:52Z</TIMESTAMP>-->
</attributes>
</configuration>
<executions>

View File

@ -24,11 +24,11 @@ Here are the minimum Maven and JDK version build requirements for each actively
.Build versioning requirements by branch
|===
| Branch | Maven Version | Minimum JDK
| Branch | Maven Version | Minimum JDK | Recommended JDK
| jetty-12.0.x | Maven 3.8.6+ | OpenJDK 17+
| jetty-11.0.x | Maven 3.8.6+ | OpenJDK 11+
| jetty-10.0.x | Maven 3.8.6+ | OpenJDK 11+
| jetty-12.0.x | Maven 3.9.2+ | OpenJDK 17+ | OpenJDK 19
| jetty-11.0.x | Maven 3.8.6+ | OpenJDK 11+ | OpenJDK 17
| jetty-10.0.x | Maven 3.8.6+ | OpenJDK 11+ | OpenJDK 17
|===
To build the Jetty documentation, OpenJDK 19+ is required due to the use of the virtual thread APIs.
@ -72,6 +72,18 @@ Not all test cases are as timing independent as they should be, which can result
You can help us track these flaky tests by opening an https://github.com/eclipse/jetty.project/issues[issue] when you come across one.
====
[[cg-build-cache]]
=== Maven Build Cache
Per default, the build is using the https://maven.apache.org/extensions/maven-build-cache-extension[Maven Build Cache extension]
this means you will use your local build cache, To disable it you can use the property
[source, shell]
----
$ mvn clean install -Dmaven.build.cache.enabled=false
----
[[cg-build-parallel]]
=== Executing tests in parallel

View File

@ -24,12 +24,6 @@
</instructions>
</configuration>
</plugin>
<!-- always include the sources to be able to prepare the eclipse-jetty-SDK feature
with a snapshot. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -13,12 +13,6 @@
</properties>
<build>
<plugins>
<!-- always include the sources to be able to prepare the eclipse-jetty-SDK feature
with a snapshot. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>

View File

@ -83,6 +83,31 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>process-test-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<type>jar</type>
<overWrite>false</overWrite>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/jetty-util</outputDirectory>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -163,7 +163,7 @@ public class PropertyPassingTest
cp.append(pathSep);
cp.append(MavenTestingUtils.getProjectDir("target/test-classes"));
cp.append(pathSep);
cp.append(MavenTestingUtils.getProjectDir("../jetty-util/target/classes")); // TODO horrible hack!
cp.append(MavenTestingUtils.getProjectDir("target/jetty-util"));
return cp.toString();
}

View File

@ -56,7 +56,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<mavenRepoPath>${settings.localRepository}</mavenRepoPath>
<mavenRepoPath>${session.repositorySession.localRepository.basedir.absolutePath}</mavenRepoPath>
</systemPropertyVariables>
<argLine>
@{argLine} ${jetty.surefire.argLine} --add-reads org.eclipse.jetty.util=org.eclipse.jetty.logging

View File

@ -1957,6 +1957,8 @@ public class XmlConfiguration
}
else if (arg.toLowerCase(Locale.ENGLISH).endsWith(".xml"))
{
if (LOG.isDebugEnabled())
LOG.debug("Parsing xml file {}", arg);
// Create an XmlConfiguration
XmlConfiguration configuration = new XmlConfiguration(ResourceFactory.of(mountContainer).newResource(arg));

View File

@ -117,18 +117,36 @@
<artifactId>jetty-websocket-jetty-client</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee9.demos</groupId>
<artifactId>jetty-ee9-demo-jndi-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee10.demos</groupId>
<artifactId>jetty-ee10-demo-jsp-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee10.demos</groupId>
<artifactId>jetty-ee10-demo-simple-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee10.demos</groupId>
<artifactId>jetty-ee10-demo-spec-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee10.demos</groupId>
<artifactId>jetty-ee10-demo-async-rest-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
@ -137,8 +155,12 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<environmentVariables>
<mavenRepoPath>${settings.localRepository}</mavenRepoPath>
<jettyVersion>${project.version}</jettyVersion>
</environmentVariables>
<systemPropertyVariables>
<mavenRepoPath>${session.repositorySession.localRepository.basedir.absolutePath}</mavenRepoPath>
<jettyVersion>${project.version}</jettyVersion>
</systemPropertyVariables>
<useManifestOnlyJar>false</useManifestOnlyJar>
</configuration>
</plugin>

View File

@ -34,7 +34,7 @@ public class JettyDemos
{
private static final Logger LOG = LoggerFactory.getLogger(JettyDemos.class);
private static final Path JETTY_DEMOS_DIR;
private static final String VERSION;
private static String VERSION = System.getProperty("jettyVersion", "unknown");
static
{
@ -71,29 +71,27 @@ public class JettyDemos
LOG.warn("Unable to resolve Jetty Demos location", th);
}
}
JETTY_DEMOS_DIR = demosDir;
String version = "unknown";
Path pomFile = demosDir.resolve("pom.xml");
try (Stream<String> lineStream = Files.lines(pomFile))
if (version.equals(VERSION))
{
String versionLine = lineStream
.filter((line) -> line.contains("<version>"))
.findFirst()
.orElseThrow(() ->
{
throw new RuntimeException("Unable to find <version> in " + pomFile);
});
Path pomFile = demosDir.resolve("pom.xml");
try (Stream<String> lineStream = Files.lines(pomFile))
{
String versionLine = lineStream
.filter((line) -> line.contains("<version>"))
.findFirst()
.orElseThrow(() -> new RuntimeException("Unable to find <version> in " + pomFile));
version = versionLine.replaceAll("<[^>]*>", "").trim();
}
catch (IOException e)
{
LOG.warn("Unable to find <version> in " + pomFile, e);
}
version = versionLine.replaceAll("<[^>]*>", "").trim();
}
catch (IOException e)
{
LOG.warn("Unable to find <version> in " + pomFile, e);
}
VERSION = version;
VERSION = version;
}
}
private static Path asDirectory(String path)
@ -141,6 +139,33 @@ public class JettyDemos
return JETTY_DEMOS_DIR;
}
public static Path find(String path, MavenCoordinate mavenCoordinate) throws FileNotFoundException
{
try
{
return find(path);
}
catch (FileNotFoundException e)
{
//could be not in the target directory if restored from build cache
// but as the build always runs install the artifact should be there in local repository
}
//.repository/org/eclipse/jetty/ee9/demos/jetty-ee9-demo-jndi-webapp/12.0.0-SNAPSHOT/jetty-ee9-demo-jndi-webapp-12.0.0-SNAPSHOT.war
String version = mavenCoordinate.version().isEmpty() ? VERSION : mavenCoordinate.version();
Path result = Paths.get(System.getProperty("mavenRepoPath", System.getProperty("user.home") + "/.m2/repository"),
mavenCoordinate.groupId().replaceAll("\\.", "/"),
mavenCoordinate.artifactId(),
version,
mavenCoordinate.artifactId() + "-" + version + "." + mavenCoordinate.packaging()
);
if (!Files.exists(result))
{
throw new FileNotFoundException(result.toString());
}
return result;
}
@Deprecated
public static Path find(String path) throws FileNotFoundException
{
String expandedPath = path.replaceAll("@VER@", VERSION);
@ -152,6 +177,15 @@ public class JettyDemos
return result;
}
/**
*
* @param groupId Maven groupId
* @param artifactId Maven artifactId
* @param version can be <code>null</code> and default current project version will be used
* @param packaging Maven packaging (war, jar)
*/
public record MavenCoordinate(String groupId, String artifactId, String version, String packaging){}
public static void main(String... arg)
{
System.err.println("Jetty Demos Dir is " + JETTY_DEMOS_DIR);

View File

@ -146,7 +146,9 @@ public class LikeJettyXml
Path testWebapp = webappsDir.resolve("test.war");
if (!Files.exists(testWebapp))
{
Path testWebappSrc = JettyDemos.find("jetty-ee10-demo-simple-webapp/target/jetty-ee10-demo-simple-webapp-@VER@.war");
JettyDemos.MavenCoordinate mavenCoordinate = new JettyDemos.MavenCoordinate("org.eclipse.jetty.ee10.demos",
"jetty-ee10-demo-simple-webapp", "", "war");
Path testWebappSrc = JettyDemos.find("jetty-ee10-demo-simple-webapp/target/jetty-ee10-demo-simple-webapp-@VER@.war", mavenCoordinate);
Files.copy(testWebappSrc, testWebapp);
}

View File

@ -39,7 +39,9 @@ public class OneWebApp
// PlusConfiguration) to choosing where the webapp will unpack itself.
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/");
Path warFile = JettyDemos.find("demo-async-rest/demo-async-rest-webapp/target/demo-async-rest-webapp-@VER@.war");
JettyDemos.MavenCoordinate mavenCoordinate = new JettyDemos.MavenCoordinate("org.eclipse.jetty.ee10.demos",
"jetty-ee10-demo-async-rest-webapp", "", "war");
Path warFile = JettyDemos.find("demo-async-rest/demo-async-rest-webapp/target/demo-async-rest-webapp-@VER@.war", mavenCoordinate);
webapp.setWar(warFile.toString());
// A WebAppContext is a ContextHandler as well so it needs to be set to

View File

@ -44,7 +44,9 @@ public class OneWebAppWithJsp
// the webapp will unpack itself.
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/");
Path warFile = JettyDemos.find("demo-jsp-webapp/target/demo-jsp-webapp-@VER@.war");
JettyDemos.MavenCoordinate mavenCoordinate = new JettyDemos.MavenCoordinate("org.eclipse.jetty.ee10.demos",
"jetty-ee10-demo-jsp-webapp", "", "war");
Path warFile = JettyDemos.find("demo-jsp-webapp/target/demo-jsp-webapp-@VER@.war", mavenCoordinate);
webapp.setWarResource(webapp.getResourceFactory().newResource(warFile));
webapp.setExtractWAR(true);

View File

@ -45,7 +45,9 @@ public class ServerWithAnnotations
webapp.addConfiguration(new EnvConfiguration(), new PlusConfiguration(), new AnnotationConfiguration());
webapp.setContextPath("/");
Path warFile = JettyDemos.find("ee10-demo-spec/ee10-demo-spec-webapp/target/demo-spec-webapp-@VER@.war");
JettyDemos.MavenCoordinate mavenCoordinate = new JettyDemos.MavenCoordinate("org.eclipse.jetty.ee10.demos",
"jetty-ee10-demo-spec-webapp", "", "war");
Path warFile = JettyDemos.find("ee10-demo-spec/ee10-demo-spec-webapp/target/demo-spec-webapp-@VER@.war", mavenCoordinate);
webapp.setWar(warFile.toString());
webapp.setAttribute(
"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",

View File

@ -35,7 +35,9 @@ public class ServerWithJNDI
// Create a WebApp
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/");
Path testJndiWar = JettyDemos.find("jetty-ee10-demo-jndi-webapp/target/jetty-ee10-demo-jndi-webapp-@VER@.war");
JettyDemos.MavenCoordinate mavenCoordinate = new JettyDemos.MavenCoordinate("org.eclipse.jetty.ee10.demos",
"jetty-ee10-demo-jndi-webapp", "", "war");
Path testJndiWar = JettyDemos.find("jetty-ee10-demo-jndi-webapp/target/jetty-ee10-demo-jndi-webapp-@VER@.war", mavenCoordinate);
webapp.setWarResource(webapp.getResourceFactory().newResource(testJndiWar));
server.setHandler(webapp);

View File

@ -123,6 +123,46 @@
</artifactItems>
</configuration>
</execution>
<execution>
<id>unpack-jetty-ee10-demo-container-initializer</id>
<phase>process-test-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty.ee10.demos</groupId>
<artifactId>jetty-ee10-demo-container-initializer</artifactId>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/</outputDirectory>
<destFileName>jetty-ee10-demo-container-initializer.jar</destFileName>
</artifactItem>
</artifactItems>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
<execution>
<id>unpack-jetty-ee10-demo-web-fragment</id>
<phase>process-test-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty.ee10.demos</groupId>
<artifactId>jetty-ee10-demo-web-fragment</artifactId>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/</outputDirectory>
<destFileName>jetty-ee10-demo-web-fragment.jar</destFileName>
</artifactItem>
</artifactItems>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
<plugin>

View File

@ -118,13 +118,22 @@ public class SpecWebAppTest
private void copyDependency(String depName, Path libDir) throws IOException
{
// sinply use copy:dependency from maven...
Path targetDir = MavenPaths.projectBase().resolve("target");
Path jarFile = targetDir.resolve(depName + ".jar");
if (Files.exists(jarFile))
{
Files.copy(jarFile, libDir.resolve(depName + ".jar"));
return;
}
Path depPath = MavenPaths.projectBase().resolve("../" + depName).normalize();
if (!Files.isDirectory(depPath))
fail("Dependency not found: " + depPath);
Path outputJar = libDir.resolve(depName + ".jar");
Map<String, String> env = new HashMap<>();
env.put("create", "true");
URI uri = URI.create("jar:" + outputJar.toUri().toASCIIString());
try (FileSystem fs = FileSystems.newFileSystem(uri, env))
{

View File

@ -44,8 +44,6 @@
</execution>
</executions>
<configuration>
<addTestClassPath>true</addTestClassPath>
<ignoreFailures>true</ignoreFailures>
<scriptVariables>
<maven.surefire.plugin.version>${maven.surefire.plugin.version}</maven.surefire.plugin.version>
</scriptVariables>

View File

@ -87,6 +87,33 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-home</artifactId>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
<destFileName>${jettyHomeZipFileName}</destFileName>
</artifactItem>
</artifactItems>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
@ -102,10 +129,16 @@
</execution>
</executions>
<configuration>
<extraArtifacts>
<extraArtifact>org.eclipse.jetty:jetty-slf4j-impl:${project.version}</extraArtifact>
<extraArtifact>org.eclipse.jetty.ee10:jetty-ee10-apache-jsp:${project.version}</extraArtifact>
<extraArtifact>org.eclipse.jetty.ee10:jetty-ee10-glassfish-jstl:${project.version}</extraArtifact>
<extraArtifact>org.eclipse.jetty.ee10:jetty-ee10-webapp:${project.version}</extraArtifact>
<extraArtifact>org.eclipse.jetty:jetty-server:${project.version}</extraArtifact>
<extraArtifact>org.eclipse.jetty:jetty-deploy:${project.version}</extraArtifact>
<extraArtifact>org.eclipse.jetty:jetty-home:${project.version}:zip</extraArtifact>
</extraArtifacts>
<junitPackageName>org.eclipse.jetty.maven.its.ee10</junitPackageName>
<streamLogsOnFailures>true</streamLogsOnFailures>
<addTestClassPath>true</addTestClassPath>
<ignoreFailures>true</ignoreFailures>
<setupIncludes>
<setupInclude>it-parent-pom/pom.xml</setupInclude>
</setupIncludes>
@ -121,8 +154,9 @@
<jettyStopKey>${jetty.stopKey}</jettyStopKey>
<jettyStopPort>${jetty.stopPort}</jettyStopPort>
<maven.surefire.plugin.version>${maven.surefire.plugin.version}</maven.surefire.plugin.version>
<localRepoPath>${localRepoPath}</localRepoPath>
<jettyHomeZip>${jettyHomeZip}</jettyHomeZip>
</scriptVariables>
<settingsFile>src/it/settings.xml</settingsFile>
<goals>
<goal>clean</goal>
</goals>

View File

@ -72,9 +72,9 @@
<artifactId>jetty-ee10-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-slf4j-impl</artifactId>
<version>${jetty.version}</version>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-slf4j-impl</artifactId>
<version>${jetty.version}</version>
</dependency>
</dependencies>
<executions>

View File

@ -113,14 +113,15 @@
</goals>
<configuration>
<jettyBase>${basedir}/src/base</jettyBase>
<javaPath>${java.home}/bin/java</javaPath>
<jettyProperties>
<jetty.server.dumpAfterStart>true</jetty.server.dumpAfterStart>
<jetty.port.file>${jetty.port.file}</jetty.port.file>
<jetty.http.port>0</jetty.http.port>
<maven.local.repo>@localRepoPath@</maven.local.repo>
</jettyProperties>
<modules>ee10-apache-jsp,ee10-glassfish-jstl,ee10-testmod,resources</modules>
<jettyOptions>--debug</jettyOptions>
<jettyHomeZip>@jettyHomeZip@</jettyHomeZip>
</configuration>
</execution>
</executions>

View File

@ -136,6 +136,7 @@
<jetty.port.file>${jetty.port.file}</jetty.port.file>
<jetty.http.port>0</jetty.http.port>
</jettyProperties>
<jettyHomeZip>@jettyHomeZip@</jettyHomeZip>
<modules>ee10-apache-jsp,ee10-glassfish-jstl,ee10-testmod,resources</modules>
</configuration>
</execution>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<localRepository>@localRepoPath@</localRepository>
<profiles>
<profile>
<id>it-repo</id>

View File

@ -306,6 +306,12 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
*/
@Parameter
protected File jettyHome;
/**
* Location of Jetty home zipped
*/
@Parameter
public File jettyHomeZip;
/**
* Location of jetty base directory
@ -555,7 +561,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
jetty.setContextXml(contextXml);
if (jettyHome == null)
jetty.setJettyHomeZip(mavenProjectHelper.resolveArtifact(JETTY_HOME_GROUPID, JETTY_HOME_ARTIFACTID, plugin.getVersion(), "zip"));
jetty.setJettyHomeZip(jettyHomeZip != null ? jettyHomeZip : mavenProjectHelper.resolveArtifact(JETTY_HOME_GROUPID, JETTY_HOME_ARTIFACTID, plugin.getVersion(), "zip"));
jetty.version = plugin.getVersion();
jetty.setJettyHome(jettyHome);

View File

@ -186,7 +186,7 @@ public class JettyHomeForker extends AbstractForker
//add any args to the jvm
if (StringUtil.isNotBlank(jvmArgs))
{
Arrays.stream(jvmArgs.split(" ")).filter(a -> StringUtil.isNotBlank(a)).forEach((a) -> cmd.add(a.trim()));
Arrays.stream(jvmArgs.split(" ")).filter(StringUtil::isNotBlank).forEach((a) -> cmd.add(a.trim()));
}
cmd.add("-jar");
@ -225,7 +225,7 @@ public class JettyHomeForker extends AbstractForker
//put any other jetty options onto the command line
if (StringUtil.isNotBlank(jettyOptions))
{
Arrays.stream(jettyOptions.split(" ")).filter(a -> StringUtil.isNotBlank(a)).forEach((a) -> cmd.add(a.trim()));
Arrays.stream(jettyOptions.split(" ")).filter(StringUtil::isNotBlank).forEach((a) -> cmd.add(a.trim()));
}
//put any jetty properties onto the command line

View File

@ -387,6 +387,13 @@
<classifier>webbundle</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee10.demos</groupId>
<artifactId>jetty-ee10-demo-jetty-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee10.demos</groupId>
<artifactId>jetty-ee10-demo-jetty-webapp</artifactId>
@ -505,7 +512,7 @@
<configuration>
<skipTests>${skipTests}</skipTests>
<systemPropertyVariables>
<mavenRepoPath>${settings.localRepository}</mavenRepoPath>
<mavenRepoPath>${session.repositorySession.localRepository.basedir.absolutePath}</mavenRepoPath>
<settingsFilePath>${env.GLOBAL_MVN_SETTINGS}</settingsFilePath>
</systemPropertyVariables>
<argLine>-Dconscrypt-version=${conscrypt.version}</argLine>

View File

@ -45,8 +45,6 @@
</execution>
</executions>
<configuration>
<addTestClassPath>true</addTestClassPath>
<ignoreFailures>true</ignoreFailures>
<scriptVariables>
<maven.surefire.plugin.version>${maven.surefire.plugin.version}</maven.surefire.plugin.version>
</scriptVariables>

View File

@ -102,8 +102,6 @@
</executions>
<configuration>
<junitPackageName>org.eclipse.jetty.maven.its.ee8</junitPackageName>
<addTestClassPath>true</addTestClassPath>
<ignoreFailures>true</ignoreFailures>
<setupIncludes>
<setupInclude>it-parent-pom/pom.xml</setupInclude>
</setupIncludes>

View File

@ -126,18 +126,36 @@
<scope>test</scope>
</dependency>
-->
<dependency>
<groupId>org.eclipse.jetty.ee9.demos</groupId>
<artifactId>jetty-ee9-demo-jndi-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee9.demos</groupId>
<artifactId>jetty-ee9-demo-jsp-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee9.demos</groupId>
<artifactId>jetty-ee9-demo-simple-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee9.demos</groupId>
<artifactId>jetty-ee9-demo-spec-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee9.demos</groupId>
<artifactId>jetty-ee9-demo-async-rest-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
@ -146,8 +164,12 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<environmentVariables>
<mavenRepoPath>${settings.localRepository}</mavenRepoPath>
<jettyVersion>${project.version}</jettyVersion>
</environmentVariables>
<systemPropertyVariables>
<mavenRepoPath>${session.repositorySession.localRepository.basedir.absolutePath}</mavenRepoPath>
<jettyVersion>${project.version}</jettyVersion>
</systemPropertyVariables>
<useManifestOnlyJar>false</useManifestOnlyJar>
</configuration>
</plugin>

View File

@ -34,7 +34,7 @@ public class JettyDemos
{
private static final Logger LOG = LoggerFactory.getLogger(JettyDemos.class);
private static final Path JETTY_DEMOS_DIR;
private static final String VERSION;
private static String VERSION = System.getProperty("jettyVersion", "unknown");
static
{
@ -71,29 +71,27 @@ public class JettyDemos
LOG.warn("Unable to resolve Jetty Demos location", th);
}
}
JETTY_DEMOS_DIR = demosDir;
String version = "unknown";
Path pomFile = demosDir.resolve("pom.xml");
try (Stream<String> lineStream = Files.lines(pomFile))
if (version.equals(VERSION))
{
String versionLine = lineStream
.filter((line) -> line.contains("<version>"))
.findFirst()
.orElseThrow(() ->
{
throw new RuntimeException("Unable to find <version> in " + pomFile);
});
Path pomFile = demosDir.resolve("pom.xml");
try (Stream<String> lineStream = Files.lines(pomFile))
{
String versionLine = lineStream
.filter((line) -> line.contains("<version>"))
.findFirst()
.orElseThrow(() -> new RuntimeException("Unable to find <version> in " + pomFile));
version = versionLine.replaceAll("<[^>]*>", "").trim();
}
catch (IOException e)
{
LOG.warn("Unable to find <version> in " + pomFile, e);
}
version = versionLine.replaceAll("<[^>]*>", "").trim();
}
catch (IOException e)
{
LOG.warn("Unable to find <version> in " + pomFile, e);
}
VERSION = version;
VERSION = version;
}
}
private static Path asDirectory(String path)
@ -141,6 +139,33 @@ public class JettyDemos
return JETTY_DEMOS_DIR;
}
public static Path find(String path, MavenCoordinate mavenCoordinate) throws FileNotFoundException
{
try
{
return find(path);
}
catch (FileNotFoundException e)
{
//could be not in the target directory if restored from build cache
// but as the build always runs install the artifact should be there in local repository
}
//.repository/org/eclipse/jetty/ee9/demos/jetty-ee9-demo-jndi-webapp/12.0.0-SNAPSHOT/jetty-ee9-demo-jndi-webapp-12.0.0-SNAPSHOT.war
String version = mavenCoordinate.version().isEmpty() ? VERSION : mavenCoordinate.version();
Path result = Paths.get(System.getProperty("mavenRepoPath", System.getProperty("user.home") + "/.m2/repository"),
mavenCoordinate.groupId().replaceAll("\\.", "/"),
mavenCoordinate.artifactId(),
version,
mavenCoordinate.artifactId() + "-" + version + "." + mavenCoordinate.packaging()
);
if (!Files.exists(result))
{
throw new FileNotFoundException(result.toString());
}
return result;
}
@Deprecated
public static Path find(String path) throws FileNotFoundException
{
String expandedPath = path.replaceAll("@VER@", VERSION);
@ -152,8 +177,11 @@ public class JettyDemos
return result;
}
public record MavenCoordinate(String groupId, String artifactId, String version, String packaging){}
public static void main(String... arg)
{
System.err.println("Jetty Demos Dir is " + JETTY_DEMOS_DIR);
}
}

View File

@ -39,7 +39,9 @@ public class OneWebApp
// PlusConfiguration) to choosing where the webapp will unpack itself.
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/");
Path warFile = JettyDemos.find("jetty-ee9-demo-async-rest/jetty-ee9-demo-async-rest-webapp/target/jetty-ee9-demo-async-rest-webapp-@VER@.war");
JettyDemos.MavenCoordinate mavenCoordinate = new JettyDemos.MavenCoordinate("org.eclipse.jetty.ee9.demos",
"jetty-ee9-demo-async-rest-webapp", "", "war");
Path warFile = JettyDemos.find("jetty-ee9-demo-async-rest/jetty-ee9-demo-async-rest-webapp/target/jetty-ee9-demo-async-rest-webapp-@VER@.war", mavenCoordinate);
webapp.setWar(warFile.toString());
// A WebAppContext is a ContextHandler as well so it needs to be set to

View File

@ -44,7 +44,9 @@ public class OneWebAppWithJsp
// the webapp will unpack itself.
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/");
Path warFile = JettyDemos.find("jetty-ee9-demo-jsp-webapp/target/jetty-ee9-demo-jsp-webapp-@VER@.war");
JettyDemos.MavenCoordinate mavenCoordinate = new JettyDemos.MavenCoordinate("org.eclipse.jetty.ee9.demos",
"jetty-ee9-demo-jsp-webapp", "", "war");
Path warFile = JettyDemos.find("jetty-ee9-demo-jsp-webapp/target/jetty-ee9-demo-jsp-webapp-@VER@.war", mavenCoordinate);
webapp.setWarResource(webapp.getResourceFactory().newResource(warFile));
webapp.setExtractWAR(true);

View File

@ -45,7 +45,9 @@ public class ServerWithAnnotations
webapp.addConfiguration(new EnvConfiguration(), new PlusConfiguration(), new AnnotationConfiguration());
webapp.setContextPath("/");
Path warFile = JettyDemos.find("jetty-ee9-demo-spec/jetty-ee9-demo-spec-webapp/target/jetty-ee9-demo-spec-webapp-@VER@.war");
JettyDemos.MavenCoordinate mavenCoordinate = new JettyDemos.MavenCoordinate("org.eclipse.jetty.ee9.demos",
"jetty-ee9-demo-spec-webapp", "", "war");
Path warFile = JettyDemos.find("jetty-ee9-demo-spec/jetty-ee9-demo-spec-webapp/target/jetty-ee9-demo-spec-webapp-@VER@.war", mavenCoordinate);
webapp.setWar(warFile.toString());
webapp.setAttribute(

View File

@ -35,7 +35,9 @@ public class ServerWithJNDI
// Create a WebApp
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/");
Path testJndiWar = JettyDemos.find("jetty-ee9-demo-jndi-webapp/target/jetty-ee9-demo-jndi-webapp-@VER@.war");
JettyDemos.MavenCoordinate mavenCoordinate = new JettyDemos.MavenCoordinate("org.eclipse.jetty.ee9.demos",
"jetty-ee9-demo-jndi-webapp", "", "war");
Path testJndiWar = JettyDemos.find("jetty-ee9-demo-jndi-webapp/target/jetty-ee9-demo-jndi-webapp-@VER@.war", mavenCoordinate);
webapp.setWarResource(webapp.getResourceFactory().newResource(testJndiWar));
server.setHandler(webapp);

View File

@ -44,8 +44,6 @@
</execution>
</executions>
<configuration>
<addTestClassPath>true</addTestClassPath>
<ignoreFailures>true</ignoreFailures>
<scriptVariables>
<maven.surefire.plugin.version>${maven.surefire.plugin.version}</maven.surefire.plugin.version>
</scriptVariables>

View File

@ -75,6 +75,33 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-home</artifactId>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
<destFileName>${jettyHomeZipFileName}</destFileName>
</artifactItem>
</artifactItems>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
@ -102,8 +129,6 @@
</executions>
<configuration>
<junitPackageName>org.eclipse.jetty.maven.its.ee9</junitPackageName>
<addTestClassPath>true</addTestClassPath>
<ignoreFailures>true</ignoreFailures>
<setupIncludes>
<setupInclude>it-parent-pom/pom.xml</setupInclude>
</setupIncludes>
@ -122,8 +147,9 @@
<jettyStopPort>${jetty.stopPort}</jettyStopPort>
<maven.surefire.plugin.version>${maven.surefire.plugin.version}</maven.surefire.plugin.version>
<servletApiVersion>${jetty.servlet.api.version}</servletApiVersion>
<localRepoPath>${localRepoPath}</localRepoPath>
<jettyHomeZip>${jettyHomeZip}</jettyHomeZip>
</scriptVariables>
<settingsFile>src/it/settings.xml</settingsFile>
<goals>
<goal>clean</goal>
</goals>

View File

@ -305,6 +305,12 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
*/
@Parameter
protected File jettyHome;
/**
* Location of Jetty home zipped
*/
@Parameter
public File jettyHomeZip;
/**
* Location of jetty base directory
@ -554,7 +560,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
jetty.setContextXml(contextXml);
if (jettyHome == null)
jetty.setJettyHomeZip(mavenProjectHelper.resolveArtifact(JETTY_HOME_GROUPID, JETTY_HOME_ARTIFACTID, plugin.getVersion(), "zip"));
jetty.setJettyHomeZip(jettyHomeZip != null ? jettyHomeZip : mavenProjectHelper.resolveArtifact(JETTY_HOME_GROUPID, JETTY_HOME_ARTIFACTID, plugin.getVersion(), "zip"));
jetty.version = plugin.getVersion();
jetty.setJettyHome(jettyHome);

View File

@ -383,6 +383,13 @@
<classifier>webbundle</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee9.demos</groupId>
<artifactId>jetty-ee9-demo-jetty-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee9.demos</groupId>
<artifactId>jetty-ee9-demo-jetty-webapp</artifactId>
@ -501,7 +508,7 @@
<configuration>
<skipTests>${skipTests}</skipTests>
<systemPropertyVariables>
<mavenRepoPath>${settings.localRepository}</mavenRepoPath>
<mavenRepoPath>${session.repositorySession.localRepository.basedir.absolutePath}</mavenRepoPath>
<settingsFilePath>${env.GLOBAL_MVN_SETTINGS}</settingsFilePath>
</systemPropertyVariables>
<argLine>-Dconscrypt-version=${conscrypt.version}</argLine>

35
pom.xml
View File

@ -107,6 +107,7 @@
<mariadb.version>3.1.4</mariadb.version>
<mariadb.docker.version>10.3.6</mariadb.docker.version>
<maven.deps.version>3.9.0</maven.deps.version>
<maven-build-cache.version>1.0.1</maven-build-cache.version>
<maven-artifact-transfer.version>0.13.1</maven-artifact-transfer.version>
<maven.resolver.version>1.9.15</maven.resolver.version>
<maven.version>3.9.0</maven.version>
@ -191,6 +192,8 @@
<invoker.mergeUserSettings>false</invoker.mergeUserSettings>
<it.debug>false</it.debug>
<localRepoPath>${project.build.directory}/local-repo</localRepoPath>
<jettyHomeZipFileName>jetty-home.zip</jettyHomeZipFileName>
<jettyHomeZip>${project.build.directory}/${jettyHomeZipFileName}</jettyHomeZip>
<jetty.surefire.argLine>-Dfile.encoding=UTF-8 -Duser.language=en -Duser.region=US -Djava.io.tmpdir=${project.build.directory} -showversion -Xmx6g -Xms4g -Xlog:gc:stderr:time,level,tags</jetty.surefire.argLine>
<jetty.testtracker.log>true</jetty.testtracker.log>
<jetty.unixdomain.dir>/tmp</jetty.unixdomain.dir>
@ -201,6 +204,8 @@
<!-- if changing this version please update default in RemoteInfinispanTestSupport you will get thanks from Eclipse IDE users -->
<!-- but hey we have no more strange people?? :P -->
<infinispan.docker.image.version>11.0.14.Final</infinispan.docker.image.version>
<project.build.outputTimestamp>2023-06-05T23:12:49Z</project.build.outputTimestamp>
</properties>
<licenses>
@ -235,6 +240,13 @@
</modules>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.extensions</groupId>
<artifactId>maven-build-cache-extension</artifactId>
<version>${maven-build-cache.version}</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -275,8 +287,8 @@
<configuration>
<rules>
<requireMavenVersion>
<version>[3.8.4,)</version>
<message>[ERROR] OLD MAVEN [${maven.version}] in use, Jetty ${project.version} requires Maven 3.8.4 or newer</message>
<version>[3.9.2,)</version>
<message>[ERROR] OLD MAVEN [${maven.version}] in use, Jetty ${project.version} requires Maven 3.9.2 or newer</message>
</requireMavenVersion>
<requireJavaVersion>
<version>[17,)</version>
@ -613,6 +625,7 @@
<artifactId>maven-invoker-plugin</artifactId>
<version>${maven.invoker.plugin.version}</version>
<configuration>
<addTestClassPath>true</addTestClassPath>
<mergeUserSettings>${invoker.mergeUserSettings}</mergeUserSettings>
<writeJunitReport>true</writeJunitReport>
<junitPackageName>org.eclipse.jetty.maven.its</junitPackageName>
@ -626,8 +639,8 @@
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<localRepositoryPath>${localRepoPath}</localRepositoryPath>
<settingsFile>${settingsPath}</settingsFile>
<ignoreFailures>true</ignoreFailures>
<skipInvocation>${skipTests}</skipInvocation>
<streamLogsOnFailures>true</streamLogsOnFailures>
<pomIncludes>
<pomInclude>*/pom.xml</pomInclude>
</pomIncludes>
@ -2041,7 +2054,6 @@
<id>ci</id>
<properties>
<surefire.rerunFailingTestsCount>0</surefire.rerunFailingTestsCount>
<settingsPath>${env.GLOBAL_MVN_SETTINGS}</settingsPath>
<spotbugs.failOnError>false</spotbugs.failOnError>
<!-- Defines a SpotBugs threshold. Use "Low" to discover low-priority bugs -->
<spotbugs.threshold>Medium</spotbugs.threshold>
@ -2049,7 +2061,8 @@
<spotbugs.effort>Default</spotbugs.effort>
<spotbugs.skip>false</spotbugs.skip>
<spotbugs.onlyAnalyze>org.eclipse.jetty.*</spotbugs.onlyAnalyze>
<maven.repo.uri></maven.repo.uri>
<!-- need a good default value if running this profile locally with empty repo -->
<maven.repo.uri>https://repo.maven.apache.org/maven2/</maven.repo.uri>
<home.start.timeout>120</home.start.timeout>
</properties>
<modules>
@ -2081,6 +2094,18 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>

View File

@ -103,7 +103,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<mavenRepoPath>${settings.localRepository}</mavenRepoPath>
<mavenRepoPath>${session.repositorySession.localRepository.basedir.absolutePath}</mavenRepoPath>
<jettyVersion>${project.version}</jettyVersion>
<hazelcast.version>${hazelcast.version}</hazelcast.version>
<mariadb.docker.version>${mariadb.docker.version}</mariadb.docker.version>