ARTEMIS-4131 Support custom maven local repo for karaf tests

This commit is contained in:
Domenico Francesco Bruscino 2023-01-19 08:44:58 +01:00 committed by Bruscino Domenico Francesco
parent dabf538f06
commit b1207b9a56
2 changed files with 9 additions and 0 deletions

View File

@ -23,7 +23,9 @@ import org.ops4j.pax.exam.options.DefaultCompositeOption;
import java.io.File;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.when;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
@ -43,6 +45,10 @@ public enum PaxExamOptions {
.unpackDirectory(new File("target/paxexam/unpack/")),
keepRuntimeFolder(),
configureConsole().ignoreLocalConsole(),
when(System.getProperty("maven.repo.local") != null).useOptions(
editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg",
"org.ops4j.pax.url.mvn.localRepository",
System.getProperty("maven.repo.local"))),
logLevel(LogLevelOption.LogLevel.INFO)
),
ARTEMIS_CORE_CLIENT(

View File

@ -68,6 +68,7 @@ import org.osgi.util.tracker.ServiceTracker;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.when;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
@ -119,6 +120,8 @@ public class ArtemisFeatureTest extends Assert {
editConfigurationFilePut("etc/users.properties", USER, PASSWORD + ",manager"),
// [KARAF-6600] Use https URL for Maven Central
editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories", "https://repo1.maven.org/maven2@id=central, https://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases"),
when(System.getProperty("maven.repo.local") != null).useOptions(
editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.localRepository", System.getProperty("maven.repo.local"))),
// uncomment this to debug it.
// debugConfiguration("5005", true),
features(getArtemisMQKarafFeatureUrl(), f.toArray(new String[f.size()]))};