You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jason van Zyl <jv...@sonatype.com> on 2009/05/15 06:09:58 UTC

Re: svn commit: r774925 - /maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java

Can we move this out of here and do in some other part of the  
configuration processing? I would like to try and remove this  
signature from Plexus for 1.0, it was added specifically for Maven and  
I think we can process it when we process the configuration elsewhere.

On 14-May-09, at 5:02 PM, bentmann@apache.org wrote:

> Author: bentmann
> Date: Thu May 14 21:02:10 2009
> New Revision: 774925
>
> URL: http://svn.apache.org/viewvc?rev=774925&view=rev
> Log:
> o Restored basedir alignment
>
> Modified:
>    maven/components/branches/MNG-2766/maven-core/src/main/java/org/ 
> apache/maven/plugin/PluginParameterExpressionEvaluator.java
>
> Modified: maven/components/branches/MNG-2766/maven-core/src/main/ 
> java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
> URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java?rev=774925&r1=774924&r2=774925&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- maven/components/branches/MNG-2766/maven-core/src/main/java/org/ 
> apache/maven/plugin/PluginParameterExpressionEvaluator.java (original)
> +++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/ 
> apache/maven/plugin/PluginParameterExpressionEvaluator.java Thu May  
> 14 21:02:10 2009
> @@ -344,6 +344,26 @@
>
>     public File alignToBaseDirectory( File file )
>     {
> +        // TODO: Copied from the DefaultInterpolator. We likely  
> want to resurrect the PathTranslator or at least a
> +        // similar component for re-usage
> +        if ( file != null )
> +        {
> +            if ( file.isAbsolute() )
> +            {
> +                // path was already absolute, just normalize file  
> separator and we're done
> +            }
> +            else if ( file.getPath().startsWith( File.separator ) )
> +            {
> +                // drive-relative Windows path, don't align with  
> project directory but with drive root
> +                file = file.getAbsoluteFile();
> +            }
> +            else
> +            {
> +                // an ordinary relative path, align with project  
> directory
> +                file = new File( new File( basedir,  
> file.getPath() ).toURI().normalize() ).getAbsoluteFile();
> +            }
> +        }
>         return file;
>     }
> +
> }
>
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/SonatypeNexus
http://twitter.com/SonatypeM2E
----------------------------------------------------------

First, the taking in of scattered particulars under one Idea,
so that everyone understands what is being talked about ... Second,
the separation of the Idea into parts, by dividing it at the joints,
as nature directs, not breaking any limb in half as a bad carver might.

   -- Plato, Phaedrus (Notes on the Synthesis of Form by C. Alexander)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r774925 - /maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java

Posted by Benjamin Bentmann <be...@udo.edu>.
Jason van Zyl wrote:

> Can we move this out of here and do in some other part of the 
> configuration processing?

I will investigate. The challenge is that we definitively want 
expressions in the plugin configuration to be evaluated lately and say 
not during the initial model construction because otherwise expressions 
like "${project.compileSourceRoots}" would miss generated stuff. Maybe 
we could just make Plexus use a Maven-specific FileConverter instead 
baking in the basedir alignment into the default FileConverter.


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org