You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rod Mclaughlin <Ro...@omnimedix.org> on 2007/03/21 20:50:11 UTC

Maven 2 can't find war plugin

Can anyone help me with this?
mvn install:install-file -DgroupId=org.apache.maven.plugins 
-DartifactId=maven-war-plugin -Dfile=maven-war-plugin-2.0.2.jar 
-Dversion=2.0.2 -Dpackaging=maven-plugin
creates
~/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.0.2/maven-war-plugin-2.0.2.jar

but
mvn install
says
'The plugin 'org.apache.maven.plugins:maven-war-plugin' does not exist 
or no valid version could be found'
My colleague has the plugin in exactly the same place in his .m2 folder, 
but when he enters mvn install, it builds.
The pom says
    <modelVersion>4.0.0</modelVersion>
    <name>XYZ</name>
    <groupId>com.ourcompany</groupId>
    <artifactId>abc</artifactId>
    <packaging>war</packaging>
    <version>0.1-SNAPSHOT</version>
    <url>http://ourcompany.com</url>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven 2 can't find war plugin

Posted by Rod Mclaughlin <Ro...@omnimedix.org>.
That did it. Thanks so much!

Wendy Smoak wrote:
> On 3/21/07, Rod Mclaughlin <Ro...@omnimedix.org> wrote:
>> I copied the pom file from
>> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.0.2/ 
>>
>> (and the md5's and sha's for the pom and the jar) into
>> ~/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.0.2/
>> but still mvn install says
>> 'The plugin 'org.apache.maven.plugins:maven-war-plugin' does not exist
>> or no valid version could be found'
>
> For plugins, Maven also needs the maven-metadata-[repo-id].xml files
> in the local repository.  (The repo-id is usually "central".)  There
> should be one at the level of the groupId and another at the level of
> the plugin itself.
>
>> I am connected to the internet, and as you say, Maven should
>> automatically install the plugin. But it doesn't.
>
> Try deleting ~/.m2/repository/org/apache/maven/plugins/maven-war-plugin
> to get rid of your manually installed files.  Then build again while
> you're online.  If that doesn't work, post the error message and
> exactly what you typed.
>
> If the metadata file was originally written when you weren't online,
> it will be missing version information, and you'll get the 'no valid
> version' message.
>
> I can reproduce this by deleting the metadata for maven-clean-plugin
> and then running:
>   $ mvn clean -o
>
> This will will write a metadata file containing only
> <?xml version="1.0" encoding="UTF-8" ?>
>  <metadata>
>    <groupId>org.apache.maven.plugins</groupId>
>    <artifactId>maven-clean-plugin</artifactId>
>  </metadata>
>
> Subsequent executions of "mvn clean" will fail with 'no valid version'
> until you either delete the metadata file *or* run with -U on the
> command line to force an update.
>
> mvn clean -U
>
> Deleting the plugin from your local repository to force Maven to
> download it again is also an option.
>


-- 
Rod McLaughlin
Rod.McLaughlin@omnimedix.org
.m2/repository/org/omnimedix/mclaughlin/rod/1.0-SNAPSHOT/rod-1.0-SNAPSHOT.jar


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven 2 can't find war plugin

Posted by Jerome Lacoste <je...@gmail.com>.
On 3/22/07, Wayne Fay <wa...@gmail.com> wrote:
>
> This is an interesting situation and certainly feels like a bug. I'd
> say that Maven should *not* write the metadata file unless it actually
> downloaded the plugin or successfully used it.
>
> Has this been filed in JIRA, Wendy?



I reported an issue a couple of weeks ago (on the list), where maven was
unable to download some plugins until I did mvn -U.

Search for "mvn 2.0.5 doesn't downlado plugin when missing ?" (typo...)

http://www.nabble.com/mvn-2.0.5-doesn't-downlado-plugin-when-missing---t3387755s177.html

Could that be related ?

I've never seen that pre-2.0.5.

J

Re: Maven 2 can't find war plugin

Posted by Wendy Smoak <ws...@gmail.com>.
On 3/21/07, Wayne Fay <wa...@gmail.com> wrote:

> This is an interesting situation and certainly feels like a bug. I'd
> say that Maven should *not* write the metadata file unless it actually
> downloaded the plugin or successfully used it.
>
> Has this been filed in JIRA, Wendy?

I haven't filed anything yet, I'm still trying to get a handle on what
it's doing.  It does seem like this is happening more often lately, so
Jerome's comment that it may have started in 2.0.5 is interesting.

If you have a coherent explanation of the problem, please file it...
I'm trying to sort out some things in the Struts build and a long list
of other items at the moment.

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven 2 can't find war plugin

Posted by Wayne Fay <wa...@gmail.com>.
This is an interesting situation and certainly feels like a bug. I'd
say that Maven should *not* write the metadata file unless it actually
downloaded the plugin or successfully used it.

Has this been filed in JIRA, Wendy?

Wayne

On 3/21/07, Wendy Smoak <ws...@gmail.com> wrote:
> I can reproduce this by deleting the metadata for maven-clean-plugin
> and then running:
>    $ mvn clean -o
>
> This will will write a metadata file containing only
>  <?xml version="1.0" encoding="UTF-8" ?>
>   <metadata>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-clean-plugin</artifactId>
>   </metadata>
>
> Subsequent executions of "mvn clean" will fail with 'no valid version'
> until you either delete the metadata file *or* run with -U on the
> command line to force an update.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven 2 can't find war plugin

Posted by Wendy Smoak <ws...@gmail.com>.
On 3/21/07, Rod Mclaughlin <Ro...@omnimedix.org> wrote:
> I copied the pom file from
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.0.2/
> (and the md5's and sha's for the pom and the jar) into
> ~/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.0.2/
> but still mvn install says
> 'The plugin 'org.apache.maven.plugins:maven-war-plugin' does not exist
> or no valid version could be found'

For plugins, Maven also needs the maven-metadata-[repo-id].xml files
in the local repository.  (The repo-id is usually "central".)  There
should be one at the level of the groupId and another at the level of
the plugin itself.

> I am connected to the internet, and as you say, Maven should
> automatically install the plugin. But it doesn't.

Try deleting ~/.m2/repository/org/apache/maven/plugins/maven-war-plugin
to get rid of your manually installed files.  Then build again while
you're online.  If that doesn't work, post the error message and
exactly what you typed.

If the metadata file was originally written when you weren't online,
it will be missing version information, and you'll get the 'no valid
version' message.

I can reproduce this by deleting the metadata for maven-clean-plugin
and then running:
   $ mvn clean -o

This will will write a metadata file containing only
 <?xml version="1.0" encoding="UTF-8" ?>
  <metadata>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-clean-plugin</artifactId>
  </metadata>

Subsequent executions of "mvn clean" will fail with 'no valid version'
until you either delete the metadata file *or* run with -U on the
command line to force an update.

mvn clean -U

Deleting the plugin from your local repository to force Maven to
download it again is also an option.

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven 2 can't find war plugin

Posted by Rod Mclaughlin <Ro...@omnimedix.org>.
I copied the pom file from
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.0.2/
(and the md5's and sha's for the pom and the jar) into
~/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.0.2/
but still mvn install says
'The plugin 'org.apache.maven.plugins:maven-war-plugin' does not exist
or no valid version could be found'

I am connected to the internet, and as you say, Maven should 
automatically install the plugin. But it doesn't.

Thanks for your rapid turnaround, btw. I've never known a commercial 
company with this level of support.



Wayne Fay wrote:
> I would assume that you didn't install the pom file along with the
> jar. Easiest thing would be to just grab the pom file and literally
> copy and paste it into the proper place in your filesystem.
>
> On a related note... why are you installing these files manually -- so
> long as you are connected to the Internet, Maven should automatically
> resolve, download, and install this plugin and all related files.
>
> Wayne
>


> On 3/21/07, Rod Mclaughlin <Ro...@omnimedix.org> wrote:
>> Can anyone help me with this?
>> mvn install:install-file -DgroupId=org.apache.maven.plugins
>> -DartifactId=maven-war-plugin -Dfile=maven-war-plugin-2.0.2.jar
>> -Dversion=2.0.2 -Dpackaging=maven-plugin
>> creates
>> ~/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.0.2/maven-war-plugin-2.0.2.jar 
>>
>>
>> but
>> mvn install
>> says
>> 'The plugin 'org.apache.maven.plugins:maven-war-plugin' does not exist
>> or no valid version could be found'
>> My colleague has the plugin in exactly the same place in his .m2 folder,
>> but when he enters mvn install, it builds.
>> The pom says
>>     <modelVersion>4.0.0</modelVersion>
>>     <name>XYZ</name>
>>     <groupId>com.ourcompany</groupId>
>>     <artifactId>abc</artifactId>
>>     <packaging>war</packaging>
>>     <version>0.1-SNAPSHOT</version>
>>     <url>http://ourcompany.com</url>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Rod McLaughlin
Rod.McLaughlin@omnimedix.org
.m2/repository/org/omnimedix/mclaughlin/rod/1.0-SNAPSHOT/rod-1.0-SNAPSHOT.jar


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven 2 can't find war plugin

Posted by Wayne Fay <wa...@gmail.com>.
I would assume that you didn't install the pom file along with the
jar. Easiest thing would be to just grab the pom file and literally
copy and paste it into the proper place in your filesystem.

On a related note... why are you installing these files manually -- so
long as you are connected to the Internet, Maven should automatically
resolve, download, and install this plugin and all related files.

Wayne

On 3/21/07, Rod Mclaughlin <Ro...@omnimedix.org> wrote:
> Can anyone help me with this?
> mvn install:install-file -DgroupId=org.apache.maven.plugins
> -DartifactId=maven-war-plugin -Dfile=maven-war-plugin-2.0.2.jar
> -Dversion=2.0.2 -Dpackaging=maven-plugin
> creates
> ~/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.0.2/maven-war-plugin-2.0.2.jar
>
> but
> mvn install
> says
> 'The plugin 'org.apache.maven.plugins:maven-war-plugin' does not exist
> or no valid version could be found'
> My colleague has the plugin in exactly the same place in his .m2 folder,
> but when he enters mvn install, it builds.
> The pom says
>     <modelVersion>4.0.0</modelVersion>
>     <name>XYZ</name>
>     <groupId>com.ourcompany</groupId>
>     <artifactId>abc</artifactId>
>     <packaging>war</packaging>
>     <version>0.1-SNAPSHOT</version>
>     <url>http://ourcompany.com</url>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org