diff --git a/pom.xml b/pom.xml
index 751c3ac..7a007e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,7 +62,16 @@
-
-
-
-
+
+
+ repo.jenkins-ci.org
+ http://repo.jenkins-ci.org/public/
+
+
+
+
+ repo.jenkins-ci.org
+ http://repo.jenkins-ci.org/public/
+
+
+
\ No newline at end of file
diff --git a/src/main/java/org/jenkinsci/plugins/sharedobjects/SharedObjectJobProperty.java b/src/main/java/org/jenkinsci/plugins/sharedobjects/SharedObjectJobProperty.java
index 4a34e4d..3a43b35 100644
--- a/src/main/java/org/jenkinsci/plugins/sharedobjects/SharedObjectJobProperty.java
+++ b/src/main/java/org/jenkinsci/plugins/sharedobjects/SharedObjectJobProperty.java
@@ -78,8 +78,12 @@ public SharedObjectType[] call() throws EnvInjectException {
restrictionActivated = false;
}
+ // find out if profile name is a job argument
+ Map envVars = build.getEnvironment(listener);
+ String real_profile = Util.replaceMacro(profiles, envVars);
+
if (restrictionActivated) {
- logger.info(String.format("Restricting shared objects to the following usage %s", profiles));
+ logger.info(String.format("Restricting shared objects to the following usage %s", real_profile));
}
for (SharedObjectType type : sharedObjectTypes) {
@@ -88,7 +92,7 @@ public SharedObjectType[] call() throws EnvInjectException {
addSharedObject(result, type, build, logger);
continue;
}
- if (restrictionActivated && isProfileActivated(profiles, type)) {
+ if (restrictionActivated && isProfileActivated(real_profile, type)) {
addSharedObject(result, type, build, logger);
continue;
}