maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Baptiste Mathus <bmat...@batmat.net>
Subject Re: orders of plug-in
Date Mon, 06 Apr 2015 05:03:11 GMT
Exactly.
See
https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Built-in_Lifecycle_Bindings
for reference.

Cheers

2015-04-05 22:45 GMT+02:00 Lin Ma <linlma@gmail.com>:

> Thanks Karl,
>
> Does it mean compiler plug-in have two defined goals in the plug-in,
> compile goal and testCompile goal. Compile goal binds to compile phase of
> default lifecycle, and testCompile goal binds to test-compile phase of
> default lifecycle?
>
> regards,
> Lin
>
> On Sun, Apr 5, 2015 at 12:40 PM, Karl Heinz Marbaise <khmarbaise@gmx.de>
> wrote:
>
> > Hi Lin,
> >
> > On 4/5/15 9:32 PM, Lin Ma wrote:
> >
> >> Thanks Karl for the patience for descriptions,
> >>
> >> Wondering how to see in which phase a plug-in bound to? For example, in
> >> the below plug-in, it does not have any phase element.
> >>
> >
> > In this case I know that it is bound to compile as well as test-compile
> > AND it is documented in the docs of the plugin[1][2]:
> >
> > There you find a list:
> >
> > Attributes:
> >
> >  * Requires a Maven project to be executed.
> >  * Requires dependency resolution of artifacts in scope: compile.
> >  * The goal is thread-safe and supports parallel builds.
> >  * Since version: 2.0.
> >  * Binds by default to the lifecycle phase: compile.
> >
> > and the last one defines in which life cycle phase the plugin goal will
> be
> > executed by default. This means you don't need to give the life cycle
> phase
> > in the pom file, but of course you can which means you would like to
> change
> > the given default.
> >
> >
> > [1]: https://maven.apache.org/plugins/maven-compiler-plugin/
> > compile-mojo.html
> > [2]: https://maven.apache.org/plugins/maven-compiler-plugin/
> > testCompile-mojo.html
> >
> >
> >> <plugin>
> >>      <artifactId>maven-compiler-plugin</artifactId>
> >>      <version>2.3.2</version>
> >>      <configuration>
> >>          <source>1.5</source>
> >>          <target>1.5</target>
> >>      </configuration>
> >> </plugin>
> >>
> >> regards,
> >> Lin
> >>
> >> On Sun, Apr 5, 2015 at 7:04 AM, Karl Heinz Marbaise <khmarbaise@gmx.de
> >> <mailto:khmarbaise@gmx.de>> wrote:
> >>
> >>     Hi,
> >>
> >>     On 4/5/15 1:52 AM, Lin Ma wrote:
> >>
> >>         Hi Karl,
> >>
> >>         I am testing below plug-in, for example, I tried put it as the
> >>         first/last
> >>         element of "<plugins>", and the same results,
> >>
> >>
> >>     The change in the position does not influence the execution order.
> >>     This is defined by the phase you have bound the plugin to which in
> >>     this case is the package phase.
> >>
> >>     The two executions you have here will running on the order of
> >>     definition in the pom (copy-dependencies, copy-source)...
> >>
> >>
> >>     The question is what you like to achieve with the
> >>     maven-dependency-plugin....It looks like you are trying to create an
> >>     distribution archive (like tar.gz / zip etc.) ...Than you should go
> >>     an other path instead of maven-dependency-plugin....
> >>
> >>
> >>     ?
> >>
> >>     Kind regards
> >>     Karl Heinz Marbaise
> >>
> >>
> >>         <plugin>
> >>               <groupId>org.apache.maven.__plugins</groupId>
> >>               <artifactId>maven-dependency-__plugin</artifactId>
> >>               <version>2.5</version>
> >>               <executions>
> >>                   <execution>
> >>                       <id>copy-dependencies</id>
> >>                       <phase>package</phase>
> >>                       <goals>
> >>                           <goal>copy-dependencies</goal>
> >>                       </goals>
> >>                       <configuration>
> >>
> >>           <outputDirectory>${project.__basedir}/../lib/</__
> >> outputDirectory>
> >>                           <overWriteReleases>false</__overWriteReleases>
> >>                           <overWriteSnapshots>false</__
> >> overWriteSnapshots>
> >>                           <overWriteIfNewer>true</__overWriteIfNewer>
> >>
> >>           <useSubDirectoryPerScope>true<__/useSubDirectoryPerScope>
> >>                       </configuration>
> >>                   </execution>
> >>                   <execution>
> >>                       <id>copy-sources</id>
> >>                       <phase>package</phase>
> >>                       <goals>
> >>                           <goal>copy-dependencies</goal>
> >>                       </goals>
> >>                       <configuration>
> >>
> >>         <outputDirectory>${project.__basedir}/../lib/source</__
> >> outputDirectory>
> >>                           <overWriteReleases>false</__overWriteReleases>
> >>                           <overWriteSnapshots>false</__
> >> overWriteSnapshots>
> >>                           <overWriteIfNewer>true</__overWriteIfNewer>
> >>
> >>           <useSubDirectoryPerScope>true<__/useSubDirectoryPerScope>
> >>                           <classifier>sources</__classifier>
> >>                       </configuration>
> >>                   </execution>
> >>
> >>               </executions>
> >>
> >>         </plugin>
> >>
> >>         regards,
> >>         Lin
> >>
> >>         On Sat, Apr 4, 2015 at 4:23 PM, Karl Heinz Marbaise
> >>         <khmarbaise@gmx.de <mailto:khmarbaise@gmx.de>>
> >>         wrote:
> >>
> >>             Hi,
> >>
> >>             On 4/5/15 1:09 AM, Lin Ma wrote:
> >>
> >>                 Hello everyone,
> >>
> >>                 I tried to manipulate orders of plug-in in pom.xml and
> >>                 always get the same
> >>                 results.
> >>
> >>
> >>             Of which plugins would you like to change the execution
> >>             order? And for
> >>             what purpose?
> >>
> >>
> >>                    Wondering if any impact for order or plug-in, and any
> >>                 best
> >>
> >>
> >>                 practices? Thanks.
> >>
> >>
> >>             So the order of executions is defined by the binding to the
> >>             appropriate
> >>             life cycle .... as you can see here:
> >>
> >>             http://maven.apache.org/ref/3.__3.1/maven-core/default-__
> >> bindings.html
> >>             <http://maven.apache.org/ref/3.3.1/maven-core/default-
> >> bindings.html>
> >>
> >>
> >>             Or are you talking about execution order within the same
> >>             life cycle phase?
> >>
> >>
> >>             Kind regards
> >>             Karl Heinz Marbaise
> >>
> >>
> >>     ------------------------------__----------------------------
> >> --__---------
> >>     To unsubscribe, e-mail: users-unsubscribe@maven.__apache.org
> >>     <mailto:users-unsubscribe@maven.apache.org>
> >>     For additional commands, e-mail: users-help@maven.apache.org
> >>     <mailto:users-help@maven.apache.org>
> >>
> >>
> >>
> >
> > Mit freundlichem Gruß
> > 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
> >
>



-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message