Search code examples
javamavenjakarta-eemaven-pluginmaven-install-plugin

Error with mvn install local jar: Failed to execute goal org.apache.maven.plugins:maven-install-plugin...(Is a directory) -> [Help 1]


i am trying to install a local jar to my maven project, i am running this command from my project folder :

mvn install:install-file -Dfile= ~/Downloads/<jar_path> -DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version> -Dpackaging=jar -DgeneratePom=false

and i am getting this error:

Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project my-project: Error installing artifact 'my-artifact': Failed to install artifact groupId:artifactId:jar:version: /Users/my-project-path (Is a directory) -> [Help 1]

Solution

  • There is a space in your command, after -Dfile=!

     mvn install:install-file -Dfile= ~/Downloads/<jar_path> -DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version> -Dpackaging=jar -DgeneratePom=false
    

    try

     mvn install:install-file -Dfile=~/Downloads/<jar_path> -DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version> -Dpackaging=jar -DgeneratePom=false