[repository-connector-plugin] How to reuse Maven Repository Artifact Build Parameter in execute shell build step

367 views
Skip to first unread message

Sandra Parsick

unread,
Mar 20, 2015, 4:27:16 AM3/20/15
to jenkins...@googlegroups.com
Hi,

I use the repository connector plugin for downloading Maven artifact from the repository directly. I configure a parameterized build for choosing the version of the artifact. I can access the parameter (${groupid.artifactid}, groupid and artifactid are placeholder for the real Maven coordinates) in the artifact resolver build step. After this build step I'd like to run a execute shell build step that uses the same parameter. I try to access the parameter like the other build parameter described on the wiki page "Parameterized Build" (https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build). But I get error "/tmp/tomcat7-tomcat7-tmp/hudson4994980513233865127.sh: 4: /tmp/tomcat7-tomcat7-tmp/hudson4994980513233865127.sh: Bad substitution" after the job tries running the shell build step. In my opinion the build parameter "groupid.artifactid" should be available in the shell, because calling "env" in shell step shows this parameter. Do I anything wrong?

Thanks and best regards,

Sandra

Sandra Parsick

unread,
Mar 23, 2015, 12:35:10 PM3/23/15
to jenkins...@googlegroups.com
I figured the problem out. The problem is that in the bash shell variable names with dot aren't valid. It exists a workaround (see http://stackoverflow.com/a/17755462/1015084) for that.  But I think it would be better if the variable name in the repository connector plugin would be configurable, so such workaround aren't necessary.

What do you think about it?

Best regards,

Sandra
Reply all
Reply to author
Forward
0 new messages