Hi
Thank you. But this copies only the dependencies. But i want to copy all
the artifactids i.e my project build creats jars and wars, and i need to
copy all the jars with md5 to one location and wars with md5 to another
location. I used this sample code, could not understand why it is not
filtering based on types. it copies both jars and wars to same location
irrespective what type it is, it is ignoring
<includeTypes>jar</includeTypes>, where i am doing wrong. Any help is
highly appreciated. I have added different excutions section with
includeTypes as war, it copies all the files to both the folders.
<execution>
                        <id>copy-jar</id>
                        <phase>install</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <includeTypes>jar</includeTypes>
                            <overWrite>true</overWrite>
                            <outputDirectory>../../aa</outputDirectory>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>

<artifactId>${project.artifactId}</artifactId>
                                    <version>${project.version}</version>
                                    <type>${project.packaging}</type>
                                </artifactItem>
                            </artifactItems>
                         </configuration>
                    </execution>

Thanks
virg



>
>
> On Tue, Mar 19, 2013 at 7:55 PM, Adrien Rivard <adrien.riv...@gmail.com>wrote:
>
>> On Tue, Mar 19, 2013 at 1:39 PM, virg g <06v...@gmail.com> 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 <adrien.riv...@gmail.com
>> > >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 <06v...@gmail.com> 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