You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/08/17 16:02:44 UTC
(maven-doxia-sitetools) branch master updated: Let an offline build skip the tests that need a repository
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-sitetools.git
The following commit(s) were added to refs/heads/master by this push:
new b737ace Let an offline build skip the tests that need a repository
b737ace is described below
commit b737ace15796e7e925212df5f739e039667bf387
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sun Aug 16 22:39:24 2026 +0200
Let an offline build skip the tests that need a repository
SiteToolTest resolves the Fluido skin and parent site descriptors from Central.
It assembles its own RepositorySystemSession, so Maven's offline setting never
reaches it: running mvn -o still went to the network and still populated
target/local-repo. An offline build therefore could not pass.
The build now hands the setting to the test JVM and the class stands aside when
it is set. This goes through argLine rather than systemPropertyVariables,
because that map takes Strings and settings.offline interpolates as a Boolean.
Verified: online, 11 tests run and none are skipped; with -o, all 11 skip and
nothing is written to target/local-repo
---
doxia-integration-tools/pom.xml | 15 +++++++++++++++
.../java/org/apache/maven/doxia/tools/SiteToolTest.java | 14 ++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/doxia-integration-tools/pom.xml b/doxia-integration-tools/pom.xml
index b195b62..41f5c52 100644
--- a/doxia-integration-tools/pom.xml
+++ b/doxia-integration-tools/pom.xml
@@ -167,6 +167,21 @@
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- SiteToolTest builds its own repository session, which never sees this otherwise.
+ Passed on the command line because systemPropertyVariables takes Strings only, and
+ settings.offline interpolates as a Boolean. -->
+ <argLine>-Ddoxia.test.offline=${settings.offline}</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
<reporting>
<plugins>
<plugin>
diff --git a/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java b/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
index f33b019..de8de1d 100644
--- a/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
+++ b/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
@@ -51,6 +51,7 @@ import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
import org.eclipse.aether.repository.LocalRepository;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.codehaus.plexus.testing.PlexusExtension.getTestFile;
@@ -61,6 +62,7 @@ import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assumptions.assumeFalse;
/**
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
@@ -72,6 +74,18 @@ class SiteToolTest {
@Inject
private DefaultSiteTool tool;
+ /**
+ * These tests resolve the skin and parent site descriptors from Central. The session below is
+ * built by hand, so it never sees Maven's own offline setting; the build passes it in as a system
+ * property and the tests stand aside when it is set.
+ */
+ @BeforeEach
+ void requireNetwork() {
+ assumeFalse(
+ Boolean.getBoolean("doxia.test.offline"),
+ "resolves the skin and site descriptors from a remote repository");
+ }
+
/**
* @return the local repo directory.
*