You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jaikiran <ja...@yahoo.co.in> on 2009/02/19 10:50:05 UTC
Change the default output location of test resources
I am using Maven-2.0.9 and trying to change the default output location of
the "test resources" (under src/test/resources). By default, they get copied
to target/tests-classes during mvn clean package. However, i want them to be
copied under my specific target/tests-resources folder. I followed the
maven-resources-plugin documentation and came up with this configuration in
my pom.xml:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>change-test-resource-outputdir</id>
<!-- here the phase you need -->
<phase>process-test-resources</phase>
<goals>
<goal>testResources</goal>
</goals>
<configuration>
<outputDirectory>target/test-resources</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
This works in a weird way. Based on what i see, the test resources are
copied twice, once to the default location (target/tests-classes) and once
to my specific directory (target/tests-resources). Here's what i see on the
console:
[INFO] [enforcer:enforce {execution: enforce-banned-dependencies}]
[INFO] [resources:resources]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [compiler:compile]
[INFO] Compiling 7 source files to /home/myhome...
[INFO] [resources:testResources]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO] [resources:testResources {execution: change-test-resource-outputdir}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO] [compiler:testCompile]
The resources:testResources seems to be called twice.
Is there any way i can avoid the tests resources from being copied to the
default output location?
--
View this message in context: http://www.nabble.com/Change-the-default-output-location-of-test-resources-tp22097054p22097054.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: Change the default output location of test resources
Posted by Jaikiran <ja...@yahoo.co.in>.
The reason why the resource:testResources is being run twice might be because
> The goals that are configured will be added to the goals already bound to
> the lifecycle from the packaging selected.
>
as documented in
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Plugins
On the #maven IRC i did get some inputs about using an alternate approach:
<build>
<testResources>
<testResource>
<directory>target/test-resources</directory>
</testResource>
</testResources>
</build>
But i haven't yet been able to get this working. The target/test-resources
is not created and the resources are not copied over.
--
View this message in context: http://www.nabble.com/Change-the-default-output-location-of-test-resources-tp22097054p22119883.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