Jetty 9.4.x pax exam upgrade for central repo https, pre download all artifacts for maven its (#3902)

* ensure we use local repository first to avoid download, upgrade pax versions
pre download artifacts to avoid download by maven invoker its

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* force using local repository first see https://issues.apache.org/jira/browse/MINVOKER-249

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* use local setttings to use mirrors

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* use https

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* install build resources first to avoid checkstyle build issue

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* downgrade pax-swissbox-framework as the pax exam seems to use this one and want to download it...

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* fix enforcer rule RequireUpperBoundDeps...

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* not used anymore

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* force pax url to use provided settings via Jenkins withMvn

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* renove debugging System.out

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* version is defined in the project

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* cleanup after Jan review comments

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
This commit is contained in:
Olivier Lamy 2019-07-30 11:13:54 +10:00 committed by GitHub
parent bb639817a3
commit 1b6bf389d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 46 additions and 11 deletions

5
Jenkinsfile vendored
View File

@ -73,6 +73,7 @@ pipeline {
agent { node { label 'linux' } } agent { node { label 'linux' } }
options { timeout(time: 30, unit: 'MINUTES') } options { timeout(time: 30, unit: 'MINUTES') }
steps { steps {
mavenBuild("jdk11", "install -f build-resources", "maven3", true)
mavenBuild("jdk11", "install checkstyle:check -DskipTests", "maven3", true) mavenBuild("jdk11", "install checkstyle:check -DskipTests", "maven3", true)
recordIssues( recordIssues(
enabledForFailure: true, aggregatingResults: true, enabledForFailure: true, aggregatingResults: true,
@ -137,15 +138,13 @@ def slackNotif() {
* @return the Jenkinsfile step representing a maven build * @return the Jenkinsfile step representing a maven build
*/ */
def mavenBuild(jdk, cmdline, mvnName, junitPublishDisabled) { def mavenBuild(jdk, cmdline, mvnName, junitPublishDisabled) {
def localRepo = "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}" // ".repository" // def localRepo = ".repository"
def settingsName = 'oss-settings.xml'
def mavenOpts = '-Xms1g -Xmx4g -Djava.awt.headless=true' def mavenOpts = '-Xms1g -Xmx4g -Djava.awt.headless=true'
withMaven( withMaven(
maven: mvnName, maven: mvnName,
jdk: "$jdk", jdk: "$jdk",
publisherStrategy: 'EXPLICIT', publisherStrategy: 'EXPLICIT',
globalMavenSettingsConfig: settingsName,
options: [junitPublisher(disabled: junitPublishDisabled),mavenLinkerPublisher(disabled: false),pipelineGraphPublisher(disabled: false)], options: [junitPublisher(disabled: junitPublishDisabled),mavenLinkerPublisher(disabled: false),pipelineGraphPublisher(disabled: false)],
mavenOpts: mavenOpts, mavenOpts: mavenOpts,
mavenLocalRepo: localRepo) { mavenLocalRepo: localRepo) {

View File

@ -144,6 +144,16 @@
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<version>@maven.war.plugin.version@</version> <version>@maven.war.plugin.version@</version>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>@maven.install.plugin.version@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>@maven.deploy.plugin.version@</version>
</plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
</build> </build>

View File

@ -20,7 +20,7 @@ File buildLog = new File( basedir, 'build.log' )
assert buildLog.text.contains( 'Started Jetty Server' ) assert buildLog.text.contains( 'Started Jetty Server' )
assert buildLog.text.contains( '(1a) >> javax.servlet.ServletContextListener loaded from jar:' ) assert buildLog.text.contains( '(1a) >> javax.servlet.ServletContextListener loaded from jar:' )
assert buildLog.text.contains( 'local-repo/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar!/javax/servlet/ServletContextListener.class << (1b)' ) assert buildLog.text.contains( 'javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar!/javax/servlet/ServletContextListener.class << (1b)' )
assert buildLog.text.contains( '(2a) >> mca.common.CommonService loaded from file:' ) assert buildLog.text.contains( '(2a) >> mca.common.CommonService loaded from file:' )
assert buildLog.text.contains( 'common/target/classes/mca/common/CommonService.class << (2b)' ) assert buildLog.text.contains( 'common/target/classes/mca/common/CommonService.class << (2b)' )

View File

@ -1,6 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<settings> <settings>
<mirrors>
<mirror>
<id>local.mirror</id>
<url>file://@localRepo@</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles> <profiles>
<profile> <profile>
<id>it-repo</id> <id>it-repo</id>

View File

@ -14,8 +14,8 @@
<bundle-symbolic-name>${project.groupId}.boot.test.osgi</bundle-symbolic-name> <bundle-symbolic-name>${project.groupId}.boot.test.osgi</bundle-symbolic-name>
<jetty-orbit-url>http://download.eclipse.org/jetty/orbit/</jetty-orbit-url> <jetty-orbit-url>http://download.eclipse.org/jetty/orbit/</jetty-orbit-url>
<assembly-directory>target/distribution</assembly-directory> <assembly-directory>target/distribution</assembly-directory>
<exam.version>4.12.0</exam.version> <exam.version>4.13.1</exam.version>
<url.version>2.5.2</url.version> <url.version>2.6.1</url.version>
<injection.bundle.version>1.0</injection.bundle.version> <injection.bundle.version>1.0</injection.bundle.version>
<skipTests>true</skipTests> <skipTests>true</skipTests>
</properties> </properties>
@ -449,6 +449,7 @@
<skipTests>${skipTests}</skipTests> <skipTests>${skipTests}</skipTests>
<systemPropertyVariables> <systemPropertyVariables>
<mavenRepoPath>${settings.localRepository}</mavenRepoPath> <mavenRepoPath>${settings.localRepository}</mavenRepoPath>
<settingsFilePath>${env.GLOBAL_MVN_SETTINGS}</settingsFilePath>
</systemPropertyVariables> </systemPropertyVariables>
</configuration> </configuration>
<!-- paxexam still using junit 4 so we have to force the provider here --> <!-- paxexam still using junit 4 so we have to force the provider here -->

View File

@ -38,6 +38,7 @@ import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.ops4j.pax.exam.CoreOptions; import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.Option;
import org.ops4j.pax.url.mvn.internal.AetherBasedResolver;
import org.osgi.framework.Bundle; import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext; import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceReference;
@ -106,11 +107,22 @@ public class TestOSGiUtil
public static List<Option> coreJettyDependencies() public static List<Option> coreJettyDependencies()
{ {
AetherBasedResolver l;
List<Option> res = new ArrayList<>(); List<Option> res = new ArrayList<>();
res.add(systemProperty("bundle.debug").value(Boolean.toString(Boolean.getBoolean(TestOSGiUtil.BUNDLE_DEBUG)))); res.add(systemProperty("bundle.debug").value(Boolean.toString(Boolean.getBoolean(TestOSGiUtil.BUNDLE_DEBUG))));
String mavenRepoPath = System.getProperty("mavenRepoPath"); String mavenRepoPath = System.getProperty("mavenRepoPath");
if (!StringUtil.isBlank(mavenRepoPath)) if (!StringUtil.isBlank(mavenRepoPath))
res.add(systemProperty("org.ops4j.pax.url.mvn.localRepository").value(mavenRepoPath)); {
res.add( systemProperty( "org.ops4j.pax.url.mvn.localRepository" ).value( mavenRepoPath ) );
res.add( systemProperty( "org.ops4j.pax.url.mvn.defaultRepositories" ).value( "file://" + mavenRepoPath + "@id=local.repo") );
res.add( systemProperty( "org.ops4j.pax.url.mvn.useFallbackRepositories").value( Boolean.FALSE.toString() ) );
res.add( systemProperty( "org.ops4j.pax.url.mvn.repositories").value( "+https://repo1.maven.org/maven2@id=maven.central.repo" ) );
}
String settingsFilePath = System.getProperty("settingsFilePath");
if (!StringUtil.isBlank(settingsFilePath))
{
res.add( systemProperty( "org.ops4j.pax.url.mvn.settings" ).value( System.getProperty( "settingsFilePath" ) ) );
}
res.add(mavenBundle().groupId("org.ow2.asm").artifactId("asm").versionAsInProject().start()); res.add(mavenBundle().groupId("org.ow2.asm").artifactId("asm").versionAsInProject().start());
res.add(mavenBundle().groupId("org.ow2.asm").artifactId("asm-commons").versionAsInProject().start()); res.add(mavenBundle().groupId("org.ow2.asm").artifactId("asm-commons").versionAsInProject().start());
res.add(mavenBundle().groupId("org.ow2.asm").artifactId("asm-tree").versionAsInProject().start()); res.add(mavenBundle().groupId("org.ow2.asm").artifactId("asm-tree").versionAsInProject().start());

14
pom.xml
View File

@ -52,6 +52,8 @@
<maven.source.plugin.version>3.0.1</maven.source.plugin.version> <maven.source.plugin.version>3.0.1</maven.source.plugin.version>
<maven.war.plugin.version>3.2.2</maven.war.plugin.version> <maven.war.plugin.version>3.2.2</maven.war.plugin.version>
<maven.plugin-tools.version>3.5.2</maven.plugin-tools.version> <maven.plugin-tools.version>3.5.2</maven.plugin-tools.version>
<maven.install.plugin.version>2.5.2</maven.install.plugin.version>
<maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
<!-- testing --> <!-- testing -->
<it.debug>false</it.debug> <it.debug>false</it.debug>
@ -59,6 +61,7 @@
<spring-boot.version>2.1.1.RELEASE</spring-boot.version> <spring-boot.version>2.1.1.RELEASE</spring-boot.version>
<jsr250-api.version>1.0</jsr250-api.version> <jsr250-api.version>1.0</jsr250-api.version>
<javax.annotation-api>1.3</javax.annotation-api> <javax.annotation-api>1.3</javax.annotation-api>
<localRepoPath>${settings.localRepository}</localRepoPath>
</properties> </properties>
<licenses> <licenses>
@ -490,7 +493,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version> <version>${maven.deploy.plugin.version}</version>
<configuration> <configuration>
<retryFailedDeploymentCount>10</retryFailedDeploymentCount> <retryFailedDeploymentCount>10</retryFailedDeploymentCount>
</configuration> </configuration>
@ -525,18 +528,21 @@
<projectsDirectory>src/it</projectsDirectory> <projectsDirectory>src/it</projectsDirectory>
<timeoutInSeconds>300</timeoutInSeconds> <timeoutInSeconds>300</timeoutInSeconds>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo> <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath> <localRepositoryPath>${localRepoPath}</localRepositoryPath>
<settingsFile>src/it/settings.xml</settingsFile> <!--settingsFile>src/it/settings.xml</settingsFile-->
<skipInvocation>${skipTests}</skipInvocation> <skipInvocation>${skipTests}</skipInvocation>
<pomIncludes> <pomIncludes>
<pomInclude>*/pom.xml</pomInclude> <pomInclude>*/pom.xml</pomInclude>
</pomIncludes> </pomIncludes>
<filterProperties>
<localRepo>${localRepoPath}</localRepo>
</filterProperties>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId> <artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version> <version>${maven.install.plugin.version}</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>