Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2015-05-18 04:33:46 -0400
committerGerrit Code Review @ Eclipse.org2015-05-26 02:19:51 -0400
commit76391c4f6cbcb666443b83d2f447b52edc0e5732 (patch)
treefaba7f0ccec808d95dc82b45c232da91277ba6b8
parentd86f366ce8f9fc7e3f49d4e142fed51526837c74 (diff)
downloadorg.eclipse.tycho-76391c4f6cbcb666443b83d2f447b52edc0e5732.tar.gz
org.eclipse.tycho-76391c4f6cbcb666443b83d2f447b52edc0e5732.tar.xz
org.eclipse.tycho-76391c4f6cbcb666443b83d2f447b52edc0e5732.zip
467418 Setting the "p2.userAgent" system property
The tycho version is set for the p2 user agent system property (key: "p2.userAgent", value: "<someP2GeneratedPrefix> tycho/<tychoversion>") Bug: 467418 Change-Id: Ib5bb203d5c142c13808e6c42420b2c612bb914bd Signed-off-by: Martin Schreiber <m.schreiber@bachmann.info> Signed-off-by: Pascal Rapicault <pascal@rapicorp.com>
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
index 7b83a9cb4..b00c3443e 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
@@ -36,6 +36,7 @@ import org.eclipse.tycho.core.osgitools.BundleReader;
import org.eclipse.tycho.core.osgitools.DefaultBundleReader;
import org.eclipse.tycho.core.osgitools.DefaultReactorProject;
import org.eclipse.tycho.core.shared.BuildFailureException;
+import org.eclipse.tycho.core.utils.TychoVersion;
import org.eclipse.tycho.resolver.TychoResolver;
@Component(role = AbstractMavenLifecycleParticipant.class, hint = "TychoMavenLifecycleListener")
@@ -46,6 +47,8 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
"tycho-p2-director-plugin", "tycho-p2-plugin", "tycho-p2-publisher-plugin", "tycho-p2-repository-plugin",
"tycho-packaging-plugin", "tycho-pomgenerator-plugin", "tycho-source-plugin", "tycho-surefire-plugin",
"tycho-versions-plugin"));
+ private static final String P2_USER_AGENT_KEY = "p2.userAgent";
+ private static final String P2_USER_AGENT_VALUE = "tycho/";
@Requirement
private BundleReader bundleReader;
@@ -76,6 +79,11 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
}
List<MavenProject> projects = session.getProjects();
validate(projects);
+
+ // setting this system property to let EF figure out where the traffic
+ // is coming from (#467418)
+ System.setProperty(P2_USER_AGENT_KEY, P2_USER_AGENT_VALUE + TychoVersion.getTychoVersion());
+
configureComponents(session);
for (MavenProject project : projects) {

Back to the top