You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sigmond Hola <si...@gmail.com> on 2018/02/24 06:01:04 UTC

Why I can run plugin:goal in command line even though plugin was only defined under pluginManagement?

I defined a specific plugin under  <build><pluginManagement><plugins>, but
not under  <build><plugins>, but I can still run goals of this plugin with  mvn
plugin:goal.

As far as I understand<pluginManagement> is only used to configuring the
plugin information, but not actually import them, right? then how can I use
the goals of this plugin  in the command line?

Thanks for reply.

Bests.
--Sig

Re: Why I can run plugin:goal in command line even though plugin wasonly defined under pluginManagement?

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
My guess is, that as soon as a plug-in is resolved (which includes plugin management) it's prefix is registered. For the default groups the Prefix is searched in, but that does not apply in this case.

In all cases it can be used, it just has no preferred version or default-cli configuration in the POM.

Gruss
Bernd

Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
From: Sigmond Hola <si...@gmail.com>
Sent: Monday, February 26, 2018 8:17:02 AM
To: Maven Users List
Subject: Re: Why I can run plugin:goal in command line even though plugin wasonly defined under pluginManagement?

Hi Bernd,

You are right, thanks for illustration.

But why? Im still confused....

the  prefix-to-artifactId mappings is defined within <pluginGroups> of
effective settings.xml and the default values of it is:

> org.apache.maven.plugins
> org.codehaus.mojo

right? tomcat7's groupId:  org.apache.tomcat.maven is not included.

Why I can using tomcat7 as prefix for  tomcat7-maven-plugin after I add it
in  <build><pluginManagement><plugins> of my pom.xml...


On Sun, Feb 25, 2018 at 12:36 AM, Bernd Eckenfels <ec...@zusammenkunft.net>
wrote:

> It is true: for plugins where the prefix is not found by Default, you can
> still start them with
>
>     mvn org.apache.tomcat.maven:tomcat7-maven-plugin:run
> Gruss
> Bernd
> --
> http://bernd.eckenfels.net
>
> Von: Sigmond Hola
> Gesendet: Samstag, 24. Februar 2018 11:03
> An: Maven Users List
> Betreff: Re: Why I can run plugin:goal in command line even though plugin
> wasonly defined under pluginManagement?
>
> HI bernd,
>
> thanks for reply, but that's not true.
>
> Take tomcat-maven-plugin as example, if you dont defined it under
> <build><pluginManagement><plugins> or <build><plugins>, then following
> error will reported if you run  mvn tomcat7:rununder command line:
>
> No plugin found for prefix 'tomcat7' in the current project and in the
> plugin groups [org.apache.maven.plugins, org.codehaus.mojo]
> >
> >
> Best regards.
>
>
> On Sat, Feb 24, 2018 at 4:39 PM, Bernd Eckenfels <ec...@zusammenkunft.net>
> wrote:
>
> > Hello,
> >
> > You can always run goals on the command line, even if they are not
> defined
> > in the POM at all. If maven finds the plugin in the POM it knows what
> > version to use and it allows to specify a Prefix instead of
> > group:artifact[:version]:goal.
> > Gruss
> > Bernd
> >
> > Gruss
> > Bernd
> > --
> > http://bernd.eckenfels.net
> > ________________________________
> > From: Sigmond Hola <si...@gmail.com>
> > Sent: Saturday, February 24, 2018 7:01:04 AM
> > To: users@maven.apache.org
> > Subject: Why I can run plugin:goal in command line even though plugin was
> > only defined under pluginManagement?
> >
> > I defined a specific plugin under  <build><pluginManagement><plugins>,
> but
> > not under  <build><plugins>, but I can still run goals of this plugin
> > with  mvn
> > plugin:goal.
> >
> > As far as I understand<pluginManagement> is only used to configuring the
> > plugin information, but not actually import them, right? then how can I
> use
> > the goals of this plugin  in the command line?
> >
> > Thanks for reply.
> >
> > Bests.
> > --Sig
> >
>
>

Re: Why I can run plugin:goal in command line even though plugin wasonly defined under pluginManagement?

Posted by Sigmond Hola <si...@gmail.com>.
Hi Bernd,

You are right, thanks for illustration.

But why? Im still confused....

the  prefix-to-artifactId mappings is defined within <pluginGroups> of
effective settings.xml and the default values of it is:

> org.apache.maven.plugins
> org.codehaus.mojo

right? tomcat7's groupId:  org.apache.tomcat.maven is not included.

Why I can using tomcat7 as prefix for  tomcat7-maven-plugin after I add it
in  <build><pluginManagement><plugins> of my pom.xml...


On Sun, Feb 25, 2018 at 12:36 AM, Bernd Eckenfels <ec...@zusammenkunft.net>
wrote:

> It is true: for plugins where the prefix is not found by Default, you can
> still start them with
>
>     mvn org.apache.tomcat.maven:tomcat7-maven-plugin:run
> Gruss
> Bernd
> --
> http://bernd.eckenfels.net
>
> Von: Sigmond Hola
> Gesendet: Samstag, 24. Februar 2018 11:03
> An: Maven Users List
> Betreff: Re: Why I can run plugin:goal in command line even though plugin
> wasonly defined under pluginManagement?
>
> HI bernd,
>
> thanks for reply, but that's not true.
>
> Take tomcat-maven-plugin as example, if you dont defined it under
> <build><pluginManagement><plugins> or <build><plugins>, then following
> error will reported if you run  mvn tomcat7:rununder command line:
>
> No plugin found for prefix 'tomcat7' in the current project and in the
> plugin groups [org.apache.maven.plugins, org.codehaus.mojo]
> >
> >
> Best regards.
>
>
> On Sat, Feb 24, 2018 at 4:39 PM, Bernd Eckenfels <ec...@zusammenkunft.net>
> wrote:
>
> > Hello,
> >
> > You can always run goals on the command line, even if they are not
> defined
> > in the POM at all. If maven finds the plugin in the POM it knows what
> > version to use and it allows to specify a Prefix instead of
> > group:artifact[:version]:goal.
> > Gruss
> > Bernd
> >
> > Gruss
> > Bernd
> > --
> > http://bernd.eckenfels.net
> > ________________________________
> > From: Sigmond Hola <si...@gmail.com>
> > Sent: Saturday, February 24, 2018 7:01:04 AM
> > To: users@maven.apache.org
> > Subject: Why I can run plugin:goal in command line even though plugin was
> > only defined under pluginManagement?
> >
> > I defined a specific plugin under  <build><pluginManagement><plugins>,
> but
> > not under  <build><plugins>, but I can still run goals of this plugin
> > with  mvn
> > plugin:goal.
> >
> > As far as I understand<pluginManagement> is only used to configuring the
> > plugin information, but not actually import them, right? then how can I
> use
> > the goals of this plugin  in the command line?
> >
> > Thanks for reply.
> >
> > Bests.
> > --Sig
> >
>
>

Re: Why I can run plugin:goal in command line even though plugin wasonly defined under pluginManagement?

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
It is true: for plugins where the prefix is not found by Default, you can still start them with

    mvn org.apache.tomcat.maven:tomcat7-maven-plugin:run
Gruss
Bernd
-- 
http://bernd.eckenfels.net

Von: Sigmond Hola
Gesendet: Samstag, 24. Februar 2018 11:03
An: Maven Users List
Betreff: Re: Why I can run plugin:goal in command line even though plugin wasonly defined under pluginManagement?

HI bernd,

thanks for reply, but that's not true.

Take tomcat-maven-plugin as example, if you dont defined it under
<build><pluginManagement><plugins> or <build><plugins>, then following
error will reported if you run  mvn tomcat7:rununder command line:

No plugin found for prefix 'tomcat7' in the current project and in the
plugin groups [org.apache.maven.plugins, org.codehaus.mojo]
>
>
Best regards.


On Sat, Feb 24, 2018 at 4:39 PM, Bernd Eckenfels <ec...@zusammenkunft.net>
wrote:

> Hello,
>
> You can always run goals on the command line, even if they are not defined
> in the POM at all. If maven finds the plugin in the POM it knows what
> version to use and it allows to specify a Prefix instead of
> group:artifact[:version]:goal.
> Gruss
> Bernd
>
> Gruss
> Bernd
> --
> http://bernd.eckenfels.net
> ________________________________
> From: Sigmond Hola <si...@gmail.com>
> Sent: Saturday, February 24, 2018 7:01:04 AM
> To: users@maven.apache.org
> Subject: Why I can run plugin:goal in command line even though plugin was
> only defined under pluginManagement?
>
> I defined a specific plugin under  <build><pluginManagement><plugins>, but
> not under  <build><plugins>, but I can still run goals of this plugin
> with  mvn
> plugin:goal.
>
> As far as I understand<pluginManagement> is only used to configuring the
> plugin information, but not actually import them, right? then how can I use
> the goals of this plugin  in the command line?
>
> Thanks for reply.
>
> Bests.
> --Sig
>


Re: Why I can run plugin:goal in command line even though plugin was only defined under pluginManagement?

Posted by Sigmond Hola <si...@gmail.com>.
HI bernd,

thanks for reply, but that's not true.

Take tomcat-maven-plugin as example, if you dont defined it under
<build><pluginManagement><plugins> or <build><plugins>, then following
error will reported if you run  mvn tomcat7:rununder command line:

No plugin found for prefix 'tomcat7' in the current project and in the
plugin groups [org.apache.maven.plugins, org.codehaus.mojo]
>
>
Best regards.


On Sat, Feb 24, 2018 at 4:39 PM, Bernd Eckenfels <ec...@zusammenkunft.net>
wrote:

> Hello,
>
> You can always run goals on the command line, even if they are not defined
> in the POM at all. If maven finds the plugin in the POM it knows what
> version to use and it allows to specify a Prefix instead of
> group:artifact[:version]:goal.
> Gruss
> Bernd
>
> Gruss
> Bernd
> --
> http://bernd.eckenfels.net
> ________________________________
> From: Sigmond Hola <si...@gmail.com>
> Sent: Saturday, February 24, 2018 7:01:04 AM
> To: users@maven.apache.org
> Subject: Why I can run plugin:goal in command line even though plugin was
> only defined under pluginManagement?
>
> I defined a specific plugin under  <build><pluginManagement><plugins>, but
> not under  <build><plugins>, but I can still run goals of this plugin
> with  mvn
> plugin:goal.
>
> As far as I understand<pluginManagement> is only used to configuring the
> plugin information, but not actually import them, right? then how can I use
> the goals of this plugin  in the command line?
>
> Thanks for reply.
>
> Bests.
> --Sig
>

Re: Why I can run plugin:goal in command line even though plugin was only defined under pluginManagement?

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Hello,

You can always run goals on the command line, even if they are not defined in the POM at all. If maven finds the plugin in the POM it knows what version to use and it allows to specify a Prefix instead of group:artifact[:version]:goal.
Gruss
Bernd

Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
From: Sigmond Hola <si...@gmail.com>
Sent: Saturday, February 24, 2018 7:01:04 AM
To: users@maven.apache.org
Subject: Why I can run plugin:goal in command line even though plugin was only defined under pluginManagement?

I defined a specific plugin under  <build><pluginManagement><plugins>, but
not under  <build><plugins>, but I can still run goals of this plugin with  mvn
plugin:goal.

As far as I understand<pluginManagement> is only used to configuring the
plugin information, but not actually import them, right? then how can I use
the goals of this plugin  in the command line?

Thanks for reply.

Bests.
--Sig