Skip to content

Commit

Permalink
Attempt to simplify build process using maven toolchains (#1952)
Browse files Browse the repository at this point in the history
* Attempt to simplify build process using maven toolchains

* Introduce property to hold latest jdk version

---------

Co-authored-by: Marvin Froeder <[email protected]>
  • Loading branch information
velo and velo authored Feb 25, 2023
1 parent 3eeb58b commit 7015a27
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 236 deletions.
127 changes: 6 additions & 121 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,12 @@
# the License.
#

orbs:
android: circleci/[email protected]

# common executors
executors:
java:
parameters:
version:
description: 'jdk version to use'
default: '8.0'
type: string
docker:
- image: cimg/openjdk:<<parameters.version>>
android:
parameters:
version:
description: 'jdk version to use'
default: '8.0'
type: string
docker:
- image: cimg/openjdk:<<parameters.version>>
- image: velo/toolchains-4-ci-builds

# common commands
commands:
resolve-dependencies:
Expand Down Expand Up @@ -60,16 +45,7 @@ commands:
name: 'Deploy Core Modules Sonatype'
command: |
./mvnw -ntp -nsu -s .circleci/settings.xml -P release -pl -:feign-benchmark -DskipTests=true deploy
nexus-deploy-jdk11:
steps:
- run:
name: 'Build JDK 11 Release modules locally'
command: |
./mvnw -ntp -B -nsu -s .circleci/settings.xml -P java11 -pl :feign-java11,:feign-jakarta -am -DskipTests=true install
- run:
name: 'Deploy JDK 11 Modules to Sonatype'
command: |
./mvnw -ntp -B -nsu -s .circleci/settings.xml -P release,java11 -pl :feign-java11,:feign-jakarta -DskipTests=true deploy
# our job defaults
defaults: &defaults
working_directory: ~/feign
Expand Down Expand Up @@ -98,14 +74,8 @@ version: 2.1

jobs:
test:
parameters:
jdk:
description: 'jdk version to use'
default: '8.0'
type: string
executor:
name: java
version: <<parameters.jdk>>
<<: *defaults
steps:
- checkout
Expand All @@ -123,28 +93,10 @@ jobs:
command: |
./mvnw -ntp -B test
- verify-formatting
android-test:
# These next lines define the Android machine image executor: https://circleci.com/docs/2.0/executor-types/
executor:
name: android/android-machine

steps:
# Checkout the code as the first step.
- checkout

# The next step will run the unit tests
- android/run-tests:
test-command: ./gradlew lint testDebug --continue

deploy:
parameters:
jdk:
description: 'jdk version to use'
default: '8.0'
type: string
executor:
name: java
version: <<parameters.jdk>>
<<: *defaults
steps:
- checkout
Expand All @@ -156,100 +108,33 @@ jobs:
- configure-gpg
- nexus-deploy

deploy-jdk11:
parameters:
jdk:
description: 'jdk version to use'
default: '11.0'
type: string
executor:
name: java
version: <<parameters.jdk>>
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- feign-dependencies-{{ checksum "pom.xml" }}
- feign-dependencies-
- resolve-dependencies
- configure-gpg
- nexus-deploy-jdk11

workflows:
version: 2
build:
jobs:
- test:
jdk: '8.0'
name: 'jdk 8'
filters:
<<: *all-branches
- test:
jdk: '11.0'
name: 'jdk 11'
filters:
<<: *all-branches
- test:
jdk: '17.0'
name: 'jdk 17'
name: 'pr-build'
filters:
<<: *all-branches
- test:
name: 'android test'


snapshot:
jobs:
- test:
jdk: '8.0'
name: 'jdk 8'
filters:
<<: *master-only
- test:
jdk: '11.0'
name: 'jdk 11'
filters:
<<: *master-only
- test:
jdk: '17.0'
name: 'jdk 17'
name: 'snapshot'
filters:
<<: *master-only
- deploy:
jdk: '8.0'
name: 'deploy snapshot'
requires:
- 'jdk 8'
- 'jdk 11'
- 'jdk 17'
context: Sonatype
filters:
<<: *master-only
- deploy-jdk11:
jdk: '11.0'
name: 'deploy jdk11 snapshot modules'
requires:
- 'jdk 11'
- 'deploy snapshot'
- 'snapshot'
context: Sonatype
filters:
<<: *master-only

release:
jobs:
- deploy:
jdk: '8.0'
name: 'release to maven central'
context: Sonatype
filters:
<<: *tags-only
- deploy-jdk11:
jdk: '11.0'
name: 'release jdk11 artifacts to maven central'
requires:
- 'release to maven central'
context: Sonatype
filters:
<<: *tags-only

1 change: 0 additions & 1 deletion apt-test-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<executions>
<execution>
<goals>
Expand Down
1 change: 0 additions & 1 deletion example-github-with-coroutine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<!--
Travis does not inject GITHUB_TOKEN when building PRs, which will make module fail
Expand Down
1 change: 0 additions & 1 deletion example-github/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<!--
Travis does not inject GITHUB_TOKEN when building PRs, which will make module fail
Expand Down
1 change: 0 additions & 1 deletion example-wikipedia-with-springboot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<executions>
<execution>
<goals>
Expand Down
1 change: 0 additions & 1 deletion example-wikipedia/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<executions>
<execution>
<goals>
Expand Down
1 change: 1 addition & 0 deletions jakarta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<description>Feign Jakarta</description>

<properties>
<main.java.version>11</main.java.version>
<main.basedir>${project.basedir}/..</main.basedir>
</properties>

Expand Down
73 changes: 22 additions & 51 deletions jaxb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,57 +43,28 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.4.0-b180830.0438</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-core</artifactId>
<version>4.0.2</version>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>java11</id>
<activation>
<jdk>[11,]</jdk>
</activation>

<!--
JAXB was removed from java SDK on JEP 320
http://openjdk.java.net/jeps/320
-->
<dependencies>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.4.0-b180830.0438</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>java17</id>
<activation>
<jdk>[17,]</jdk>
</activation>

<!--
JAXB was removed from java SDK on JEP 320
http://openjdk.java.net/jeps/320
-->
<dependencies>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-core</artifactId>
<version>4.0.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>

</project>
Loading

0 comments on commit 7015a27

Please sign in to comment.