-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Odd,

I ran this on a Linux system and I copy / pasted the output.

Please copy / paste my pom.xml (change the groupId / artifactId), and
see what happens.

There seems to be something odd going on in your environment, since
the pom.xml, output, and Maven versions were all copied directly from
my Fedora 20 laptop.

What version of Linux / bash are you using?

Linux trident.mdeggers.org 3.17.3-200.fc20.x86_64 #1 SMP Fri Nov 14
19:45:42 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

bash-completion-2.1-3.fc20.noarch
bash-4.2.53-1.fc20.x86_64

. . . puzzled
/mde/

On 11/25/2014 12:31 PM, Gribnau, Phillip wrote:
> Thanks Mark for the suggestion. Unfortunately it still treats
> 'arg2' as a unknown lifecycle phase.
> 
> I also tried saving the value as a system variable first, then
> passing it into maven's command. This still fails with the unknown
> lifecycle phase issue: export zzz='arg1 arg2' mvn clean install
> -DmavenArgLine=$zzz
> 
> I could export the value as a system variable first, then use it
> within a pom.xml instead of setting it in the command line, but I'm
> still curious why maven interprets this different in unix compared
> to windows.
> 
> 
> -----Original Message----- From: Mark Eggers
> [mailto:its_toas...@yahoo.com.INVALID] Sent: Tuesday, November 25,
> 2014 11:52 AM To: Maven Users List Subject: Re: Linux Command Line
> System Property Issue
> 
> Phillip,
> 
> Try single quotes. Double quotes in bash allow special characters
> (including spaces) to be interpreted by the shell. Single quotes
> prevent the shell from being interpreted.
> 
> mvn package -DmavenArgLine='arg1 arg2'
> 
> Partial results:
> 
> [INFO] --- maven-antrun-plugin:1.7:run (echo) @ FooLine --- [INFO]
> Executing tasks
> 
> echo: [echo] arg1 arg2
> 
> My pom.xml (sorry for the line wrapping):
> 
> <?xml version="1.0" encoding="UTF-8"?> <project
> xmlns="http://maven.apache.org/POM/4.0.0"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/xsd/maven-4.0.0.xsd";> 
> <modelVersion>4.0.0</modelVersion> <groupId>org.mdeggers</groupId> 
> <artifactId>FooLine</artifactId> <version>1.0-SNAPSHOT</version> 
> <packaging>jar</packaging> <properties> 
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
> <maven.compiler.source>1.7</maven.compiler.source> 
> <maven.compiler.target>1.7</maven.compiler.target> </properties> 
> <build> <plugins> <plugin> 
> <groupId>org.apache.maven.plugins</groupId> 
> <artifactId>maven-antrun-plugin</artifactId> 
> <version>1.7</version> <executions> <execution> <id>echo</id> 
> <phase>generate-sources</phase> <goals> <goal>run</goal> </goals> 
> </execution> </executions> <configuration> <target name="echo"> 
> <echo>${mavenArgLine}</echo> </target> </configuration> </plugin> 
> </plugins> </build> </project>
> 
> My maven version (on Fedora 20, 64 bit - sorry for the line
> wrapping):
> 
> Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 
> 2014-08-11T13:58:10-07:00) Maven home: /opt/Apache/maven Java
> version: 1.7.0_72, vendor: Oracle Corporation Java home:
> /opt/Sun/jdk1.7.0_72/jre Default locale: en_US, platform encoding:
> UTF-8 OS name: "linux", version: "3.17.3-200.fc20.x86_64", arch:
> "amd64", family: "unix"
> 
> . . . just my two cents /mde/
> 
> On 11/25/2014 11:29 AM, Gribnau, Phillip wrote:
>> Hi,
> 
>> Thanks for the suggestion. I tried it but it doesn't work. For
>> some reason on linux it tries to process the second argument as a
>> lifecycle phase. I am using v3.2.1 btw.
> 
>> mvn clean install "-DmavenArgLine=arg1 arg2" -e 2>&1
> 
>> [ERROR] Unknown lifecycle phase "arg2". You must specify a valid
>>  lifecycle phase or a goal in the format <plugin-prefix>:<goal>
>> or 
>> <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>.
>>
>> 
Available lifecycle phases are: validate, initialize,
>> generate-sources, process-sources, generate-resources, 
>> process-resources, compile, process-classes,
>> generate-test-sources, process-test-sources,
>> generate-test-resources, process-test-resources, test-compile,
>> process-test-classes, test, prepare-package, package, 
>> pre-integration-test, integration-test, post-integration-test,
>> verify, install, deploy, pre-site, site, post-site, site-deploy,
>> pre-clean, clean, post-clean. -> [Help 1]
> 
>> -----Original Message----- From: Adrien Rivard 
>> [mailto:adrien.riv...@gmail.com] Sent: Tuesday, November 25,
>> 2014 1:33 AM To: Maven Users List Subject: Re: Linux Command Line
>> System Property Issue
> 
>> Hi,
> 
>> Maybe try "-DmavenArgLine=arg1 arg2" It works on plain java but
>> can''t think of a way to test it quickly with maven.
> 
> 
>> On Tue, Nov 25, 2014 at 2:21 AM, Gribnau, Phillip 
>> <pgrib...@informatica.com> wrote:
> 
>>> Hi Everyone,
>>> 
>>> I am having trouble passing in a value via the command line on
>>> bash in linux, but I have it working correctly on windows.
>>> 
>>> On the command line, if I pass in the following: 
>>> -DmavenArgLine="arg1 arg2"
>>> 
>>> The error on linux is: Unknown lifecycle phase "arg2" Windows
>>> is able to interpret this correctly and show "arg1 arg2" in the
>>> output, verified by using the following plugin:
>>> 
>>> <plugin> <artifactId>maven-antrun-plugin</artifactId> 
>>> <version>1.7</version> <executions> <execution> 
>>> <phase>generate-sources</phase> <configuration> <tasks> 
>>> <echo>${mavenArgLine}</echo> </tasks> </configuration> <goals>
>>>  <goal>run</goal> </goals> </execution> </executions>
>>> </plugin>
>>> 
>>> 
>>> My need is that the value of mavenArgLine has to be given from
>>> the command line as the value can differ from different
>>> environments. Is there a way to pass in the value of
>>> mavenArgLine in linux with spaces?
>>> 
>>> 
>>> Thanks, Phillip
>>> 
>>> 
> 
> 
>> -- Adrien Rivard
> 
>> ---------------------------------------------------------------------
>
>> 
> 
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> For additional commands, e-mail: users-h...@maven.apache.org
> 
> 
> 
> --- This email is free from viruses and malware because avast!
> Antivirus protection is active. http://www.avast.com
> 
> 
> ---------------------------------------------------------------------
>
> 
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 
> 
> ---------------------------------------------------------------------
>
> 
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJUdPdbAAoJEEFGbsYNeTwt5r8H/iEtmi6l1QB6l71pSYE+5bRP
cko6eCYmt/mjAEcFsWrOU2dk2q+8+kvjx1ZJjXtYKCoBaV5HsWFHuGd2PR0Flx09
zYRCn0MdjdSeLk4GTgXYy1MVuXkmyMJQ/D2pnvzSg/me+KxcSOFt0gyuszFqmaL9
cKJlfuoo9nI8oeDvVro2kqI++YPMsMV3zH5RvWugs5O/KNhpXMFwvcGOultTgxcz
D6cNWH7DZRECVLS6tf00Eo1BOJisuXreEbNtvVmWJoC1PBs7Zq3ZZqAvo4ca+Nst
q/0aohUhRZy5dZ0yMZJBXUv+0+dVg45tzqc3Fu6fqq31Pf2DUNtfaUB8d8bR1Co=
=9Fxv
-----END PGP SIGNATURE-----

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to