how does copy-resources work

101 views Asked by At

I tried using maven-resources-plugin with goal copy resources.It copied all the resources to the output directory.I needed only a single jar.How to make it possible?

1

There are 1 answers

0
Sushma On

My requirement was to add a maven dependency to resources folder so atht I can add it to my Kie-Container and execute the rules residing inside the jar.I achieved it using maven-dependency-plugin with goal "copy".The mistake I did was not specifying the artifactItem.Afte I used artifactItem and included my jar description it worked.

             <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.4</version>
            <executions>
                <execution>
                    <id>copy</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>copy</goal>
                    </goals>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>SampleDroolsWBTest</groupId>
                                <artifactId>DroolsAPI</artifactId>
                                <version>2.0</version>
                                <overWrite>false</overWrite>
                                <outputDirectory>${basedir}/src</outputDirectory>
                                <includes>pom.xml</includes>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>