You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mate Varga <ma...@gmail.com> on 2010/12/17 11:25:28 UTC
ant task runs twice
Hello,
I've got an Ant task which is bound to 'generate-resources' phase. If I try
to deploy the project, the task gets executed twice (before and after the
tests).
Any ideas about how could I prevent that?
# 'release' and 'local' are my own profiles.
(~/)\>mvn -P release,-local clean deploy -DskipTests=true
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building xxx 43
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ cache ---
[INFO] Deleting /xxx
[INFO]
[INFO] --- maven-antrun-plugin:1.6:run (generate-wireformats) @ cache ---
[INFO] Executing tasks
main:
[echo] compile classpath: ${maven.compile.classpath}
[generator] Writing wireformat config file with classloader URLs: /xxx
[generator] Writing wireformat config file with relative file URLs: /xxx
[INFO] Executed tasks
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @
cache ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ cache ---
[INFO] Compiling 100 source files to /xxx
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources
(default-testResources) @ cache ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @
cache ---
[INFO] Compiling 20 source files to /xxx
[INFO]
[INFO] --- maven-surefire-plugin:2.5:test (default-test) @ cache ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-antrun-plugin:1.6:run (generate-wireformats) @ cache ---
[INFO] Executing tasks
Thanks,
Mate
activating a profile by two environment variables/values
Posted by Hauschel Fred Robert <Fr...@Cirquent.de>.
Hi,
I have four profiles
prodDeps, prodResources, devDeps, devResources.
If I set ENVIRONMENT=devContainer -> prodDeps and devResources should be activated
If I set ENVIRONMENT=prodContainer -> prodDeps and prodResources should be activated
If I set ENVIRONMENT=eclipse -> devDeps and devResources should be activated
So I need something like this:
<activation>
<property>
<name>env.ENVIRONMENT</name>
<value>prodContainer,devContainer</value>
</property>
</activation>
Is there any possibility to do something like this?
The activation and the property cardinality in the xsd is 0..1 ;-(
Thanks Fredy
Re: ant task runs twice
Posted by Mate Varga <ma...@gmail.com>.
Never mind, I've spend half day with this and it was my fault. :(
(
mvn -Drelease-version=43 -P release,-local clean test deploy
)
test / deploy both run tests.
On Fri, Dec 17, 2010 at 10:35 AM, Mate Varga <ma...@gmail.com> wrote:
> It also seems that this has nothing to do with whatever lifecycle is the
> task bound to. Even if the POM looks like below, it runs twice:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-antrun-plugin</artifactId>
> <version>1.6</version>
> <executions>
> <execution>
> <id>generate-wireformats</id>
> <phase>validate</phase>
> <configuration>
> <target>
> <echo message="executing"/>
> </target>
> </configuration>
> <goals>
> <goal>run</goal>
> </goals>
> </execution>
> ...
>
> On Fri, Dec 17, 2010 at 10:25 AM, Mate Varga <ma...@gmail.com> wrote:
>
>> Hello,
>>
>> I've got an Ant task which is bound to 'generate-resources' phase. If I
>> try to deploy the project, the task gets executed twice (before and after
>> the tests).
>> Any ideas about how could I prevent that?
>>
>> # 'release' and 'local' are my own profiles.
>>
>> (~/)\>mvn -P release,-local clean deploy -DskipTests=true
>>
>> [INFO]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building xxx 43
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO]
>> [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ cache ---
>> [INFO] Deleting /xxx
>> [INFO]
>> [INFO] --- maven-antrun-plugin:1.6:run (generate-wireformats) @ cache ---
>> [INFO] Executing tasks
>>
>> main:
>> [echo] compile classpath: ${maven.compile.classpath}
>> [generator] Writing wireformat config file with classloader URLs: /xxx
>> [generator] Writing wireformat config file with relative file URLs: /xxx
>>
>> [INFO] Executed tasks
>> [INFO]
>> [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @
>> cache ---
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] Copying 3 resources
>> [INFO]
>> [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ cache
>> ---
>> [INFO] Compiling 100 source files to /xxx
>> [INFO]
>> [INFO] --- maven-resources-plugin:2.4.3:testResources
>> (default-testResources) @ cache ---
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] Copying 2 resources
>> [INFO]
>> [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @
>> cache ---
>> [INFO] Compiling 20 source files to /xxx
>> [INFO]
>> [INFO] --- maven-surefire-plugin:2.5:test (default-test) @ cache ---
>> [INFO] Tests are skipped.
>> [INFO]
>> [INFO] --- maven-antrun-plugin:1.6:run (generate-wireformats) @ cache ---
>> [INFO] Executing tasks
>>
>>
>> Thanks,
>> Mate
>>
>
>
Re: ant task runs twice
Posted by Mate Varga <ma...@gmail.com>.
It also seems that this has nothing to do with whatever lifecycle is the
task bound to. Even if the POM looks like below, it runs twice:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>generate-wireformats</id>
<phase>validate</phase>
<configuration>
<target>
<echo message="executing"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
...
On Fri, Dec 17, 2010 at 10:25 AM, Mate Varga <ma...@gmail.com> wrote:
> Hello,
>
> I've got an Ant task which is bound to 'generate-resources' phase. If I try
> to deploy the project, the task gets executed twice (before and after the
> tests).
> Any ideas about how could I prevent that?
>
> # 'release' and 'local' are my own profiles.
>
> (~/)\>mvn -P release,-local clean deploy -DskipTests=true
>
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building xxx 43
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ cache ---
> [INFO] Deleting /xxx
> [INFO]
> [INFO] --- maven-antrun-plugin:1.6:run (generate-wireformats) @ cache ---
> [INFO] Executing tasks
>
> main:
> [echo] compile classpath: ${maven.compile.classpath}
> [generator] Writing wireformat config file with classloader URLs: /xxx
> [generator] Writing wireformat config file with relative file URLs: /xxx
>
> [INFO] Executed tasks
> [INFO]
> [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @
> cache ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Copying 3 resources
> [INFO]
> [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ cache
> ---
> [INFO] Compiling 100 source files to /xxx
> [INFO]
> [INFO] --- maven-resources-plugin:2.4.3:testResources
> (default-testResources) @ cache ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Copying 2 resources
> [INFO]
> [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @
> cache ---
> [INFO] Compiling 20 source files to /xxx
> [INFO]
> [INFO] --- maven-surefire-plugin:2.5:test (default-test) @ cache ---
> [INFO] Tests are skipped.
> [INFO]
> [INFO] --- maven-antrun-plugin:1.6:run (generate-wireformats) @ cache ---
> [INFO] Executing tasks
>
>
> Thanks,
> Mate
>