Skip to content

Commit

Permalink
Install jar to a local repo properly rather than copying it hackily.
Browse files Browse the repository at this point in the history
  • Loading branch information
kirkrodrigues committed Jul 22, 2024
1 parent 1f3704a commit 171ca70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
13 changes: 8 additions & 5 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ tasks:
- task: "integration-tests"

integration-tests:
deps: ["package"]
vars:
MAVEN_REPO_DIR: "{{.G_BUILD_DIR}}/repo/com/yscope/clp/clp-ffi/{{.G_PROJECT_VERSION}}"
env:
# Use a local directory for the Maven repo so that we can install the jar (for the integration
# tests to use) without affecting the user's environment.
# NOTE: Maven doesn't strip quotes around the value, but treats everything on the right hand
# side of the equals sign as the value; so we don't need to quote the path.
MAVEN_OPTS: "-Dmaven.repo.local={{.G_BUILD_DIR}}/repo"
cmds:
- "mkdir -p '{{.MAVEN_REPO_DIR}}'"
- "cp '{{.G_BUILD_DIR}}/clp-ffi-{{.G_PROJECT_VERSION}}.jar' '{{.MAVEN_REPO_DIR}}'"
# NOTE: Since we're using a custom repo-directory, this will end up rebuilding the package.
- "mvn install -DskipTests"
- |-
cd "integration-tests/jar-load-native-lib"
mvn compile
Expand Down
8 changes: 0 additions & 8 deletions integration-tests/jar-load-native-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<repositories>
<repository>
<id>local</id>
<name>local</name>
<url>file://${project.basedir}/../../target/repo</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.yscope.clp</groupId>
Expand Down

0 comments on commit 171ca70

Please sign in to comment.