Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 215D3108E6 for ; Mon, 12 Aug 2013 10:04:10 +0000 (UTC) Received: (qmail 90366 invoked by uid 500); 12 Aug 2013 10:04:07 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 90302 invoked by uid 500); 12 Aug 2013 10:04:07 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 90294 invoked by uid 99); 12 Aug 2013 10:04:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Aug 2013 10:04:07 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,SPF_NEUTRAL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: encountered temporary error during SPF processing of domain of thermaleagle@gmail.com) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Aug 2013 10:04:00 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1V8oy8-0000tO-1F for users@maven.apache.org; Mon, 12 Aug 2013 03:03:20 -0700 Date: Mon, 12 Aug 2013 03:03:20 -0700 (PDT) From: thermaleagle To: users@maven.apache.org Message-ID: In-Reply-To: References: <1376297040974-5767482.post@n5.nabble.com> Subject: Re: How to pass the contents of a file as the value of a command-line parameter when invoking a maven goal MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_109165_3928765.1376301800033" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_109165_3928765.1376301800033 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit That's a great idea Robert! Will keep it as reference. However, unable to implement it since I don't manage the build server and touching settings. Xml will throw me in a series of approvals across a huge team of stakeholders that will take more than the available time. On 12 Aug 2013 15:17, "Robert Scholte-4 [via Maven]" < ml-node+s40175n5767489h70@n5.nabble.com> wrote: > Hi, > > This is how we solved this problem: > On the Jenkins buildserver we added the following to our settings.xml > > > > jenkins > > 600${EXECUTOR_NUMBER} > > > > > > jenkins > > > This assumes a maximum of 10 executors on the buildserver. > Now you don't have to specify the port on the commandline, it'll be picked > > up from these settings. > > I'm not sure anymore if we had to expose these JENKINS variables and if it > > had to be prefixed with "env.", but this should be enough info to solve > your problem. > > Robert > > Op Mon, 12 Aug 2013 10:44:00 +0200 schreef thermaleagle > <[hidden email] >: > > > Hi, > > I need to pass the contents of a file as the value of a command-line > > parameter when invoking a maven goal. > > > > Why? > > The maven goal I am calling would trigger a server process on a certain > > port. This goal will be setup in a Jenkins build as a continuous > > integration > > test job. And there could be more than one such jenkins job. So I want > to > > ensure that each server process starts on a different port. > > I have scanned for an available port in a "pre-build" step and have > > written > > the identified port to a file port.txt and have ensured that it is > > available > > in the Jenkins job's workspace before the Maven build is triggered. > > > > What I want to do now is specify a maven goal like below within the > > Jenkins > > job I'm writing: > > integration-test clean install -Dport=$( > > > Assuming that port.txt only contains a string like "6001", the above > > command > > should (at runtime) become: > > integration-test clean install -Dport=6001 > > > > And when the job runs, a client should connect a url constructed as > > below: > > http://localhost:6001/web_service/myapp > > > > Note that the port in the above URL is taken from incoming command-line > > parameter 'port'. > > > > However, when I configured this into Jenkins, the job failed with the > > stacktrace containg the below: > > Caused by: java.net.URISyntaxException: Illegal character in authority > at > > index 7: http://localhost:$( > > > > I am executing the job on Linux and have verified that $(<..) is > > supported > > on the version of the shell that I am running. So I think replacing > > $( > The problem seems to be lying in the way I'm using the maven > > command-line. > > Looks like the shell is passing everything it sees on the command-line > to > > Maven which has no clue how to handle it! > > > > Hope I made the problem clear. All help is appreciated. > > > > > > > > -- > > View this message in context: > > > http://maven.40175.n5.nabble.com/How-to-pass-the-contents-of-a-file-as-the-value-of-a-command-line-parameter-when-invoking-a-maven-gol-tp5767482.html > > Sent from the Maven - Users mailing list archive at Nabble.com. > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [hidden email] > > For additional commands, e-mail: [hidden email] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://maven.40175.n5.nabble.com/How-to-pass-the-contents-of-a-file-as-the-value-of-a-command-line-parameter-when-invoking-a-maven-gol-tp5767482p5767489.html > To unsubscribe from How to pass the contents of a file as the value of a > command-line parameter when invoking a maven goal, click here > . > NAML > -- View this message in context: http://maven.40175.n5.nabble.com/How-to-pass-the-contents-of-a-file-as-the-value-of-a-command-line-parameter-when-invoking-a-maven-gol-tp5767482p5767491.html Sent from the Maven - Users mailing list archive at Nabble.com. ------=_Part_109165_3928765.1376301800033--