Skip to content

Commit

Permalink
Install Maven and Java project dependencies sequentially (#504)
Browse files Browse the repository at this point in the history
* Add target `install-maven`

* Download java dependencies sequentially

* Exclude the dl of java dependencies that live in this workspace

* Use `./mvnw dependency:go-offline`

* Add workaround to mvn `-DexcludeGroupIds` bug
  • Loading branch information
tschaffter committed Aug 7, 2022
1 parent ca7dc0c commit 7142360
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 22 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/ci.yml
Expand Up @@ -53,14 +53,15 @@ jobs:
- name: Install Node.js dependencies
if: steps.cache-node.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Prepare the projects
run: yarn nx run-many --all --parallel --target=prepare
- name: Setup Python virtualenvs
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: yarn nx python api
- run: yarn nx affected --target=lint --parallel --max-parallel=3
- run: yarn nx affected --target=build --parallel --max-parallel=3
- run: yarn nx run-many --all --target=test --parallel --max-parallel=2
# - name: Setup Python virtualenvs
# if: steps.cache-pipenv.outputs.cache-hit != 'true'
# run: yarn nx python api
- run: yarn nx affected --target=prepare
- run: yarn nx affected --target=prepare-java --parallel=1
- run: yarn nx affected --target=lint
- run: yarn nx affected --target=build
- run: yarn nx affected --target=test
# - run: yarn nx run-many --all --target=test --parallel --max-parallel=2
- name: Merge coverage reports
run: yarn coverage:merge
- name: Push coverage report to Coveralls
Expand Down Expand Up @@ -88,12 +89,12 @@ jobs:
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Setup pipenv cache
id: cache-pipenv
uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
# - name: Setup pipenv cache
# id: cache-pipenv
# uses: actions/cache@v3
# with:
# path: ~/.local/share/virtualenvs
# key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Setup Maven cache
uses: actions/cache@v3
with:
Expand All @@ -106,11 +107,11 @@ jobs:
- name: Install Node.js dependencies
if: steps.cache-node.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Prepare the projects
run: yarn nx run-many --all --parallel --target=prepare
- name: Setup Python virtualenvs
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: yarn nx python api
- run: yarn nx affected --target=lint --parallel --max-parallel=3
- run: yarn nx affected --target=build --parallel --max-parallel=3
- run: yarn nx affected --target=test --parallel --max-parallel=2
# - name: Setup Python virtualenvs
# if: steps.cache-pipenv.outputs.cache-hit != 'true'
# run: yarn nx python api
- run: yarn nx affected --target=prepare
- run: yarn nx affected --target=prepare-java --parallel=1
- run: yarn nx affected --target=lint
- run: yarn nx affected --target=build
- run: yarn nx affected --target=test
9 changes: 9 additions & 0 deletions apps/challenge-api-gateway/project.json
Expand Up @@ -10,6 +10,15 @@
"cwd": "apps/challenge-api-gateway"
}
},
"prepare-java": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"commands": [
"./mvnw dependency:go-offline -DexcludeGroupIds=org.sagebionetworks.challenge || true"
],
"cwd": "apps/challenge-api-gateway"
}
},
"build": {
"executor": "@nxrocks/nx-spring-boot:build",
"options": {
Expand Down
9 changes: 9 additions & 0 deletions apps/challenge-auth-service/project.json
Expand Up @@ -10,6 +10,15 @@
"cwd": "apps/challenge-auth-service"
}
},
"prepare-java": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"commands": [
"./mvnw dependency:go-offline -DexcludeGroupIds=org.sagebionetworks.challenge || true"
],
"cwd": "apps/challenge-auth-service"
}
},
"build": {
"executor": "@nxrocks/nx-spring-boot:build",
"options": {
Expand Down
9 changes: 9 additions & 0 deletions apps/challenge-config-service/project.json
Expand Up @@ -3,6 +3,15 @@
"sourceRoot": "apps/challenge-config-service/src",
"projectType": "application",
"targets": {
"prepare-java": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"commands": [
"./mvnw dependency:go-offline -DexcludeGroupIds=org.sagebionetworks.challenge || true"
],
"cwd": "apps/challenge-config-service"
}
},
"build": {
"executor": "@nxrocks/nx-spring-boot:build",
"options": {
Expand Down
17 changes: 17 additions & 0 deletions apps/challenge-core-service/pom.xml
Expand Up @@ -102,6 +102,23 @@
</excludes>
</configuration>
</plugin>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>dependency</phase>
<goals>
<goal>go-offline</goal>
</goals>
<configuration>
<excludeGroupIds>org.sagebionetworks.challenge</excludeGroupIds>
<excludeArtifactIds>challenge-util</excludeArtifactIds>
</configuration>
</execution>
</executions>
</plugin> -->
</plugins>
<pluginManagement>
<plugins>
Expand Down
9 changes: 9 additions & 0 deletions apps/challenge-core-service/project.json
Expand Up @@ -10,6 +10,15 @@
"cwd": "apps/challenge-core-service"
}
},
"prepare-java": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"commands": [
"./mvnw dependency:go-offline -DexcludeGroupIds=org.sagebionetworks.challenge || true"
],
"cwd": "apps/challenge-core-service"
}
},
"build": {
"executor": "@nxrocks/nx-spring-boot:build",
"options": {
Expand Down
9 changes: 9 additions & 0 deletions apps/challenge-service-registry/project.json
Expand Up @@ -10,6 +10,15 @@
"cwd": "apps/challenge-service-registry"
}
},
"prepare-java": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"commands": [
"./mvnw dependency:go-offline -DexcludeGroupIds=org.sagebionetworks.challenge || true"
],
"cwd": "apps/challenge-service-registry"
}
},
"build": {
"executor": "@nxrocks/nx-spring-boot:build",
"options": {
Expand Down
9 changes: 9 additions & 0 deletions apps/challenge-user-service/project.json
Expand Up @@ -10,6 +10,15 @@
"cwd": "apps/challenge-user-service"
}
},
"prepare-java": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"commands": [
"./mvnw dependency:go-offline -DexcludeGroupIds=org.sagebionetworks.challenge || true"
],
"cwd": "apps/challenge-user-service"
}
},
"build": {
"executor": "@nxrocks/nx-spring-boot:build",
"options": {
Expand Down
9 changes: 9 additions & 0 deletions libs/shared-java/challenge-util/project.json
Expand Up @@ -3,6 +3,15 @@
"sourceRoot": "libs/shared-java/challenge-util/src",
"projectType": "library",
"targets": {
"prepare-java": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"commands": [
"./mvnw dependency:go-offline -DexcludeGroupIds=org.sagebionetworks.challenge || true"
],
"cwd": "libs/shared-java/challenge-util"
}
},
"build": {
"executor": "@nxrocks/nx-spring-boot:build",
"options": {
Expand Down

0 comments on commit 7142360

Please sign in to comment.