You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Benjamin Bentmann <be...@udo.edu> on 2009/12/30 00:41:39 UTC

Re: svn commit: r894515 - in /maven/plugins/trunk/maven-dependency-plugin/src: it/copy-and-unpack-with-alternate-local-repo/ it/copy/ main/java/org/apache/maven/plugin/dependency/ main/java/org/apache/maven/plugin/dependency/fromConfiguration/ main/java/or...

Hi Dan,

> Author: dantran
> Date: Tue Dec 29 23:33:02 2009
> New Revision: 894515
> 
> URL: http://svn.apache.org/viewvc?rev=894515&view=rev
> Log:
> MDEP-179:Add ability to use an alternate repository at copy and unpack mojo's execution time
> 
> +    
> +    /**
> +     * @return Returns the local.
> +     */
> +    protected ArtifactRepository getLocal ()
> +    {
> +        if ( this.localRepository != null )
> +        {
> +            return this.localRepository;
> +        }
> +        
> +        if ( this.alternateLocalRepository != null )
> +        {
> +            //create a temporary local repository with unique id
> +            this.localRepository = new DefaultArtifactRepository( Long.toHexString( System.currentTimeMillis() ), "file://" + this.alternateLocalRepository.getAbsolutePath(), new DefaultRepositoryLayout() );

Directly using implementation classes instead of interfaces/components 
is bad with regard to future refactoring of Maven internals. Please use 
the ArtifactRepositoryFactory instead of new DefaultArtifactRepository().


Benjamin

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


Re: svn commit: r894515 - in /maven/plugins/trunk/maven-dependency-plugin/src: it/copy-and-unpack-with-alternate-local-repo/ it/copy/ main/java/org/apache/maven/plugin/dependency/ main/java/org/apache/maven/plugin/dependency/fromConfiguration/ main/java/or...

Posted by Benjamin Bentmann <be...@udo.edu>.
Hi Dan,

>> Author: dantran
>> Date: Tue Dec 29 23:33:02 2009
>> New Revision: 894515
>>
>> URL: http://svn.apache.org/viewvc?rev=894515&view=rev
>> Log:
>> MDEP-179:Add ability to use an alternate repository at copy and unpack 
>> mojo's execution time
>>
>> +    +    /**
>> +     * @return Returns the local.
>> +     */
>> +    protected ArtifactRepository getLocal ()
>> +    {
>> +        if ( this.localRepository != null )
>> +        {
>> +            return this.localRepository;
>> +        }
>> +        +        if ( this.alternateLocalRepository != null )
>> +        {
>> +            //create a temporary local repository with unique id
>> +            this.localRepository = new DefaultArtifactRepository( 
>> Long.toHexString( System.currentTimeMillis() ), "file://" + 
>> this.alternateLocalRepository.getAbsolutePath(), new 
>> DefaultRepositoryLayout() );
> 
> Directly using implementation classes instead of interfaces/components 
> is bad with regard to future refactoring of Maven internals. Please use 
> the ArtifactRepositoryFactory instead of new DefaultArtifactRepository().

Ping


Benjamin

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


Re: svn commit: r894515 - in /maven/plugins/trunk/maven-dependency-plugin/src: it/copy-and-unpack-with-alternate-local-repo/ it/copy/ main/java/org/apache/maven/plugin/dependency/ main/java/org/apache/maven/plugin/dependency/fromConfiguration/ main/java/or...

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

>> +            //create a temporary local repository with unique id
>> +            this.localRepository = new DefaultArtifactRepository( 
>> Long.toHexString( System.currentTimeMillis() ), "file://" + 
>> this.alternateLocalRepository.getAbsolutePath(), new 
>> DefaultRepositoryLayout() );
> 
> Directly using implementation classes instead of interfaces/components 
> is bad with regard to future refactoring of Maven internals. Please use 
> the ArtifactRepositoryFactory instead of new DefaultArtifactRepository().

For clarity, this applies to new DefaultRepositoryLayout() as well, it's 
a component so please use @component to access it via dependency injection.


Benjamin

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