Skip to content

Commit

Permalink
Specify a localRepositoryPath for integration tests.
Browse files Browse the repository at this point in the history
The upgrade to version 3.5.0 of `maven-invoker-plugin` caused this project to fail, with the message here:
```
Failed to execute goal org.apache.maven.plugins:maven-invoker-plugin:3.5.0:install (integration-test) on project auto-value: Failed to install artifact com.google.auto:auto-common:jar:1.2.1: cannot install /home/runner/.m2/repository/com/google/auto/auto-common/1.2.1/auto-common-1.2.1.jar to same path -> [Help 1]
```

Setting `localRepositoryPath` fixes this.

I believe the change in behaviour was caused by [this PR](apache/maven-invoker-plugin#174), which may have broken other projects similarly. But it has always been [recommended](https://maven.apache.org/plugins/maven-invoker-plugin/integration-test-mojo.html#localRepositoryPath) to use a non-default `localRepositoryPath` anyway.

RELNOTES=n/a
PiperOrigin-RevId: 510177767
  • Loading branch information
eamonnmcmanus authored and Google Java Core Libraries committed Feb 16, 2023
1 parent 01f2004 commit 56764c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions factory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
<configuration>
<addTestClassPath>true</addTestClassPath>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
<pomIncludes>
<pomInclude>*/pom.xml</pomInclude>
</pomIncludes>
Expand Down
1 change: 1 addition & 0 deletions value/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
<configuration>
<addTestClassPath>true</addTestClassPath>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
<pomIncludes>
<pomInclude>*/pom.xml</pomInclude>
</pomIncludes>
Expand Down

0 comments on commit 56764c4

Please sign in to comment.