1

When I try to install a custom jar with the following maven command then it will fail misirably:

mvn -X install:install-file -Dfile=D:\Work\...

Howerver the following does work:

mvn -X install:install-file -Dfile=\Work\...

You might now ask: So where is the problem? Well, I want to import from a script file and there I have the path with drive letter and all other trimmings.

So how would I go about this?

PS: The error message is:

[ERROR] No plugin found for prefix 'D' in the current project and in the> plugin groups [org.apache.maven.plugins, org.code haus.mojo] available from the repositories [local (D:\Repository), central (http://repo1.maven.org/maven2)] -> [Help 1] org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'D' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories

PPS: No spell checker in the companies bloody IE :-(

Martin
  • 11,577
  • 16
  • 80
  • 110

5 Answers5

2

I got a very similar error except my was prefix 'C'...

After reading this thread, I added single quotation mark to my jar file name as -Dfile=‘C:\work\perforce\trunk\Lib\ftp4j\ftp4j-1.7.2.jar’ and you need to make sure there is no space between the = and the '.

Adding the single quotes fixed it and I was able to have "BUILD SUCCESS" as my output after the install.

But guess what I see in my repository folder? The ftp4j-1.7.2.jar.lastUpdated, ftp4j-1.7.2.pom, ftp4j-1.7.2.pom.lastUpdated files were all created in the folder by the installation, but the actual ftp4j-1.7.2.jar was NOT/failed to copy over...So at this point, I just manually copy the ftp4j-1.7.2.jar over myself to the repository and that seems to finally work.

template boy
  • 10,230
  • 8
  • 61
  • 97
2

In the end I opted for:

PUSHD %[PROJECT_HOME]
    CALL mvn    ^
     install:install-file  ^
     `-Dfile=lib/ojdbc14.jar` ^
     `-DgroupId=com.oracle`  ^
     `-DartifactId=ojdbc14`  ^
     `-Dversion=9.0.2.0.0`  ^
     `-Dpackaging=jar`
POPD

I used:

  • PUSHD so I can use relative path names .
  • CALL so the script won't prematurly end.
  • forward slashes instead of backslashes.
  • all -D parameters need to be backticked under Windows.

I hope that helps.

Martin
  • 11,577
  • 16
  • 80
  • 110
1

I had this problem using PowerShell, but somehow, it was resolved when I used Command Prompt...

maia
  • 3,910
  • 4
  • 27
  • 34
0

Could you try by using a valid Java path string ?

  • replacing '\' with '/'
  • or doubling each '\'
Alois Cochard
  • 9,812
  • 2
  • 29
  • 30
  • No problem on the command line. But rather difficult to archive in script file. Besides I also noticed a 2nd problem which is anwered here: http://stackoverflow.com/questions/442230/how-to-manually-install-an-artifact-in-maven-2 - check for the answere of S. Bollweber. I guess I need to refactor my scripts to use relativ path names. – Martin Oct 13 '10 at 12:12
  • 1
    Seen, but I just took a look at my own script and I noticed I do 'call mvn ...' instead of simply 'mvn ...' don't know if this help you (and I use only relative path) – Alois Cochard Oct 13 '10 at 12:16
  • Thanks for reminding me - of course I need to use CALL as well else the script will end after the first install (there is only one right now - but this will change). – Martin Oct 13 '10 at 12:19
0

Example for ojdbc6.jar install (on Windows).

Download ojdbc drivers from Oracle. Next in "Command Shell" issue command

mvn install:install-file -Dfile="C:\Users\yourusername\Downloads\ojdbc6-11.2.0.3.jar" -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar