[ 
http://jira.codehaus.org/browse/MANTRUN-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_106663
 ] 

Basil James Whitehouse III commented on MANTRUN-62:
---------------------------------------------------

This seems similar to my experience.  I can't find any documentation or an 
issue that precisely captures my issue, but this entry is the closest.  Adding 
my comment here rather than creating another issue.

I started prototyping delegation to an ant script by writing the ant tasks 
inline with the plugins configuration.  Once that worked I extracted the ant 
code to a separate build.xml and delegated to it using the ant task as 
suggested in the plugin documentation: "...it's encouraged to move all your Ant 
tasks to a build.xml file and just call it from the POM using Ant's <ant/> 
task.".

Wanting to use Maven as the source of configuration I made heavy use of the 
Maven properties (project.build.sourceDirectory, project.build.outputDirectory, 
etc).  The Maven property reference worked fine when I was using the inlined 
task but failed once it was extracted to a build.xml file.  I was hoping that 
the Maven properties would be passed to the ant build transparently, or as long 
as the inhertiAll attribute was true.  It surprised me that they weren't and 
that I'd have to essentially alias each value I needed, causing a lot of extra 
work.

Is it possible to correct this behavior?  Am I just missing something?

> line.separator property not passed properly to ant
> --------------------------------------------------
>
>                 Key: MANTRUN-62
>                 URL: http://jira.codehaus.org/browse/MANTRUN-62
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>         Environment: maven 2.0.4
>            Reporter: Corporate Gadfly
>         Attachments: build.xml, pom.xml
>
>
> line.separator does not resolve properly inside an ant task (using 
> maven-antrun-plugin).
> E.g., using the 2 attached files, running
> {code}ant{code} produces the following output {code}Buildfile: build.xml
> echo:
>      [echo] 
>      [echo] line.separator: --
>      [echo] --
>      [echo] os.name: --Linux--
>      [echo]         
> BUILD SUCCESSFUL
> Total time: 0 seconds{code}
> which is all okay, so far (new line is being shown on the echo line).
> However, when using {code}mvn initialize{code}, we get the following output
> {code}[INFO] Scanning for projects...
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Building Maven Echo
> [INFO]    task-segment: [initialize]
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] [antrun:run {execution: echo-no-properties}]
> [INFO] Executing tasks
> echo:
>      [echo] 
>      [echo] line.separator: --${line.separator}--
>      [echo] os.name: --${os.name}--
>      [echo]         
> [INFO] Executed tasks
> [INFO] [antrun:run {execution: echo-with-properties}]
> [INFO] Executing tasks
> echo:
>      [echo] 
>      [echo] line.separator: -- --
>      [echo] os.name: --Linux--
>      [echo]         
> [INFO] Executed tasks
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 1 second
> [INFO] Finished at: Tue Nov 21 15:26:55 EST 2006
> [INFO] Final Memory: 3M/508M
> [INFO] 
> ------------------------------------------------------------------------ 
> {code}
> I have two questions:
> # Why do I have to specify all the properties one-by-one while calling the 
> target?
> # Why is the output for line.separator not what is expected?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to