Anders --

That did it.  Thanks very much.

Solution summary:
- remove plugin from life-cycle,
- apply execution id "default-cli"
- contain plugin def by promoting it to build.pluginManagement element.

Working segment:
----------
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <executions>
            <execution>
              <id>default-cli</id>
              <goals>
                <goal>copy-dependencies</goal>
              </goals>
              <configuration>

<outputDirectory>${basedir}/war/WEB-INF/lib/</outputDirectory>
                <overWriteReleases>false</overWriteReleases>
                <overWriteSnapshots>false</overWriteSnapshots>
                <overWriteIfNewer>true</overWriteIfNewer>
                <excludeArtifactIds>gwt-user,gwt-dev</excludeArtifactIds>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      ...
    </plugins>
  </build>
----------

Cheers.


SF


On Mon, Oct 11, 2010 at 4:06 PM, Anders Hammar <[email protected]> wrote:

> The problem is that the configuration you have is written within the
> execution. That execution is NOT for your CLI usage.
>
> You have two options:
> 1. You need to use the somewhat magic id of "default-cli":
> http://maven.apache.org/guides/mini/guide-default-execution-ids.html
> 2. Move the configuration stuff outside of execution.
>
> Btw, I strongly recommend that you put this plugin stuff within the
> pluginManagement section instead as it is not to be bound to the lifecycle.
>
> /Anders
>
> On Mon, Oct 11, 2010 at 22:01, Steve Francolla <[email protected]>
> wrote:
>
> > I actually want to run it outside the lifecycle.  I've removed the
> <phase>
> > binding and run it with the same usage.  It runs but the output gets
> > written
> > to the default ${basedir}/target/dependency dir instead of the
> > outputDirectory I've overridden it with in the configuration.  Seems
> > clearly
> > broken there, unless I'm missing something.  Ideas?
> >
> > Thanks again.
> >
> >
> >
> >
> > On Mon, Oct 11, 2010 at 3:42 PM, Vincent Latombe
> > <[email protected]>wrote:
> >
> > > Hi,
> > >
> > > Your execution is attached to the lifecycle. You'll get the expected
> > > behaviour if you type mvn package, not by calling directly the mojo
> from
> > > command line.
> > >
> > > 2010/10/11 Steve Francolla <[email protected]>
> > >
> > > > Help!  My dependencies only ever get written to the default
> > > > ${basedir}/target/dependency dir.
> > > >
> > > > Usage:
> > > > mvn dependency:copy-dependencies
> > > >
> > > > Pom.xml segment:
> > > > ---------
> > > >  <profiles>
> > > >    <profile>
> > > >      <build>
> > > >        <plugins>
> > > >          <plugin>
> > > >            <groupId>org.apache.maven.plugins</groupId>
> > > >            <artifactId>maven-dependency-plugin</artifactId>
> > > >            <executions>
> > > >              <execution>
> > > >                <id>copy-dependencies</id>
> > > >                <phase>package</phase>
> > > >                <goals>
> > > >                  <goal>copy-dependencies</goal>
> > > >                </goals>
> > > >                <configuration>
> > > >
> > > > <outputDirectory>${basedir}/war/WEB-INF/lib/</outputDirectory>
> > > >                  <overWriteReleases>false</overWriteReleases>
> > > >                  <overWriteSnapshots>false</overWriteSnapshots>
> > > >                  <overWriteIfNewer>true</overWriteIfNewer>
> > > >
> > >  <excludeArtifactIds>gwt-user,gwt-dev</excludeArtifactIds>
> > > >                </configuration>
> > > >              </execution>
> > > >            </executions>
> > > >          </plugin>
> > > >        </plugins>
> > > >      </build>
> > > >    </profile>
> > > >  </profiles>
> > > > ---------
> > > >
> > > >
> > > > Thanks.
> > > >
> > > >
> > > > SF
> > > >
> > >
> > >
> > >
> > > --
> > > Vincent
> > >
> >
>

Reply via email to