maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Latombe <vincent.lato...@gmail.com>
Subject Re: Initialize not running during Install?
Date Tue, 05 Mar 2013 09:57:57 GMT
Hi,

what you are trying to do cannot work within one maven execution.

In your case, mvn initialize works because maven-install-plugin doesn't
require dependencies of the project, so the build plan can be executed.

mvn install cannot work, because dependencies are resolved before any
plugin part of the build plan gets executed. The build plan includes a
maven-compiler-plugin execution, which requires compile dependencies. The
dependency doesn't exist, so it cannot run the build plan.

The best practice for this case is to rely on an MRM to store artifacts not
already in a maven repository. Other solutions include a setUp script meant
to be run before the first maven execution.

Regards,

Vincent


2013/3/1 Anders Hammar <anders@hammar.net>

> I doubt that this plugin is not executed when you perform a "mvn install"
> if it executes for "mvn initialize". If it would be the case, it's a bug in
> Maven core.
>
> If you're using Maven 3, the console output will very clearly state the
> plugins being executed. Could you execute "mvn install" and ensure the
> plugin is not being executed. Compare to the output of "mvn initialize".
>
> If you still think something is wrong, we need a test case to try to
> reproduce.
>
> /Anders
>
>
> On Thu, Feb 28, 2013 at 3:47 PM, Macbeth, Andrew (US SSA) <
> andrew.macbeth@baesystems.com> wrote:
>
> >  I am attempting to configure maven-install-plugin:install-file in my
> > pom.xml. I want to install a third-party jar into my local repo. I prefer
> > to run this in the pom.xml instead of command line so that developers on
> > the team are unaffected and do not have to manually perform the install.
> An
> > extract from my pom.xml is below. <install-file> is set to run during the
> > initialize phase. When I execute “mvn initialize” the jar is successfully
> > installed into my local repo. However, when I run “mvn install”, it does
> > not get installed (yes, I am clearing out the local repo between runs).
> > Very puzzling. I have attached the parent and module poms, and the debug
> > outputs from mvn initialize and mvn install.****
> >
> > Help.****
> >
> > ** **
> >
> > <project>****
> >
> >                <build>****
> >
> >                               <plugins>****
> >
> >                                              <plugin>****
> >
> >
> > <groupId>org.apache.maven.plugins</groupId>****
> >
> >
> > <artifactId>maven-install-plugin</artifactId>****
> >
> >
> > <version>2.4</version>****
> >
> >
> <executions>**
> > **
> >
> >
> > <execution>****
> >
> >
> > <id>install-jnetpcap</id>****
> >
> >
> > <phase>initialize</phase>****
> >
> >
> > <goals>****
> >
> >
> > <goal>install-file</goal>****
> >
> >
> > </goals>****
> >
> >
> > <configuration>****
> >
> >
> > <groupId>jnetpcap</groupId>****
> >
> >
> > <artifactId>jnetpcap</artifactId>****
> >
> >
> > <version>1.3.0</version>****
> >
> >
> > <packaging>jar</packaging>****
> >
> >
> >                <file>${project.basedir}/lib/jnetpcap.jar</file>****
> >
> >
> > <generatePom>true</generatePom>****
> >
> >
> > </configuration>****
> >
> >
> > </execution>****
> >
> >
> </executions>*
> > ***
> >
> >                                              </plugin>****
> >
> >                               </plugins>****
> >
> >                </build>****
> >
> > </project>****
> >
> > ** **
> >
> > ** **
> >
> > Andrew J. Macbeth****
> >
> > BAE Systems, Inc., ES-AIT****
> >
> > 6 New England Executive Park, Burlington, MA****
> >
> > (781) 262-4742****
> >
> > ** **
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>

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