You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Romain Bioteau (Jira)" <ji...@apache.org> on 2022/11/25 18:17:00 UTC

[jira] [Updated] (MINSTALL-186) install-file fails when the file belongs to the local repository and using a localRepositoryPath

     [ https://issues.apache.org/jira/browse/MINSTALL-186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Romain Bioteau updated MINSTALL-186:
------------------------------------
    Description: 
To reproduce:

Assuming maven-deploy-plugin 3.0.0 EXISTS in your local repository:
{code:bash}
❯ 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 -Dversion=3.0.0 -DartifactId=maven-deploy-plugin -DgroupId=org.apache.maven.plugins -Dtype=jar
[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] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.164 s
[INFO] Finished at: 2022-11-25T19:12:32+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:3.1.0:install-file (default-cli) on project standalone-pom: Cannot install artifact. Artifact is already in the local repository.
[ERROR] 
[ERROR] File in question is: /home/romain/.m2/repository/org/apache/maven/plugins/maven-deploy-plugin/3.0.0/maven-deploy-plugin-3.0.0.jar
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
{code}

  was:
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}


> 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:
> Assuming maven-deploy-plugin 3.0.0 EXISTS in your local repository:
> {code:bash}
> ❯ 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 -Dversion=3.0.0 -DartifactId=maven-deploy-plugin -DgroupId=org.apache.maven.plugins -Dtype=jar
> [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] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time:  0.164 s
> [INFO] Finished at: 2022-11-25T19:12:32+01:00
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:3.1.0:install-file (default-cli) on project standalone-pom: Cannot install artifact. Artifact is already in the local repository.
> [ERROR] 
> [ERROR] File in question is: /home/romain/.m2/repository/org/apache/maven/plugins/maven-deploy-plugin/3.0.0/maven-deploy-plugin-3.0.0.jar
> [ERROR] 
> [ERROR] -> [Help 1]
> [ERROR] 
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR] 
> [ERROR] For more information about the errors and possible solutions, please read the following articles:
> [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
> {code}



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