On Tue, Mar 19, 2013 at 1:39 PM, virg g <[email protected]> wrote:

> Hi,
> Yes have added as two different artifactItems like this
> Since I have placed this in Parent POM, it was trying to copy even my
> PARENT artifact (parentProj) which is of Type POM.
> My Guess the PARENT POM is causing this issue, since its type POM, And i
> have added another section for this also as type pom, but it did not help.
> Is there anyaway to exclude Parent Artifact being copied?
> This is the error i am getting
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-dependency-plugin:
> 2.7:copy (copy-installed) on project parentProj: Unable to find artifact.
> Failure to find parentProj:jar:1.1-SNAPSHOT in
> http://repo1.maven.org/maven2was cached in the local repository,
> resolution will not be reattempted
> until the update interval of central has elapsed or updates are forced
>
> This is my sample conf
>
>                        <artifactItems>
>                                 <artifactItem>
>                                     <groupId>${project.groupId}</groupId>
>
> <artifactId>${project.artifactId}</artifactId>
>                                     <version>${project.version}</version>
>                                     <type>pom</type>
>                                     -----
>                                 </artifactItem>
>                                 <artifactItem>
>                                     <groupId>${project.groupId}</groupId>
>
> <artifactId>${project.artifactId}</artifactId>
>                                     <version>${project.version}</version>
>                                     <type>jar</type>
>                                     ---------
>                                 </artifactItem>
>                                 <artifactItem>
>                                     <groupId>${project.groupId}</groupId>
>
> <artifactId>${project.artifactId}</artifactId>
>                                     <version>${project.version}</version>
>                                     <type>war</type>
>                                     -----------
>                                 </artifactItem>
>                             </artifactItems>
>
>
I was suggested something like

                            <executions>
<execution>
<id>copy-jar</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeTypes>jar</includeTypes>
<outputDirectory>../../jar</outputDirectory>
</configuration>
</execution>
<execution>
<id>copy-war</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeTypes>war</includeTypes>
<outputDirectory>../../war</outputDirectory>
</configuration>
</execution>
</executions>

Also if I  understand it correctly the ${project*} variables are resolved
in the context of the parent project, so not exactly what you (seems to)
want.

What are you trying to achieve with this ?

On Tue, Mar 19, 2013 at 5:05 PM, Adrien Rivard <[email protected]
> >wrote:
>
> > Hi,
> > Have you try  to add two differents executions (with differents id), one
> > for type war the others for type jar ?
> >
> >
> > On Tue, Mar 19, 2013 at 10:51 AM, virg g <[email protected]> wrote:
> >
> > > HI,
> > > I have project which contains many modules and creates jars and wars.
> My
> > > Build structure is parent POM has all modules. I am placing all my
> > plugins
> > > in PARENT POM to be required to to applied all child modules. My
> > > requirement is to copy all these created jars to one location and wars
> to
> > > another location. I am using maven-dependency-plugin to do this. This
> is
> > > sample plugin. I have two issues with this.
> > > 1.  I am able to copy all the jars and wars to one folder, but not jars
> > to
> > > one folder and wars to another. Not able to distinguish
> > > 2. SInce i have placed this plugin in parent, along with all the jars
> and
> > > wars, from Parent POM type is POM it is copying project.pom to this
> > > location also. How to exclude project.pom being copied.
> > >
> > > Here is my plugin. I have added 2 artifactItems one for jar and another
> > > with war by mentioning TYPE as jar and war for each, also added
> excludes
> > > and includes, nothing worked. Any solution to my problem? Really it
> would
> > > be great help.
> > >
> > >              <plugin>
> > >                 <groupId>org.apache.maven.plugins</groupId>
> > >                 <artifactId>maven-dependency-plugin</artifactId>
> > >                 <version>2.7</version>
> > >                 <executions>
> > >                     <execution>
> > >                         <id>copy-installed</id>
> > >                         <phase>install</phase>
> > >                         <goals>
> > >                             <goal>copy</goal>
> > >                         </goals>
> > >                         <configuration>
> > >                             <artifactItems>
> > >                                 <artifactItem>
> > >
> <groupId>${project.groupId}</groupId>
> > >
> > >  <artifactId>${project.artifactId}</artifactId>
> > >
> <version>${project.version}</version>
> > >                                     <type>${project.packaging}</type>
> > >                                     <overWrite>true</overWrite>
> > >
> > >
>  <destFileName>${project.artifactId}.${project.packaging}</destFileName>
> > >                                 </artifactItem>
> > >                                </artifactItems>
> > >
> > >  <outputDirectory>../../${install.jar.folder}</outputDirectory>
> > >                         </configuration>
> > >                     </execution>
> > >                 </executions>
> > >             </plugin>
> > >
> > > Thanks
> > > Virg
> > >
> >
> >
> >
> > --
> > Adrien Rivard
> >
>



-- 
Adrien Rivard

Reply via email to