You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by hujirong <ji...@gmail.com> on 2012/07/03 22:43:20 UTC

Help me to understand this unpack-dependencies?

*Here is the part of the POM:*

~~~~~~~~~~~~~~~~~~~~``
    <plugins>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>unpack-scripts</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
             
<outputDirectory>${project.build.directory}/appscripts</outputDirectory>
              <excludeTransitive>true</excludeTransitive>
              <classifier>scripts</classifier>
              <type>zip</type>
             
<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
            </configuration>
          </execution>
        </executions>
      </plugin>

      
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
           
<descriptor>src/main/resources/assemblies/deployment-assembly.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <id>make</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.nbfg.fw.maven</groupId>
            <artifactId>assemblies</artifactId>
            <version>0.0.1-SNAPSHOT</version>
          </dependency>
        </dependencies>
      </plugin>

    </plugins>
  </build>

  
  <dependencies>

    <dependency>
      <groupId>com.nbfg.fw.wsadmin</groupId>
      <artifactId>dpllib</artifactId>
      <version>1.0.0-SNAPSHOT</version>
      <type>zip</type>
    </dependency>

  </dependencies>

  
  <profiles>
       <profile>
      <id>DEV</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <properties>
        <classifier>DEV</classifier>
      </properties>
      <dependencies>
        <dependency>
         	<groupId>com.nbfg.max.wesb</groupId>
			<artifactId>CDIPubSubMgmtMed</artifactId>
			<version>0.0.1-SNAPSHOT</version>
			<type>ear</type>
          	<classifier>App</classifier>
        </dependency>
      </dependencies>      
    </profile>

~~~~~~~~~~~~~~~~~~~~~~~~

*This is the command and output:*

C:\Sandbox\MDM\WESB>mvn package -P DEV
[INFO] Scanning for projects...
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building WESB Deployment R2-0.0.1-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.4:unpack-dependencies (unpack-scripts)
@ MDM-WESB ---
> isMarkerOlder:
[INFO] Unpacking
C:\Users\Administrator\.m2\repository\com\nbfg\max\wesb\CDIPubSubMgmtMed\0.0.1-SNAPSHOT\CDIPubSubMgmtMed-0.0.1-SNAPSHOT-scripts.zip
to C:\Sandbox\MDM\WESB\target\appscripts with includes "" and excludes ""
[INFO]
[INFO] --- maven-assembly-plugin:2.2-beta-5:single (make) @ MDM-WESB ---
[INFO] Reading assembly descriptor:
src/main/resources/assemblies/deployment-assembly.xml
[INFO] No files selected for line-ending conversion or filtering. Skipping:
C:\Sandbox\MDM\WESB\src\main\resources\commo
n
[WARNING] Cannot include project artifact:
com.nbfg.mdm.environments:MDM-WESB:pom:R2-0.0.1-SNAPSHOT; it doesn't have
anassociated file or directory.
[WARNING] Cannot include project artifact:
com.nbfg.mdm.environments:MDM-WESB:pom:R2-0.0.1-SNAPSHOT; it doesn't have
anassociated file or directory.
[INFO] scripts/sh already added, skipping
[INFO] Building zip:
C:\Sandbox\MDM\WESB\target\MDM-WESB-R2-0.0.1-SNAPSHOT-DEV.zip
[INFO] scripts/sh already added, skipping
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1.679s
[INFO] Finished at: Tue Jul 03 16:30:13 EDT 2012
[INFO] Final Memory: 15M/512M
[INFO]
------------------------------------------------------------------------
C:\Sandbox\MDM\WESB>

~~~~~~~~~~

*Questions:*

1. Where does this file comes from:
CDIPubSubMgmtMed-0.0.1-SNAPSHOT-scripts.zip? Why it's unpacking this file?

2. What does these two [WARNING] mean, and how to fix them?

3. Currently a "mvn deploy" to upload the final zip file onto Nexus. If I
want to upload the zip into each environment, how can I do that?

Thanks
Jirong

--
View this message in context: http://maven.40175.n5.nabble.com/Help-me-to-understand-this-unpack-dependencies-tp5712889.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help me to understand this unpack-dependencies?

Posted by Wayne Fay <wa...@gmail.com>.
> The project is depends on CDIPubSubMgmtMed-0.0.1-SNAPSHOT.zip, what does this
> <classifier>scripts</classifier> exactly do? I thought unpack will only

The use of classifier is documented on the Maven site. I'm sure you
can find it and/or Google for more info.

> Who created this CDIPubSubMgmtMed-0.0.1-SNAPSHOT-scripts.zip?

This is a GREAT question for YOUR people, ideally you can ask who ever
set this project up in the first place. How do you expect a random
person on the Internet to have full knowledge about your project, the
various modules, the code, etc and be able to answer these kinds of
questions?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help me to understand this unpack-dependencies?

Posted by hujirong <ji...@gmail.com>.
Thank you for the help, here is the result:

C:\Sandbox\MDM\WESB>mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building WESB Deployment R2-0.0.1-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.4:tree (default-cli) @ MDM-WESB ---
[INFO] com.nbfg.mdm.environments:MDM-WESB:pom:R2-0.0.1-SNAPSHOT
[INFO] \- com.nbfg.fw.wsadmin:dpllib:zip:1.0.0-SNAPSHOT:compile
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 0.823s
[INFO] Finished at: Wed Jul 04 11:19:09 EDT 2012
[INFO] Final Memory: 12M/512M
[INFO]
------------------------------------------------------------------------
C:\Sandbox\MDM\WESB>

--
View this message in context: http://maven.40175.n5.nabble.com/Help-me-to-understand-this-unpack-dependencies-tp5712889p5712989.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help me to understand this unpack-dependencies?

Posted by Jörg Schaible <Jo...@scalaris.com>.
Hi Jirong,

hujirong wrote:

> I found CDIPubSubMgmtMed-0.0.1-SNAPSHOT-scripts.zip in Nexus in this
> folder:
> local:8080/nexus/content/groups/mdm-
public/com/nbfg/max/wesb/CDIPubSubMgmtMed/0.0.1-SNAPSHOT/
> 
> So I guess because the project is depending on the following:
> 
>       <dependency>
>          <groupId>com.nbfg.max.wesb</groupId>
> <artifactId>CDIPubSubMgmtMed</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <type>ear</type>
>           <classifier>App</classifier>
>         </dependency>
> 
> The classifier makes it look for *scripts.zip in that folder.

Well, no.

> However, the
> Maven doc doesn't tell exactly how it works:
> http://maven.apache.org/plugins/maven-dependency-plugin/unpack-
dependencies-mojo.html#classifier

It works on the declared (or inherited) dependencies. You can implement a 
Mojo to look for artifacts of a different classifier, but I'd be really 
surprised if the assembly plugin does something like that. I'd bet that the 
script artifact is part of your dependency tree.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help me to understand this unpack-dependencies?

Posted by hujirong <ji...@gmail.com>.
I found CDIPubSubMgmtMed-0.0.1-SNAPSHOT-scripts.zip in Nexus in this folder:
local:8080/nexus/content/groups/mdm-public/com/nbfg/max/wesb/CDIPubSubMgmtMed/0.0.1-SNAPSHOT/

So I guess because the project is depending on the following:

      <dependency>
         	<groupId>com.nbfg.max.wesb</groupId>
			<artifactId>CDIPubSubMgmtMed</artifactId>
			<version>0.0.1-SNAPSHOT</version>
			<type>ear</type>
          	<classifier>App</classifier>
        </dependency>

The classifier makes it look for *scripts.zip in that folder. However, the
Maven doc doesn't tell exactly how it works:
http://maven.apache.org/plugins/maven-dependency-plugin/unpack-dependencies-mojo.html#classifier

Thanks guys.
Jirong

--
View this message in context: http://maven.40175.n5.nabble.com/Help-me-to-understand-this-unpack-dependencies-tp5712889p5712925.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help me to understand this unpack-dependencies?

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Jirong,

hujirong wrote:

> The project is depends on CDIPubSubMgmtMed-0.0.1-SNAPSHOT.zip, what does
> this <classifier>scripts</classifier> exactly do? I thought unpack will
> only download CDIPubSubMgmtMed-0.0.1-SNAPSHOT.zip and unpack to
> outputDirectory.

Right. However, you seem to inherit this dependency (with this classifier) 
from a parent. Please check with "mvn dependency:tree".

> Who created this
> CDIPubSubMgmtMed-0.0.1-SNAPSHOT-scripts.zip?

How should *we* know? This artifact is not in a public repository.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help me to understand this unpack-dependencies?

Posted by hujirong <ji...@gmail.com>.
The project is depends on CDIPubSubMgmtMed-0.0.1-SNAPSHOT.zip, what does this
<classifier>scripts</classifier> exactly do? I thought unpack will only
download CDIPubSubMgmtMed-0.0.1-SNAPSHOT.zip and unpack to outputDirectory.
Who created this CDIPubSubMgmtMed-0.0.1-SNAPSHOT-scripts.zip?

Thanks
Jirong

--
View this message in context: http://maven.40175.n5.nabble.com/Help-me-to-understand-this-unpack-dependencies-tp5712889p5712904.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help me to understand this unpack-dependencies?

Posted by hujirong <ji...@gmail.com>.
Wayne Fay wrote
> 
> Deploy has a particular meaning in the world of Maven, which means to
> "push the resulting build file into a Maven repo."
> 
> Maven doesn't really have a specific answer for how users should
> propagate their build artifacts to various environment-specific
> servers. This is seen as outside of Maven's core responsibility which
> is mostly to "build stuff." You may find the Cargo plugin to be
> helpful, or other plugins.
> 
> Wayne
> 
> 
Quoted from: 
http://maven.40175.n5.nabble.com/Help-me-to-understand-this-unpack-dependencies-tp5712889p5712897.html

I found this interesting article, almost answered all my questions. We can
use this unpack to download the deployment unit, extract it if this is run
from the server to be deployed. This can be done by run the build from a
build agent installed on this server. Then I just need to add another step
to run the deployment script been extracted from the zip.

http://www.sonatype.com/people/2008/04/how-to-share-resources-across-projects-in-maven/

--
View this message in context: http://maven.40175.n5.nabble.com/Help-me-to-understand-this-unpack-dependencies-tp5712889p5712927.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help me to understand this unpack-dependencies?

Posted by Wayne Fay <wa...@gmail.com>.
> 1. Where does this file comes from:
> CDIPubSubMgmtMed-0.0.1-SNAPSHOT-scripts.zip? Why it's unpacking this file?

This is why:
>               <classifier>scripts</classifier>
>               <type>zip</type>


> 3. Currently a "mvn deploy" to upload the final zip file onto Nexus. If I
> want to upload the zip into each environment, how can I do that?

Deploy has a particular meaning in the world of Maven, which means to
"push the resulting build file into a Maven repo."

Maven doesn't really have a specific answer for how users should
propagate their build artifacts to various environment-specific
servers. This is seen as outside of Maven's core responsibility which
is mostly to "build stuff." You may find the Cargo plugin to be
helpful, or other plugins.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org