Latest Entries »

Thursday, June 24, 2010

Maven install:install-file (Access is denied)

Sometimes silly mistakes will build more frustration and this is the same happened to me while installing an artifact from the command prompt (cmd)

Initially I was driven into the error

C:\Sravan.Modugula>mvn install:install-file -Dfile=C:\lib
-DgroupId=org.portletfaces -DartifactId=portletfaces-bridge-impl -Dversion=2.0
.0.ALPHA4 -Dpackaging=jar -DgeneratePom=true
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [install:install-file] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [install:install-file {execution: default-cli}]
[INFO] Installing D:\lib to C:\repository\org\portletfaces\portletfaces-bridge-i
mpl\2.0.0.ALPHA4\portletfaces-bridge-impl-2.0.0.ALPHA4.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error installing artifact 'org.portletfaces:portletfaces-bridge-impl:jar'
: Error installing artifact: D:\lib (Access is denied)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Thu Sep 23 18:31:03 IST 2010

After reading some expert opinions and several irrelevant blogs I came to a conclusion that I haven’t specified the complete path @ -Dfile. We must specify the complete path including jar file name.

-Dfile=D:\lib\portletfaces-bridge-impl-2.0.0.ALPHA4.jar

Here is the working command

mvn install:install-file -Dfile=D:\lib\portletfaces-bridge-impl-2.0.0.ALPHA4.jar -DgroupId=org.portletfaces -DartifactId=portletfaces-bridge-impl -Dversion=2.0.0.ALPHA4 -Dpackaging=jar -DgeneratePom=true

I hope this information will help few readers.

11 comments:

Deege said...

This helped me. Thanks!

My actual problem was I was putting the directory in the file name, but not the actual name of the file. Once I added the filename, all was happy.

democrateafricain said...
This comment has been removed by the author.
Anonymous said...

Thanks for the tip! I had the same issue as Deege... the same error over and over.

Surya Rao Rayarao said...

This helped me
Thanks a lot!

Unknown said...

Thank you very much! You saved me.

Eli.

Servius said...

Let me add a, "Thank you" to the chorus.

tiddle said...

Thank you so much. You're a life-saver. :)

Susara De Saram said...

This helped me too. Thank you very much! :)

Unknown said...

Thank you very much :)

Krupa said...

This helped. Thanks a lot for the information.

Mohammad Ayub said...

This helped me as well. Your screen shot showed me where to run the command and also that I have to include the file in the path as well. Thank you very much