Skip to content

Commit

Permalink
dependency convergence check
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Nesen <[email protected]>
  • Loading branch information
senivam committed Mar 19, 2024
1 parent 82da18c commit fc45894
Show file tree
Hide file tree
Showing 29 changed files with 280 additions and 82 deletions.
2 changes: 1 addition & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jakarta.inject Version: 1
* License: Apache License, 2.0
* Copyright (C) 2009 The JSR-330 Expert Group

Javassist Version 3.29.2-GA
Javassist Version 3.30.2-GA
* License: Apache License, 2.0
* Project: http://www.javassist.org/
* Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@

<properties>
<jersey.version>${project.version}</jersey.version>
<jetty.version>11.0.18</jetty.version>
<jetty.version>11.0.20</jetty.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<surefire.mvn.plugin.version>3.2.1</surefire.mvn.plugin.version>
<war.mvn.plugin.version>3.4.0</war.mvn.plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

<properties>
<jersey.version>${project.version}</jersey.version>
<junit-jupiter.version>5.10.0</junit-jupiter.version>
<junit-jupiter.version>5.10.2</junit-jupiter.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<surefire.mvn.plugin.version>3.2.1</surefire.mvn.plugin.version>
</properties>
Expand Down
6 changes: 0 additions & 6 deletions bundles/apidocs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>jersey-apache-connector</artifactId>
<version>${project.version}</version>
<!--<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>-->
</dependency>
<dependency>
<groupId>org.glassfish.jersey.connectors</groupId>
Expand Down
3 changes: 1 addition & 2 deletions bundles/jaxrs-ri/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, 2024 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -315,7 +315,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
14 changes: 13 additions & 1 deletion connectors/apache-connector/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2011, 2023 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2011, 2024 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -40,6 +40,12 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -55,6 +61,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>${commons.codec.version}</version>
</dependency>
</dependencies>

<build>
Expand Down
1 change: 1 addition & 0 deletions etc/config/copyright-exclude
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jaxb.index
/etc/config/copyright.txt
/etc/config/edl-copyright.txt
/etc/jenkins/
/etc/scripts/
/etc/travis/
/LICENSE.md
/third-party-license-readme.txt
Expand Down
4 changes: 4 additions & 0 deletions etc/jenkins/Jenkinsfile_ci_build
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ pipeline {
steps {
sh '''
bash ${WORKSPACE}/etc/jenkins/jenkins_build.sh
export EXCLUDE_ARGS=' -pl !:jersey-spring6'
bash ${WORKSPACE}/etc/scripts/validation/dependency-convergence.sh
'''
}
}
Expand All @@ -33,6 +35,7 @@ pipeline {
steps {
sh '''
bash ${WORKSPACE}/etc/jenkins/jenkins_build.sh
bash ${WORKSPACE}/etc/scripts/validation/dependency-convergence.sh
'''
}
}
Expand All @@ -47,6 +50,7 @@ pipeline {
steps {
sh '''
bash ${WORKSPACE}/etc/jenkins/jenkins_build.sh
bash ${WORKSPACE}/etc/scripts/validation/dependency-convergence.sh
'''
}
}
Expand Down
44 changes: 44 additions & 0 deletions etc/scripts/validation/dependency-convergence.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

readonly VALIDATION_DEPENDENCIES_MATCH='<!-- Insert dependencies here -->'
readonly VALIDATION_POM=validation.pom.xml
readonly POM_TEMPLATE_NAME=pom.template.xml
readonly TEMP_FILE=modules.xml

readonly MVN_CLI='org.apache.maven.plugins:maven-enforcer-plugin:enforce -Denforcer.rules=dependencyConvergence'

readonly DEPENDENCY_GENERATION_PATTERN='<dependency><groupId>${project.groupId}</groupId><artifactId>${project.artifactId}</artifactId><version>${jersey.version}</version></dependency>'

# Path to this script
[ -h "${0}" ] && readonly SCRIPT_PATH="$(readlink "${0}")" || readonly SCRIPT_PATH="${0}"

readonly CURRENT_LOCATION=$(dirname -- "${SCRIPT_PATH}")
readonly WS_DIR=$(cd ${CURRENT_LOCATION}; cd '../../..' ; pwd -P)

#Prepare pom.xml from template

cp -a ${CURRENT_LOCATION}/${POM_TEMPLATE_NAME} ${CURRENT_LOCATION}/${VALIDATION_POM}

export JERSEY_VERSION=$(mvn exec:exec -Dexec.executable='echo' -Dexec.args='${project.version}' -f ${WS_DIR}/pom.xml -q -pl org.glassfish.jersey:project)

echo "Validating convergences for Jersey "$JERSEY_VERSION
echo '****************************************************'
echo `mvn -v`
echo '****************************************************'

#get list of modules to b validated
mvn -f ${WS_DIR}/pom.xml -Dexec.executable='echo' \
-Dtests.excluded \
-Dexec.args=${DEPENDENCY_GENERATION_PATTERN} \
${MVN_ARGS} \
${EXCLUDE_ARGS} \
-pl '!:helloworld-benchmark' exec:exec -q > ${CURRENT_LOCATION}/${TEMP_FILE}

#add the list of modules to the prepared pom.xml
sed -e "/${VALIDATION_DEPENDENCIES_MATCH}/ {" -e "r ${CURRENT_LOCATION}/${TEMP_FILE}" -e 'd' -e '}' -i ${CURRENT_LOCATION}/${VALIDATION_POM}

#run validation
mvn ${MVN_ARGS} ${MVN_CLI} -f ${CURRENT_LOCATION}/${VALIDATION_POM} -Djersey.version=${JERSEY_VERSION}

#clean the mess
rm ${CURRENT_LOCATION}/${TEMP_FILE}
41 changes: 41 additions & 0 deletions etc/scripts/validation/pom.template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->

<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">
<groupId>org.glassfish.jersey.validation</groupId>
<artifactId>dependency-convergences</artifactId>
<version>0.0.1</version>
<modelVersion>4.0.0</modelVersion>

<packaging>war</packaging>
<name>jersey-dependency-convergence-validation</name>

<description>dependencyConvergence rule check</description>


<dependencies>
<!-- Insert dependencies here -->
</dependencies>

<properties>
<jersey.version>3.0.99-SNAPSHOT</jersey.version>
</properties>
</project>
2 changes: 1 addition & 1 deletion examples/NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jakarta.inject Version: 1
* License: Apache License, 2.0
* Copyright (C) 2009 The JSR-330 Expert Group

Javassist Version 3.29.2-GA
Javassist Version 3.30.2-GA
* License: Apache License, 2.0
* Project: http://www.javassist.org/
* Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
Expand Down
20 changes: 19 additions & 1 deletion examples/configured-client/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2023, 2024 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -56,8 +56,26 @@
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
<exclusion>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>

<!-- Instead of helidon-microprofile-config, smallrye-config can be used -->
<!-- <dependency>-->
Expand Down
14 changes: 12 additions & 2 deletions examples/groovy/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010, 2023 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2010, 2024 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -29,6 +29,16 @@
<artifactId>groovy-all</artifactId>
<type>pom</type>
<version>${groovy.version}</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
Expand All @@ -48,7 +58,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.2</version>
<version>${junit5.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
8 changes: 7 additions & 1 deletion examples/helloworld-spring-webapp/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, 2024 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -55,6 +55,12 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<exclusions>
<exclusion>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-observation</artifactId>
</exclusion>
</exclusions>
<version>${spring6.version}</version>
</dependency>
<dependency>
Expand Down
15 changes: 14 additions & 1 deletion examples/http-patch/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2011, 2023 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2011, 2024 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -49,8 +49,21 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
18 changes: 17 additions & 1 deletion examples/open-tracing/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2017, 2023 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, 2024 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -62,6 +62,22 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</exclusion>
<exclusion>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-api</artifactId>
</exclusion>
<exclusion>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-util</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down
6 changes: 5 additions & 1 deletion ext/cdi/jersey-weld2-se/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2014, 2023 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2014, 2024 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -62,6 +62,10 @@
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
</exclusion>
<exclusion>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
Expand Down
Loading

0 comments on commit fc45894

Please sign in to comment.