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

Piotr Zygielo commented on MINSTALL-186:
----------------------------------------

Using maven 3.8.6, I can't reproduce this
{code:java}
$ mvn org.apache.maven.plugins:maven-install-plugin:3.1.0:install-file 
-Dfile=$HOME/.m2/repository/org/apache/maven/plugins/maven-deploy-plugin/3.0.0/maven-deploy-plugin-3.0.0.jar
 -DlocalRepositoryPath=/tmp/repo -DgroupId=org.apache -DartifactId=test 
-Dpackaging=jar -Dversion=1.0{code}
always completes with success:
{code:java}
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-install-plugin:3.1.0:install-file (default-cli) @ 
standalone-pom ---
[INFO] Installing 
.../.m2/repository/org/apache/maven/plugins/maven-deploy-plugin/3.0.0/maven-deploy-plugin-3.0.0.jar
 to /tmp/repo/org/apache/test/1.0/test-1.0.jar
[INFO] Installing /tmp/maven-deploy-plugin-3.0.010112682731321406765.pom to 
/tmp/repo/org/apache/test/1.0/test-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.524 s
[INFO] Finished at: 2022-11-25T17:04:19+01:00
[INFO] 
------------------------------------------------------------------------{code}

> install-file fails when the file belongs to the local repository and using a 
> localRepositoryPath
> ------------------------------------------------------------------------------------------------
>
>                 Key: MINSTALL-186
>                 URL: https://issues.apache.org/jira/browse/MINSTALL-186
>             Project: Maven Install Plugin
>          Issue Type: Bug
>          Components: install:install-file
>    Affects Versions: 3.0.1, 3.1.0
>            Reporter: Romain Bioteau
>            Priority: Trivial
>
> To reproduce:
> {code:bash}
> mvn install:install-file 
> -Dfile=<default_local_repository>/org/apache/test/1.0.0/test/test-1.0.0.jar 
> -DlocalRepositoryPath=target/repo/path
> {code}
> Fails with with an error message like:
> {noformat}
> org.apache.maven.plugin.MojoFailureException: Cannot install artifact. 
> Artifact is already in the local repository.
> File in question is: 
> /home/romain/git/maven-install-plugin/target/test-classes/unit/install-file-from-local-repository-test/target/org/apache/maven/test/maven-install-test/1.0-SNAPSHOT/maven-install-test-1.0-SNAPSHOT.jar
>       at 
> org.apache.maven.plugins.install.InstallFileMojo.execute(InstallFileMojo.java:250)
> {noformat}



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

Reply via email to