Discussion:
Maven 3 and cargo plugin
Thorsten Heit
2011-02-09 14:31:46 UTC
Permalink
Hi,

according to the Cargo docs "mvn cargo:help" prints a short description, but that seems to work only with Maven 2; with Maven 3 I'm getting the following error:

(...)
[ERROR] No plugin found for prefix 'cargo' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/thorsten/.m2/repository), central (http://10.26.31.180:8080/nexus/content/groups/public), snapshots (http://10.26.31.180:8080/nexus/content/repositories/apache-snapshots)] -> [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/NoPluginFoundForPrefixException

To achieve the same I have to add both group Id and artifact Id in the command line, i.e. "mvn org.codehaus.cargo:cargo-maven2-plugin:help"

Is there a better way? And why does Maven 2 find the plugin although according to the docs it searches for plugins in different groups, i.e. org.apache.maven.plugins and org.codehaus.mojo?


Regards

Thorsten
Karl Heinz Marbaise
2011-02-09 14:34:12 UTC
Permalink
Hi Thorsten,

which version of the cargo plugin do you use?

Can you give a snippet of your POM.xml where you configure cargo, cause i'm using cargo with maven 3.0.X

Kind regards
Karl Heinz Marbaise
--
MfG
Karl Heinz Marbaise
--
SoftwareEntwicklung Beratung Schulung Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise ICQ#: 135949029
Hauptstrasse 177 USt.IdNr: DE191347579
52146 Würselen http://www.soebes.de
Thorsten Heit
2011-02-09 19:48:54 UTC
Permalink
Hi,
Post by Karl Heinz Marbaise
which version of the cargo plugin do you use?
Can you give a snippet of your POM.xml where you configure cargo, cause i'm using cargo with maven 3.0.X
For testing purposes I only added the following minimalist configuration snippet to my pom.xml as explained on the Cargo website [1]:

<build>
...
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
</plugin>
</plugins>
...
</build>

I didn't specify a version so I assume Maven downloaded the newest available version.

Using Maven 3 I get the mentioned error with "mvn cargo:help" whereas with Maven 2 the same command line works...



[1] http://cargo.codehaus.org/Starting+and+stopping+a+container


Regards

Thorsten
Anders Hammar
2011-02-09 14:36:33 UTC
Permalink
You need to declare 'org.codehaus.cargo' as a pluginGroup in your
settings.xml:

<pluginGroups>
<pluginGroup>org.codehaus.cargo</pluginGroup>
</pluginGroups>

/Anders
Post by Thorsten Heit
Hi,
according to the Cargo docs "mvn cargo:help" prints a short description,
but that seems to work only with Maven 2; with Maven 3 I'm getting the
(...)
[ERROR] No plugin found for prefix 'cargo' in the current project and in
the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available
from the repositories [local (/home/thorsten/.m2/repository), central (
http://10.26.31.180:8080/nexus/content/groups/public), snapshots (
http://10.26.31.180:8080/nexus/content/repositories/apache-snapshots)] ->
[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,
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
To achieve the same I have to add both group Id and artifact Id in the
command line, i.e. "mvn org.codehaus.cargo:cargo-maven2-plugin:help"
Is there a better way? And why does Maven 2 find the plugin although
according to the docs it searches for plugins in different groups, i.e.
org.apache.maven.plugins and org.codehaus.mojo?
Regards
Thorsten
---------------------------------------------------------------------
Thorsten Heit
2011-02-09 19:52:44 UTC
Permalink
Hi,
Post by Anders Hammar
You need to declare 'org.codehaus.cargo' as a pluginGroup in your
<pluginGroups>
<pluginGroup>org.codehaus.cargo</pluginGroup>
</pluginGroups>
Ok, thanks, I'll try it tomorrow when I'm back at work.

OTOH: Why can Maven 2 find the Cargo plugin without having the above section in the settings.xml? AFAIK M2 only searches in the groups org.apache.maven.plugins and org.codehaus.mojo, i.e. "mvn cargo:help" should normally not work out of the box, right?


Best regards

Thorsten
Anders Hammar
2011-02-09 19:59:59 UTC
Permalink
I have no clue. There shouldn't be any difference. I'm guessing there is
some difference in your maven 2 and maven 3 execution environments.

/Anders
Post by Thorsten Heit
Hi,
Post by Anders Hammar
You need to declare 'org.codehaus.cargo' as a pluginGroup in your
<pluginGroups>
<pluginGroup>org.codehaus.cargo</pluginGroup>
</pluginGroups>
Ok, thanks, I'll try it tomorrow when I'm back at work.
OTOH: Why can Maven 2 find the Cargo plugin without having the above
section in the settings.xml? AFAIK M2 only searches in the groups
org.apache.maven.plugins and org.codehaus.mojo, i.e. "mvn cargo:help" should
normally not work out of the box, right?
Best regards
Thorsten
---------------------------------------------------------------------
Thorsten Heit
2011-02-09 20:37:47 UTC
Permalink
Post by Anders Hammar
I have no clue. There shouldn't be any difference. I'm guessing there is
some difference in your maven 2 and maven 3 execution environments.
Nope:
I unpacked the binary tar archives for both Maven 2 and 3 in /usr/local, i.e. there are directories /usr/local/apache-maven-{2.2.1, 3.0.2}. There's a symlink /usr/local/maven that points to the latest version, i.e. 3.0.2, and M2_REPO defaults to this symlink. Therefore executing "mvn ..." from the command line fires Maven 3.

When I want to use Maven 2 I only have to redirect the M2_REPO variable and prepend the full path to the mvn shell script from the Maven 2 installation. This is exactly what I did a couple of hours ago.


Regards

Thorsten
bluewhale
2011-08-04 21:25:04 UTC
Permalink
Hi there,

I have the same problem and followed this thread, however the solution ist
not working for me.

My result ist still; No plugin found for prefix 'cargo'. I'm a bit clueless.
Have you solved your problem in between?

Cheers

Stefan

C:\Users\Stefan\.m2>mvn cargo:help
[INFO] Scanning for projects...
Downloading:
http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metada
ta.xml
Downloading:
http://repo1.maven.org/maven2/org/codehaus/cargo/maven-metadata.xml

Downloaded:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadat
a.xml (11 KB at 10.1 KB/sec)
Downloaded:
http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml (
18 KB at 13.7 KB/sec)
Downloaded:
http://repo1.maven.org/maven2/org/codehaus/cargo/maven-metadata.xml
(703 B at 0.5 KB/sec)
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2.043s
[INFO] Finished at: Thu Aug 04 23:11:04 CEST 2011
[INFO] Final Memory: 3M/90M
[INFO]
------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'cargo' in the current project and in the
plu
gin groups [org.codehaus.cargo, org.apache.maven.plugins, org.codehaus.mojo]
ava
ilable from the repositories [local (d:\dev\maven-3.0.3\repository), central
(ht
tp://repo1.maven.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
swit
ch.
[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
rea
d the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundF
orPrefixException
C:\Users\Stefan\.m2>

--
View this message in context: http://maven-users.828.n2.nabble.com/Maven-3-and-cargo-plugin-tp6007841p6654316.html
Sent from the maven users mailing list archive at Nabble.com.
bluewhale
2011-08-04 21:31:55 UTC
Permalink
Hm I think i have found something. It looks like if my local repository is
beeing ignored.
Instead of downloading the plugin in the specified directory from the
settings.xml my maven3 is creating
a repository for the plugin in my users .m2 dir? Why, all other dependencies
are going in the specified local repository.

Does anyone now why?

Here is my effective-settings:

<?xml version="1.0" encoding="UTF-8"?>













<settings xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org
/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1
.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<localRepository
xmlns="http://maven.apache.org/SETTINGS/1.1.0">d:\dev\maven-3
.0.3\repository</localRepository>
<pluginGroups xmlns="http://maven.apache.org/SETTINGS/1.1.0">
<pluginGroup>org.codehaus.cargo</pluginGroup>
<pluginGroup>org.apache.maven.plugins</pluginGroup>
<pluginGroup>org.codehaus.mojo</pluginGroup>
</pluginGroups>
</settings>

[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1.162s
[INFO] Finished at: Thu Aug 04 23:27:19 CEST 2011
[INFO] Final Memory: 4M/90M
[INFO]
------------------------------------------------------------------------
C:\Users\Stefan\.m2>

--
View this message in context: http://maven-users.828.n2.nabble.com/Maven-3-and-cargo-plugin-tp6007841p6654331.html
Sent from the maven users mailing list archive at Nabble.com.
Benjamin Bentmann
2011-08-04 22:19:28 UTC
Permalink
Post by bluewhale
http://repo1.maven.org/maven2/org/codehaus/cargo/maven-metadata.xml
[...]
[ERROR] No plugin found for prefix 'cargo'
It appears something went wrong during the last release of Cargo, the
mentioned metadata file lists "cargo2" as the plugin prefix which
however contradicts the prefix stored in the
cargo-maven2-plugin-1.1.1.jar/META-INF/maven/plugin.xml.

So for now, "mvn cargo2:<goal>" should work.

I already brought this up on the Cargo developer list, the release of
1.1.2 is currently open for voting, providing a good chance to see what
happens with the metadata upon release.


Benjamin
bluewhale
2011-08-05 20:27:28 UTC
Permalink
Hi Benjamin,

mvn carg2:help works. I got some successful maven downloads with this
command.

Now I run into the next problem, where cargo tells me that it find no
glassfish plugin,
as im trying to deploy to a locally installed glassfish:

[ERROR] No plugin found for prefix 'glassfish' in the current project and in
the plugin groups [org.codehaus.cargo, org.apache.maven.plugins,
org.codehaus.mojo] available from the repositories [local
(d:\dev\maven-3.0.3\repository), central (http://repo1.maven.org/maven2)] ->
[Help 1]
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin
found for prefix 'glassfish' in the current project and in the plugin groups
[org.codehaus.cargo, org.apache.maven.plugins, org.codehaus.mojo] available
from the repositories [local (d:\dev\maven-3.0.3\repository), central
(http://repo1.maven.org/maven2)]
at
org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:92)

Mabe this is another problem with the release. I will check with the cargo
list.

Thanks for your reply.

Stefan



--
View this message in context: http://maven-users.828.n2.nabble.com/Maven-3-and-cargo-plugin-tp6007841p6657911.html
Sent from the maven users mailing list archive at Nabble.com.
Wayne Fay
2011-08-06 19:42:39 UTC
Permalink
Post by bluewhale
mvn carg2:help works. I got some successful maven downloads with this
command.
[ERROR] No plugin found for prefix 'glassfish' in the current project and in
the plugin groups [org.codehaus.cargo, org.apache.maven.plugins,
What is the exact command you are trying to run? Copy and paste from
command line. Also this is probably a better topic for the cargo users
list as you already mentioned...

Wayne
Anders Hammar
2011-08-06 22:29:21 UTC
Permalink
We're working on this on the Cargo dev list. For some reason the metadata
for the Cargo plugin is wrong. It should be "cargo" as a prefix, not
"cargo2". The JIRA ticket to get this fixed at Codehaus (and then synced to
central) is HAUS-2107 [1] if anyone wants to follow the progress.

/Anders

[1] https://jira.codehaus.org/browse/HAUS-2107
Post by Wayne Fay
Post by bluewhale
mvn carg2:help works. I got some successful maven downloads with this
command.
[ERROR] No plugin found for prefix 'glassfish' in the current project and
in
Post by bluewhale
the plugin groups [org.codehaus.cargo, org.apache.maven.plugins,
What is the exact command you are trying to run? Copy and paste from
command line. Also this is probably a better topic for the cargo users
list as you already mentioned...
Wayne
---------------------------------------------------------------------
Benjamin Bentmann
2011-08-08 17:35:17 UTC
Permalink
Post by bluewhale
http://repo1.maven.org/maven2/org/codehaus/cargo/maven-metadata.xml
[...]
[ERROR] No plugin found for prefix 'cargo'
The proper metadata is now out such that "mvn cargo:help" works as intended.

Please note that Maven refetches metadata by default only once a day. So
you might need to add the CLI flag -U if you want to try out the fixed
metadata before this 24h update interval.


Benjamin
Anders Hammar
2011-08-08 17:40:45 UTC
Permalink
And to add to that, if you're behind a Maven proxy/manager (like Nexus,
Artifactory, or Archiva) forcing a update might still not help as the Maven
proxy also needs to refresh its cached metadata. For Nexus that happens
after 24 hours by default I believe. So if it still doesn't work, wait a day
and try again.

/Anders

On Mon, Aug 8, 2011 at 19:35, Benjamin Bentmann
Post by Benjamin Bentmann
http://repo1.maven.org/maven2/**org/codehaus/cargo/maven-**metadata.xml<http://repo1.maven.org/maven2/org/codehaus/cargo/maven-metadata.xml>
[...]
[ERROR] No plugin found for prefix 'cargo'
The proper metadata is now out such that "mvn cargo:help" works as intended.
Please note that Maven refetches metadata by default only once a day. So
you might need to add the CLI flag -U if you want to try out the fixed
metadata before this 24h update interval.
Benjamin
------------------------------**------------------------------**---------
Loading...