maven-dependency-plugin:unpack-dependencies doesn't always work

17 messages Options
Embed this post
Permalink
EJ Ciramella-2

maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
I'm having a bit of difficulty with unpacking some dependencies - and I'm not entirely sure why this process is failing.

In _some_ projects, we define the dependency we'd like to unpack within the plugin configuration - like this:

         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-dependency-plugin</artifactId>
           <version>2.1</version>
           <dependencies>
              <dependency>
                  <groupId> </groupId>
                  <artifactId> </artifactId>
                  <version></version>
                  <classifier>templates</classifier>
                  <scope>provided</scope>
                  <type>zip</type>
              </dependency>
           </dependencies>
           <executions>
              <execution>
                  <id>unpack- templates</id>
                  <phase>generate-resources</phase>
                  <goals>
                      <goal>unpack-dependencies</goal>
                  </goals>
                  <configuration>
                      <overWriteReleases>false</overWriteReleases>
                      <overWriteSnapshots>true</overWriteSnapshots>
                      <includeGroupIds> </includeGroupIds>
                      <includeArtifactIds> </includeArtifactIds>
                      <classifier>templates</classifier>
                      <type>zip</type>
                      <outputDirectory>target/foo</outputDirectory>
                  </configuration>
              </execution>
           </executions>
         </plugin>

In another project, if I copy and paste this block in, it not only doesn't unpack, but doesn't fail.  With -X -e, the debug output shows it saying "hey, I'm unpacking now" but there's nothing there.

Any suggestions?
EJ Ciramella-2

RE: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
I literally see it skipping the actual unpack (with no errors or warnings):

BAD:

[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies' -->
[DEBUG]   (f) classifier = default
[DEBUG]   (s) copyPom = false
[DEBUG]   (f) excludeTransitive = false
[DEBUG]   (s) failOnMissingClassifierArtifact = true
[DEBUG]   (f) includeArtifactIds = <ID>
[DEBUG]   (f) includeGroupIds = <GROUP>
[DEBUG]   (s) local = [local] -> file://E:/work/m2Repo
[DEBUG]   (s) markersDirectory = <MARKERS DIR>
[DEBUG]   (f) outputAbsoluteArtifactFilename = false
[DEBUG]   (s) outputDirectory = <OUTPUT DIR>
[DEBUG]   (f) overWriteIfNewer = true
[DEBUG]   (f) overWriteReleases = false
[DEBUG]   (f) overWriteSnapshots = true
<SNIP>
[DEBUG]   (f) silent = false
[DEBUG]   (s) stripVersion = false
[DEBUG]   (f) type = zip
[DEBUG]   (s) useRepositoryLayout = false
[DEBUG]   (s) useSubDirectoryPerArtifact = false
[DEBUG]   (s) useSubDirectoryPerType = false
[DEBUG] -- end configuration --
[INFO] [dependency:unpack-dependencies {execution: <EXECUTION ID>}]

GOOD:

[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies' -->
[DEBUG]   (f) classifier = templates
[DEBUG]   (s) copyPom = false
[DEBUG]   (f) excludeTransitive = false
[DEBUG]   (s) failOnMissingClassifierArtifact = true
[DEBUG]   (f) includeArtifactIds = <ID>
[DEBUG]   (f) includeGroupIds = <GROUP>
[DEBUG]   (s) local = [local] -> file://E:/work/m2Repo
[DEBUG]   (s) markersDirectory = <MARKERS DIR>
[DEBUG]   (f) outputAbsoluteArtifactFilename = false
[DEBUG]   (s) outputDirectory = <OUTPUT DIR>
[DEBUG]   (f) overWriteIfNewer = true
[DEBUG]   (f) overWriteReleases = false
[DEBUG]   (f) overWriteSnapshots = true
<SNIP>
[DEBUG]   (f) silent = false
[DEBUG]   (s) stripVersion = false
[DEBUG]   (f) type = zip
[DEBUG]   (s) useRepositoryLayout = false
[DEBUG]   (s) useSubDirectoryPerArtifact = false
[DEBUG]   (s) useSubDirectoryPerType = false
[DEBUG] -- end configuration --
[INFO] [dependency:unpack-dependencies {execution: <EXECUTION ID>}]
[DEBUG] Translating Artifacts using Classifier: templates and Type: zip
[INFO] Unpacking <PATH TO DEPENDENCY> to
<OUTPUT DIR>
   with includes null and excludes:null

Why is the first one not doing anything?!

-----Original Message-----
From: EJ Ciramella [mailto:[hidden email]]
Sent: Thursday, November 05, 2009 9:43 PM
To: [hidden email]
Subject: maven-dependency-plugin:unpack-dependencies doesn't always work

I'm having a bit of difficulty with unpacking some dependencies - and I'm not entirely sure why this process is failing.

In _some_ projects, we define the dependency we'd like to unpack within the plugin configuration - like this:

         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-dependency-plugin</artifactId>
           <version>2.1</version>
           <dependencies>
              <dependency>
                  <groupId> </groupId>
                  <artifactId> </artifactId>
                  <version></version>
                  <classifier>templates</classifier>
                  <scope>provided</scope>
                  <type>zip</type>
              </dependency>
           </dependencies>
           <executions>
              <execution>
                  <id>unpack- templates</id>
                  <phase>generate-resources</phase>
                  <goals>
                      <goal>unpack-dependencies</goal>
                  </goals>
                  <configuration>
                      <overWriteReleases>false</overWriteReleases>
                      <overWriteSnapshots>true</overWriteSnapshots>
                      <includeGroupIds> </includeGroupIds>
                      <includeArtifactIds> </includeArtifactIds>
                      <classifier>templates</classifier>
                      <type>zip</type>
                      <outputDirectory>target/foo</outputDirectory>
                  </configuration>
              </execution>
           </executions>
         </plugin>

In another project, if I copy and paste this block in, it not only doesn't unpack, but doesn't fail.  With -X -e, the debug output shows it saying "hey, I'm unpacking now" but there's nothing there.

Any suggestions?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

EJ Ciramella-2

RE: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
What's really wonky is if I change what dependency I'd like to unpack from the bad one to something like one of the apache commons jars, it works fine.

What else would make the dependency-unpack just choose NOT to unpack something?

-----Original Message-----
From: EJ Ciramella [mailto:[hidden email]]
Sent: Friday, November 06, 2009 2:54 PM
To: [hidden email]
Subject: RE: maven-dependency-plugin:unpack-dependencies doesn't always work

I literally see it skipping the actual unpack (with no errors or warnings):

BAD:

[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies' -->
[DEBUG]   (f) classifier = default
[DEBUG]   (s) copyPom = false
[DEBUG]   (f) excludeTransitive = false
[DEBUG]   (s) failOnMissingClassifierArtifact = true
[DEBUG]   (f) includeArtifactIds = <ID>
[DEBUG]   (f) includeGroupIds = <GROUP>
[DEBUG]   (s) local = [local] -> file://E:/work/m2Repo
[DEBUG]   (s) markersDirectory = <MARKERS DIR>
[DEBUG]   (f) outputAbsoluteArtifactFilename = false
[DEBUG]   (s) outputDirectory = <OUTPUT DIR>
[DEBUG]   (f) overWriteIfNewer = true
[DEBUG]   (f) overWriteReleases = false
[DEBUG]   (f) overWriteSnapshots = true
<SNIP>
[DEBUG]   (f) silent = false
[DEBUG]   (s) stripVersion = false
[DEBUG]   (f) type = zip
[DEBUG]   (s) useRepositoryLayout = false
[DEBUG]   (s) useSubDirectoryPerArtifact = false
[DEBUG]   (s) useSubDirectoryPerType = false
[DEBUG] -- end configuration --
[INFO] [dependency:unpack-dependencies {execution: <EXECUTION ID>}]

GOOD:

[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies' -->
[DEBUG]   (f) classifier = templates
[DEBUG]   (s) copyPom = false
[DEBUG]   (f) excludeTransitive = false
[DEBUG]   (s) failOnMissingClassifierArtifact = true
[DEBUG]   (f) includeArtifactIds = <ID>
[DEBUG]   (f) includeGroupIds = <GROUP>
[DEBUG]   (s) local = [local] -> file://E:/work/m2Repo
[DEBUG]   (s) markersDirectory = <MARKERS DIR>
[DEBUG]   (f) outputAbsoluteArtifactFilename = false
[DEBUG]   (s) outputDirectory = <OUTPUT DIR>
[DEBUG]   (f) overWriteIfNewer = true
[DEBUG]   (f) overWriteReleases = false
[DEBUG]   (f) overWriteSnapshots = true
<SNIP>
[DEBUG]   (f) silent = false
[DEBUG]   (s) stripVersion = false
[DEBUG]   (f) type = zip
[DEBUG]   (s) useRepositoryLayout = false
[DEBUG]   (s) useSubDirectoryPerArtifact = false
[DEBUG]   (s) useSubDirectoryPerType = false
[DEBUG] -- end configuration --
[INFO] [dependency:unpack-dependencies {execution: <EXECUTION ID>}]
[DEBUG] Translating Artifacts using Classifier: templates and Type: zip
[INFO] Unpacking <PATH TO DEPENDENCY> to
<OUTPUT DIR>
   with includes null and excludes:null

Why is the first one not doing anything?!

-----Original Message-----
From: EJ Ciramella [mailto:[hidden email]]
Sent: Thursday, November 05, 2009 9:43 PM
To: [hidden email]
Subject: maven-dependency-plugin:unpack-dependencies doesn't always work

I'm having a bit of difficulty with unpacking some dependencies - and I'm not entirely sure why this process is failing.

In _some_ projects, we define the dependency we'd like to unpack within the plugin configuration - like this:

         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-dependency-plugin</artifactId>
           <version>2.1</version>
           <dependencies>
              <dependency>
                  <groupId> </groupId>
                  <artifactId> </artifactId>
                  <version></version>
                  <classifier>templates</classifier>
                  <scope>provided</scope>
                  <type>zip</type>
              </dependency>
           </dependencies>
           <executions>
              <execution>
                  <id>unpack- templates</id>
                  <phase>generate-resources</phase>
                  <goals>
                      <goal>unpack-dependencies</goal>
                  </goals>
                  <configuration>
                      <overWriteReleases>false</overWriteReleases>
                      <overWriteSnapshots>true</overWriteSnapshots>
                      <includeGroupIds> </includeGroupIds>
                      <includeArtifactIds> </includeArtifactIds>
                      <classifier>templates</classifier>
                      <type>zip</type>
                      <outputDirectory>target/foo</outputDirectory>
                  </configuration>
              </execution>
           </executions>
         </plugin>

In another project, if I copy and paste this block in, it not only doesn't unpack, but doesn't fail.  With -X -e, the debug output shows it saying "hey, I'm unpacking now" but there's nothing there.

Any suggestions?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

EJ Ciramella-2

RE: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
Here's a perfect example of this _not_ working.  Anyone willing to try this out as well?

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>foo</groupId>
  <artifactId>bar</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>bar</name>
  <url>http://maven.apache.org</url>
  <build>
    <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-dependency-plugin</artifactId>
           <version>2.1</version>
           <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.0</version>
            </dependency>
           </dependencies>
           <executions>
              <execution>
                  <id>unpack-capi-templates</id>
                  <phase>generate-resources</phase>
                  <goals>
                      <goal>unpack-dependencies</goal>
                  </goals>
                  <configuration>
                      <overWriteReleases>false</overWriteReleases>
                      <overWriteSnapshots>true</overWriteSnapshots>
                      <includeGroupIds>junit</includeGroupIds>
                      <includeArtifactIds>junit</includeArtifactIds>
                      <type>jar</type>
                      <outputDirectory>target/junit</outputDirectory>
                  </configuration>
              </execution>
           </executions>
         </plugin>
    </plugins>
  </build>
</project>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Jörg Schaible

RE: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
EJ Ciramella wrote:

> Here's a perfect example of this _not_ working.  Anyone willing to try
> this out as well?

[snip]

I did not try it, but junit is typically of scope "test" and that's not the
default for the "unpack-dependencies" goal.

- Jörg



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Sony Antony

Re: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
My apologies if I didnt understand your Q correctly :
The following works for me
<plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.1</version>
            <executions>
               <execution>
                  <id>fetch-wsdls-and-schemas</id>
                  <phase>generate-sources</phase>
                  <goals>
                     <goal>unpack-dependencies</goal>
                  </goals>
                  <configuration>

<outputDirectory>${project.build.directory}/wsdls-and-schemas</outputDirect
ory>
                     <includeGroupIds>mygroupid</includeGroupIds>
                     <includeArtifacIds>sms-wsdlfiles</includeArtifacIds>
                     <excludeTransitive>true</excludeTransitive>
                  </configuration>
               </execution>
            </executions>
         </plugin>

Also I had to give teh dependency as the project dependency ( not inside the
plugin )
--sony

On Fri, Nov 6, 2009 at 4:19 PM, Jörg Schaible <[hidden email]> wrote:

> EJ Ciramella wrote:
>
> > Here's a perfect example of this _not_ working.  Anyone willing to try
> > this out as well?
>
> [snip]
>
> I did not try it, but junit is typically of scope "test" and that's not the
> default for the "unpack-dependencies" goal.
>
> - Jörg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Jörg Schaible

Re: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
Hi Sony,

Sony Antony wrote:

> My apologies if I didnt understand your Q correctly :
> The following works for me
> <plugin>
>             <artifactId>maven-dependency-plugin</artifactId>
>             <version>2.1</version>
>             <executions>
>                <execution>
>                   <id>fetch-wsdls-and-schemas</id>
>                   <phase>generate-sources</phase>
>                   <goals>
>                      <goal>unpack-dependencies</goal>
>                   </goals>
>                   <configuration>
>
>
<outputDirectory>${project.build.directory}/wsdls-and-schemas</outputDirect

> ory>
>                      <includeGroupIds>mygroupid</includeGroupIds>
>                      <includeArtifacIds>sms-wsdlfiles</includeArtifacIds>
>                      <excludeTransitive>true</excludeTransitive>
>                   </configuration>
>                </execution>
>             </executions>
>          </plugin>
>
> Also I had to give teh dependency as the project dependency ( not inside
> the plugin )

Good catch, I did not notice this. The dependency-plugin works on the
proejct's deps, not on the deps of the plugin itself.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

EJ Ciramella-2

RE: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jörg Schaible
Of course - I'm aware of that, it was just the first jar I could copy/paste into this example.

It could be an arbitrary jar.

-----Original Message-----
From: news [mailto:[hidden email]] On Behalf Of Jörg Schaible
Sent: Friday, November 06, 2009 4:20 PM
To: [hidden email]
Subject: RE: maven-dependency-plugin:unpack-dependencies doesn't always work

EJ Ciramella wrote:

> Here's a perfect example of this _not_ working.  Anyone willing to try
> this out as well?

[snip]

I did not try it, but junit is typically of scope "test" and that's not the
default for the "unpack-dependencies" goal.

- Jörg



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

EJ Ciramella-2

RE: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
In reply to this post by Sony Antony
Right - that's my question exactly.

We (in our real env) specify two dependencies in the plugin.  One of them is unpacked, the other is not.

The (bad) solution is to put both things in the overall project dependency listings.  I'm just not sure why something would skip unpacking.

I think it's something with the second artifact, as I type, I tried swapping out our second zip with the junit jar (and it works).

There is no error by the way, it just says it's unpacking, but doesn't.

-----Original Message-----
From: Sony Antony [mailto:[hidden email]]
Sent: Friday, November 06, 2009 4:59 PM
To: Maven Users List; [hidden email]
Subject: Re: maven-dependency-plugin:unpack-dependencies doesn't always work

My apologies if I didnt understand your Q correctly :
The following works for me
<plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.1</version>
            <executions>
               <execution>
                  <id>fetch-wsdls-and-schemas</id>
                  <phase>generate-sources</phase>
                  <goals>
                     <goal>unpack-dependencies</goal>
                  </goals>
                  <configuration>

<outputDirectory>${project.build.directory}/wsdls-and-schemas</outputDirect
ory>
                     <includeGroupIds>mygroupid</includeGroupIds>
                     <includeArtifacIds>sms-wsdlfiles</includeArtifacIds>
                     <excludeTransitive>true</excludeTransitive>
                  </configuration>
               </execution>
            </executions>
         </plugin>

Also I had to give teh dependency as the project dependency ( not inside the
plugin )
--sony

On Fri, Nov 6, 2009 at 4:19 PM, Jörg Schaible <[hidden email]> wrote:

> EJ Ciramella wrote:
>
> > Here's a perfect example of this _not_ working.  Anyone willing to try
> > this out as well?
>
> [snip]
>
> I did not try it, but junit is typically of scope "test" and that's not the
> default for the "unpack-dependencies" goal.
>
> - Jörg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

EJ Ciramella-2

RE: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jörg Schaible
This is really strange then - one dependency (within the plugin) is unpacked, the second one isn't.

I don't see the one that does get unpacked listed (even as a transitive dependency) anywhere (via dependency:tree).

Also, if I throw in junit and (you pick a second dependency), it unpacks both successfully....

If it's set in stone that the plugin operates ONLY on the project dependency list (and not the plugin dependency list), I'd really love to understand the inconsistency I'm seeing before putting the dependencies in the project dependency list.

-----Original Message-----
From: news [mailto:[hidden email]] On Behalf Of Jörg Schaible
Sent: Friday, November 06, 2009 5:24 PM
To: [hidden email]
Subject: Re: maven-dependency-plugin:unpack-dependencies doesn't always work

Hi Sony,

Sony Antony wrote:

> My apologies if I didnt understand your Q correctly :
> The following works for me
> <plugin>
>             <artifactId>maven-dependency-plugin</artifactId>
>             <version>2.1</version>
>             <executions>
>                <execution>
>                   <id>fetch-wsdls-and-schemas</id>
>                   <phase>generate-sources</phase>
>                   <goals>
>                      <goal>unpack-dependencies</goal>
>                   </goals>
>                   <configuration>
>
>
<outputDirectory>${project.build.directory}/wsdls-and-schemas</outputDirect

> ory>
>                      <includeGroupIds>mygroupid</includeGroupIds>
>                      <includeArtifacIds>sms-wsdlfiles</includeArtifacIds>
>                      <excludeTransitive>true</excludeTransitive>
>                   </configuration>
>                </execution>
>             </executions>
>          </plugin>
>
> Also I had to give teh dependency as the project dependency ( not inside
> the plugin )

Good catch, I did not notice this. The dependency-plugin works on the
proejct's deps, not on the deps of the plugin itself.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Sony Antony

Re: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
In reply to this post by EJ Ciramella-2
did you explicitly give teh <type> for the zip artifact ?
--sony

On Fri, Nov 6, 2009 at 5:50 PM, EJ Ciramella <[hidden email]>wrote:

> Right - that's my question exactly.
>
> We (in our real env) specify two dependencies in the plugin.  One of them
> is unpacked, the other is not.
>
> The (bad) solution is to put both things in the overall project dependency
> listings.  I'm just not sure why something would skip unpacking.
>
> I think it's something with the second artifact, as I type, I tried
> swapping out our second zip with the junit jar (and it works).
>
> There is no error by the way, it just says it's unpacking, but doesn't.
>
> -----Original Message-----
> From: Sony Antony [mailto:[hidden email]]
> Sent: Friday, November 06, 2009 4:59 PM
> To: Maven Users List; [hidden email]
> Subject: Re: maven-dependency-plugin:unpack-dependencies doesn't always
> work
>
> My apologies if I didnt understand your Q correctly :
> The following works for me
> <plugin>
>            <artifactId>maven-dependency-plugin</artifactId>
>            <version>2.1</version>
>            <executions>
>               <execution>
>                  <id>fetch-wsdls-and-schemas</id>
>                  <phase>generate-sources</phase>
>                  <goals>
>                     <goal>unpack-dependencies</goal>
>                  </goals>
>                  <configuration>
>
> <outputDirectory>${project.build.directory}/wsdls-and-schemas</outputDirect
> ory>
>                     <includeGroupIds>mygroupid</includeGroupIds>
>                     <includeArtifacIds>sms-wsdlfiles</includeArtifacIds>
>                     <excludeTransitive>true</excludeTransitive>
>                  </configuration>
>               </execution>
>            </executions>
>         </plugin>
>
> Also I had to give teh dependency as the project dependency ( not inside
> the
> plugin )
> --sony
>
> On Fri, Nov 6, 2009 at 4:19 PM, Jörg Schaible <[hidden email]>
> wrote:
>
> > EJ Ciramella wrote:
> >
> > > Here's a perfect example of this _not_ working.  Anyone willing to try
> > > this out as well?
> >
> > [snip]
> >
> > I did not try it, but junit is typically of scope "test" and that's not
> the
> > default for the "unpack-dependencies" goal.
> >
> > - Jörg
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Brian Fox-3-3

Re: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
if you do a clean build does it unpack? Just wondering if it's seeing
the marker file in target/dependencies and deciding to not unpack
again.

On Fri, Nov 6, 2009 at 4:02 PM, Sony Antony <[hidden email]> wrote:

> did you explicitly give teh <type> for the zip artifact ?
> --sony
>
> On Fri, Nov 6, 2009 at 5:50 PM, EJ Ciramella <[hidden email]>wrote:
>
>> Right - that's my question exactly.
>>
>> We (in our real env) specify two dependencies in the plugin.  One of them
>> is unpacked, the other is not.
>>
>> The (bad) solution is to put both things in the overall project dependency
>> listings.  I'm just not sure why something would skip unpacking.
>>
>> I think it's something with the second artifact, as I type, I tried
>> swapping out our second zip with the junit jar (and it works).
>>
>> There is no error by the way, it just says it's unpacking, but doesn't.
>>
>> -----Original Message-----
>> From: Sony Antony [mailto:[hidden email]]
>> Sent: Friday, November 06, 2009 4:59 PM
>> To: Maven Users List; [hidden email]
>> Subject: Re: maven-dependency-plugin:unpack-dependencies doesn't always
>> work
>>
>> My apologies if I didnt understand your Q correctly :
>> The following works for me
>> <plugin>
>>            <artifactId>maven-dependency-plugin</artifactId>
>>            <version>2.1</version>
>>            <executions>
>>               <execution>
>>                  <id>fetch-wsdls-and-schemas</id>
>>                  <phase>generate-sources</phase>
>>                  <goals>
>>                     <goal>unpack-dependencies</goal>
>>                  </goals>
>>                  <configuration>
>>
>> <outputDirectory>${project.build.directory}/wsdls-and-schemas</outputDirect
>> ory>
>>                     <includeGroupIds>mygroupid</includeGroupIds>
>>                     <includeArtifacIds>sms-wsdlfiles</includeArtifacIds>
>>                     <excludeTransitive>true</excludeTransitive>
>>                  </configuration>
>>               </execution>
>>            </executions>
>>         </plugin>
>>
>> Also I had to give teh dependency as the project dependency ( not inside
>> the
>> plugin )
>> --sony
>>
>> On Fri, Nov 6, 2009 at 4:19 PM, Jörg Schaible <[hidden email]>
>> wrote:
>>
>> > EJ Ciramella wrote:
>> >
>> > > Here's a perfect example of this _not_ working.  Anyone willing to try
>> > > this out as well?
>> >
>> > [snip]
>> >
>> > I did not try it, but junit is typically of scope "test" and that's not
>> the
>> > default for the "unpack-dependencies" goal.
>> >
>> > - Jörg
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [hidden email]
>> > For additional commands, e-mail: [hidden email]
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

EJ Ciramella-2

RE: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
In reply to this post by Sony Antony
Yes - I gave it everything - classifier, type and when that didn't work - scope as well - this is what I put in my original email:

         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-dependency-plugin</artifactId>
           <version>2.1</version>
           <dependencies>
              <dependency>
                  <groupId> </groupId>
                  <artifactId> </artifactId>
                  <version></version>
                  <classifier>templates</classifier>
                  <scope>provided</scope>
                  <type>zip</type>
              </dependency>
           </dependencies>
           <executions>
              <execution>
                  <id>unpack-templates</id>
                  <phase>generate-resources</phase>
                  <goals>
                      <goal>unpack-dependencies</goal>
                  </goals>
                  <configuration>
                      <overWriteReleases>false</overWriteReleases>
                      <overWriteSnapshots>true</overWriteSnapshots>
                      <includeGroupIds> </includeGroupIds>
                      <includeArtifactIds> </includeArtifactIds>
                      <classifier>templates</classifier>
                      <type>zip</type>
                      <outputDirectory>target/foo</outputDirectory>
                  </configuration>
              </execution>
           </executions>
         </plugin>

Everything is filled out, looks like the mailing list snipped out something, so it isn't a misconfiguration.  Again, two dependencies, one works, one doesn't.

Even with just classifier and type (which is the minimum we need in order to find this dependency), I saw this (taken from my earlier email):

....
[DEBUG] -- end configuration --
[INFO] [dependency:unpack-dependencies {execution: <EXECUTION ID>}]

The one dependency that it does find/extract says this:

...
[DEBUG] -- end configuration --
[INFO] [dependency:unpack-dependencies {execution: <EXECUTION ID>}] [DEBUG] Translating Artifacts using Classifier: templates and Type: zip [INFO] Unpacking <PATH TO DEPENDENCY> to <OUTPUT DIR>
   with includes null and excludes:null




-----Original Message-----
From: Sony Antony [mailto:[hidden email]]
Sent: Friday, November 06, 2009 7:03 PM
To: Maven Users List
Subject: Re: maven-dependency-plugin:unpack-dependencies doesn't always work

did you explicitly give teh <type> for the zip artifact ?
--sony

On Fri, Nov 6, 2009 at 5:50 PM, EJ Ciramella <[hidden email]>wrote:

> Right - that's my question exactly.
>
> We (in our real env) specify two dependencies in the plugin.  One of them
> is unpacked, the other is not.
>
> The (bad) solution is to put both things in the overall project dependency
> listings.  I'm just not sure why something would skip unpacking.
>
> I think it's something with the second artifact, as I type, I tried
> swapping out our second zip with the junit jar (and it works).
>
> There is no error by the way, it just says it's unpacking, but doesn't.
>
> -----Original Message-----
> From: Sony Antony [mailto:[hidden email]]
> Sent: Friday, November 06, 2009 4:59 PM
> To: Maven Users List; [hidden email]
> Subject: Re: maven-dependency-plugin:unpack-dependencies doesn't always
> work
>
> My apologies if I didnt understand your Q correctly :
> The following works for me
> <plugin>
>            <artifactId>maven-dependency-plugin</artifactId>
>            <version>2.1</version>
>            <executions>
>               <execution>
>                  <id>fetch-wsdls-and-schemas</id>
>                  <phase>generate-sources</phase>
>                  <goals>
>                     <goal>unpack-dependencies</goal>
>                  </goals>
>                  <configuration>
>
> <outputDirectory>${project.build.directory}/wsdls-and-schemas</outputDirect
> ory>
>                     <includeGroupIds>mygroupid</includeGroupIds>
>                     <includeArtifacIds>sms-wsdlfiles</includeArtifacIds>
>                     <excludeTransitive>true</excludeTransitive>
>                  </configuration>
>               </execution>
>            </executions>
>         </plugin>
>
> Also I had to give teh dependency as the project dependency ( not inside
> the
> plugin )
> --sony
>
> On Fri, Nov 6, 2009 at 4:19 PM, Jörg Schaible <[hidden email]>
> wrote:
>
> > EJ Ciramella wrote:
> >
> > > Here's a perfect example of this _not_ working.  Anyone willing to try
> > > this out as well?
> >
> > [snip]
> >
> > I did not try it, but junit is typically of scope "test" and that's not
> the
> > default for the "unpack-dependencies" goal.
> >
> > - Jörg
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

EJ Ciramella-2

RE: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
In reply to this post by Brian Fox-3-3
Nope - there are no markers created.  Period.
Good thinking though!

Any other suggestions what may be wrong with this artifact?  It opens just fine in winzip.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Brian Fox-3-3

Re: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
I would expect an error, I can only suggest attaching a debugger to
the plugin and see what's going on.

On Mon, Nov 9, 2009 at 9:06 AM, EJ Ciramella <[hidden email]> wrote:

> Nope - there are no markers created.  Period.
> Good thinking though!
>
> Any other suggestions what may be wrong with this artifact?  It opens just fine in winzip.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Sony Antony

Re: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
yes it doesn't work of used more than once.
I came across it yesterday. I had two execution blocks, unpacking two
diff jars at two diff phases. only one of them was unpacked and there
was no error.
I ended working around it by chanding the second goal to copy. I then
unjar ed it using antrun.
--sony

On 11/9/09, Brian Fox <[hidden email]> wrote:

> I would expect an error, I can only suggest attaching a debugger to
> the plugin and see what's going on.
>
> On Mon, Nov 9, 2009 at 9:06 AM, EJ Ciramella <[hidden email]>
> wrote:
>> Nope - there are no markers created.  Period.
>> Good thinking though!
>>
>> Any other suggestions what may be wrong with this artifact?  It opens just
>> fine in winzip.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Brian Fox-3-3

Re: maven-dependency-plugin:unpack-dependencies doesn't always work

Reply Threaded More More options
Print post
Permalink
Just set overWrite=true

On Mon, Nov 9, 2009 at 4:12 PM, Sony Antony <[hidden email]> wrote:

> yes it doesn't work of used more than once.
> I came across it yesterday. I had two execution blocks, unpacking two
> diff jars at two diff phases. only one of them was unpacked and there
> was no error.
> I ended working around it by chanding the second goal to copy. I then
> unjar ed it using antrun.
> --sony
>
> On 11/9/09, Brian Fox <[hidden email]> wrote:
>> I would expect an error, I can only suggest attaching a debugger to
>> the plugin and see what's going on.
>>
>> On Mon, Nov 9, 2009 at 9:06 AM, EJ Ciramella <[hidden email]>
>> wrote:
>>> Nope - there are no markers created.  Period.
>>> Good thinking though!
>>>
>>> Any other suggestions what may be wrong with this artifact?  It opens just
>>> fine in winzip.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]