[ 
https://issues.apache.org/jira/browse/SCM-386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17964555#comment-17964555
 ] 

Olivier Lamy commented on SCM-386:
----------------------------------

This project has moved from Jira to GitHub Issues. This issue was migrated to 
[apache/maven-scm#608|https://github.com/apache/maven-scm/issues/608]. 

> SCM plugin fails on "bootstrap" goal when shell environment has functions 
> definitions
> -------------------------------------------------------------------------------------
>
>                 Key: SCM-386
>                 URL: https://issues.apache.org/jira/browse/SCM-386
>             Project: Maven SCM (Moved to GitHub Issues)
>          Issue Type: Bug
>          Components: maven-plugin
>            Reporter: Leonid Ilyevsky
>            Assignee: Siveton Vincent
>            Priority: Major
>             Fix For: 1.1
>
>
> When using scm:bootstrap, with goals to do after checkout:
>         mvn -Dgoals=compile scm:bootstrap
> maven apparently spawns another process that will execute mvn command for 
> that goal. To set up the environment for the child process, it runs external 
> command (in case of Linux it is "env"), and tries to parse it, assuming that 
> every line of the output has "KEY=VALUE" format. However, when the 
> environment has shell functions in it, this logic fails.
> I see two ways of fixing this.
> 1. Just fix the parsing logic. 
> Pros: this will be compatible with everything it is compatible today. 
> Cons: parsing logic will be essentially more complex, because you need to 
> figure out multiline functions definitions.
> 2. Use System.getEnv() to get the environment, make array of strings 
> containing "KEY=VALUE" expressions, and use it for the child process.
> Pros: very clean and simple solution. I actually tested it, took 10 minutes 
> to do.
> Cons: System.getEnv() became available as of JDK 1.5. Seems like all Maven2 
> is supposed to be compatible with JDK 1.4, this might be a problem.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to