diff --git a/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/transport/RemoteArtifactRepositoryManagerAgentFactory.java b/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/transport/RemoteArtifactRepositoryManagerAgentFactory.java index c936a1669c..0a365f4971 100644 --- a/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/transport/RemoteArtifactRepositoryManagerAgentFactory.java +++ b/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/transport/RemoteArtifactRepositoryManagerAgentFactory.java @@ -20,6 +20,7 @@ import org.eclipse.equinox.p2.core.spi.IAgentServiceFactory; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager; import org.eclipse.tycho.IRepositoryIdManager; +import org.eclipse.tycho.core.shared.MavenContext; @Component(role = IAgentServiceFactory.class, hint = "org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager") public class RemoteArtifactRepositoryManagerAgentFactory implements IAgentServiceFactory { @@ -33,6 +34,9 @@ public class RemoteArtifactRepositoryManagerAgentFactory implements IAgentServic @Requirement MavenAuthenticator authenticator; + @Requirement + MavenContext mavenContext; + @Override public Object createService(IProvisioningAgent agent) { IArtifactRepositoryManager plainRepoManager = (IArtifactRepositoryManager) new ArtifactRepositoryComponent() @@ -48,6 +52,10 @@ private boolean getDisableP2MirrorsConfiguration() { String key = "tycho.disableP2Mirrors"; String value = System.getProperty(key); + if (value == null) { + value = mavenContext.getSessionProperties().getProperty(key); + } + boolean disableP2Mirrors = Boolean.parseBoolean(value); if (disableP2Mirrors && logger.isDebugEnabled()) { String message = key + "=" + value + " -> ignoring mirrors specified in p2 artifact repositories";