From 5fb424c43ae38bad86b18841954337af791b6685 Mon Sep 17 00:00:00 2001 From: cpovirk Date: Fri, 4 Sep 2026 13:07:49 -0700 Subject: [PATCH] Make it possible to run `./mvnw package` instead of `./mvnw install`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This [just came up again](https://github.com/google/guava/issues/8650#issuecomment-5510207112). It is a better solution to https://github.com/google/guava/issues/2193 than https://github.com/google/guava/pull/8127 was. (I think it makes sense for `gradle_integration_tests.sh` to continue using `install` so that the Maven-produced artifacts become visible to Gradle. But I haven't tested.) Sadly, it's still not enough for `mvn compile` to work: ``` [ERROR] Failed to execute goal on project guava-gwt: Could not resolve dependencies for project com.google.guava:guava-gwt:jar:999.0.0-HEAD-jre-SNAPSHOT [ERROR] dependency: com.google.guava:guava-testlib:jar:tests:999.0.0-HEAD-jre-SNAPSHOT (test) [ERROR] Could not find artifact com.google.guava:guava-testlib:jar:tests:999.0.0-HEAD-jre-SNAPSHOT [ERROR] dependency: com.google.guava:guava-tests:jar:tests:999.0.0-HEAD-jre-SNAPSHOT (test) [ERROR] Could not find artifact com.google.guava:guava-tests:jar:tests:999.0.0-HEAD-jre-SNAPSHOT ``` (For all testing of such changes, it's necessary to delete/move `~/.m2/repository/com/google/guava` so that Maven doesn't just read from previous builds that are installed there—thanks to our habit of using `mvn install` instead of `mvn package`!) RELNOTES=n/a PiperOrigin-RevId: 976459357 --- CONTRIBUTING.md | 4 ++-- android/guava-testlib/pom.xml | 3 +-- android/guava-tests/pom.xml | 3 +-- guava-testlib/pom.xml | 3 +-- guava-tests/pom.xml | 3 +-- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1759941d43c5..1581ef253906 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,7 +90,7 @@ again. The most reliable way to build and test Guava is: ```shell -./mvnw clean install +./mvnw clean package ``` If you want to run a single test, you'll need to pass multiple flags because @@ -98,7 +98,7 @@ Guava is a multi-module project. For performance reasons, you may also wish to skip generating Javadoc. For example: ```shell -./mvnw clean install -Dtest=FinalizableReferenceQueueTest -DfailIfNoTests=false -Dmaven.javadoc.skip +./mvnw clean package -Dtest=FinalizableReferenceQueueTest -DfailIfNoTests=false -Dmaven.javadoc.skip ``` (Our benchmarks, however, are diff --git a/android/guava-testlib/pom.xml b/android/guava-testlib/pom.xml index 1be0efc43896..cb7b6a0152ec 100644 --- a/android/guava-testlib/pom.xml +++ b/android/guava-testlib/pom.xml @@ -122,8 +122,7 @@ attach-test-sources - post-integration-test - test-jar + test-jar-no-fork diff --git a/android/guava-tests/pom.xml b/android/guava-tests/pom.xml index c27f7a525922..fd788b9fe3c1 100644 --- a/android/guava-tests/pom.xml +++ b/android/guava-tests/pom.xml @@ -91,8 +91,7 @@ attach-test-sources - post-integration-test - test-jar + test-jar-no-fork diff --git a/guava-testlib/pom.xml b/guava-testlib/pom.xml index d4936603f3e2..5f63de118cad 100644 --- a/guava-testlib/pom.xml +++ b/guava-testlib/pom.xml @@ -122,8 +122,7 @@ attach-test-sources - post-integration-test - test-jar + test-jar-no-fork diff --git a/guava-tests/pom.xml b/guava-tests/pom.xml index f44f6ad0b59d..e4f851a6daab 100644 --- a/guava-tests/pom.xml +++ b/guava-tests/pom.xml @@ -91,8 +91,7 @@ attach-test-sources - post-integration-test - test-jar + test-jar-no-fork