Skip to content

Commit

Permalink
HSEARCH-3805 Override repositories in Karaf/Paxexam config
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Jan 17, 2020
1 parent 6f1eaa4 commit 5d921f2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions legacy/integrationtest/osgi/karaf-it/pom.xml
Expand Up @@ -174,6 +174,7 @@
<systemPropertyVariables>
<maven.settings.localRepository>${settings.localRepository}</maven.settings.localRepository>
<maven.jboss.public.repo.url>${jboss.public.repo.url}</maven.jboss.public.repo.url>
<maven.mavencentral.repo.url>${mavencentral.repo.url}</maven.mavencentral.repo.url>
<pax-exam.jvm.args>${pax-exam.jvm.args}</pax-exam.jvm.args>
</systemPropertyVariables>
</configuration>
Expand Down
Expand Up @@ -11,7 +11,6 @@
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFileExtend;
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;
Expand Down Expand Up @@ -136,6 +135,7 @@ public Option[] config() throws IOException {

String mavenLocalRepository = System.getProperty( "maven.settings.localRepository" );
String jbossPublicRepository = System.getProperty( "maven.jboss.public.repo.url" );
String mavenCentralRepository = System.getProperty( "maven.mavencentral.repo.url" );
String[] vmArgsFromProperties =
Arrays.stream(
System.getProperty( "pax-exam.jvm.args", "" ).split( "\\s" )
Expand Down Expand Up @@ -213,10 +213,13 @@ public Option[] config() throws IOException {
"org.ops4j.pax.url.mvn.localRepository",
mavenLocalRepository
),
editConfigurationFileExtend( // Extend, not put: we want to keep the defaults (Maven Central in particular)
editConfigurationFilePut( // Erase the defaults: Maven Central uses HTTP by default...
"etc/org.ops4j.pax.url.mvn.cfg",
"org.ops4j.pax.url.mvn.repositories",
jbossPublicRepository
mavenCentralRepository
+ "@id=central"
+ ", "
+ jbossPublicRepository
+ "@snapshots" // Include snapshots, useful when experimenting with new ORM versions
+ "@noreleases" // Exclude releases as we expect all releases to be available on central
+ "@id=jboss-public-repository"
Expand Down
4 changes: 4 additions & 0 deletions pom.xml
Expand Up @@ -309,6 +309,10 @@
<jboss.public.repo.id>jboss-public-repository-group</jboss.public.repo.id>
<jboss.public.repo.url>https://repository.jboss.org/nexus/content/groups/public-jboss/</jboss.public.repo.url>

<!-- Maven Central repository -->

<mavencentral.repo.url>https://repo.maven.apache.org/maven2/</mavencentral.repo.url>

<!-- Eclipse repository (for the ECJ compiler, disabled by default) -->

<eclipse.repo.id>eclipse-staging</eclipse.repo.id>
Expand Down

0 comments on commit 5d921f2

Please sign in to comment.