You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Johnny Clark <jo...@gmail.com> on 2012/08/18 00:03:55 UTC
Groovy files appear to recompiled when no changes have been made
It appears that gmaven is always recompiling groovy files even when valid
and up to date class files already exist. Is this the expected behavior or
do I need to alter my configuration? To clarify, if I execute "mvn test
-Dtest=UnitTests -DfailIfNoTests=false", multiple times without changing
the source files, the groovy files are recompiled, but the java files are
not.
After running "mvn clean", I execute "mvn test -Dtest=UnitTests
-DfailIfNoTests=false" and see the following output:
INFO 15:59:14.167 [groovy:generateStubs {execution: default}]
[INFO] Generated 240 Java stubs
INFO 15:59:20.782 [resources:resources {execution: default-resources}]
INFO 15:59:20.790 Using 'UTF-8' encoding to copy filtered resources.
INFO 15:59:20.890 Copying 25 resources
INFO 15:59:21.113 Copying 0 resource
INFO 15:59:21.407 [compiler:compile {execution: default-compile}]
INFO 15:59:29.445 Compiling 7053 source files to
C:\IdeaProjects\ICM_7.0.0\EJB\target\classes
INFO 16:02:40.986 [groovy:compile {execution: default}]
[INFO] Compiled 3396 Groovy classes
INFO 16:09:18.600 [groovy:generateTestStubs {execution: default}]
[INFO] Generated 239 Java stubs
INFO 16:09:29.584 [resources:testResources {execution:
default-testResources}]
INFO 16:09:29.585 Using 'UTF-8' encoding to copy filtered resources.
INFO 16:09:29.641 Copying 7 resources
INFO 16:09:29.731 [compiler:testCompile {execution: default-testCompile}]
INFO 16:09:30.453 Compiling 370 source files to
C:\IdeaProjects\ICM_7.0.0\EJB\target\test-classes
As you can see from the highlighted lines it took the following time to
compile:
Java Source 3:11 (15:59:29.445 to 16:02:40.986)
Groovy Source 6:38 (16:02:40.986 to 16:09:18.600)
If I immediately execute the "mvn test -Dtest=UnitTests
-DfailIfNoTests=false" command again without changing anything I get the
following output:
[INFO] Generated 240 Java stubs
INFO 16:31:16.361 [resources:resources {execution: default-resources}]
INFO 16:31:16.373 Using 'UTF-8' encoding to copy filtered resources.
INFO 16:31:16.442 Copying 25 resources
INFO 16:31:16.584 Copying 0 resource
INFO 16:31:16.838 [compiler:compile {execution: default-compile}]
INFO 16:31:24.621 Nothing to compile - all classes are up to date
INFO 16:31:24.708 [groovy:compile {execution: default}]
[INFO] Compiled 3396 Groovy classes
INFO 16:36:19.481 [groovy:generateTestStubs {execution: default}]
[INFO] Generated 239 Java stubs
INFO 16:36:23.123 [resources:testResources {execution:
default-testResources}]
INFO 16:36:23.123 Using 'UTF-8' encoding to copy filtered resources.
INFO 16:36:23.165 Copying 7 resources
INFO 16:36:23.219 [compiler:testCompile {execution: default-testCompile}]
INFO 16:36:23.890 Nothing to compile - all classes are up to date
INFO 16:36:23.933 [groovy:testCompile {execution: default}]
As you can see, the Java files were not recompiled and a message "Nothing
to compile - all classes are up to date" was issued. However, the Groovy
source took 4:55 to compile.
Here is the gmaven section from my pom. I see the same behavior using
Maven 2 and Maven 3. The output above was produced from Maven 2.
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.2</version>
<dependencies>
<dependency>
<groupId>org.codehaus.gmaven.runtime</groupId>
<artifactId>gmaven-runtime-1.7</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.7.0</version>
</dependency>
</dependencies>
<configuration>
<providerSelection>1.7</providerSelection>
</configuration>
<executions>
<execution>
<goals>
<goal>generateStubs</goal>
<goal>compile</goal>
<goal>generateTestStubs</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
Thanks in advance for any assistance you can provide.
- Johnny Clark
Re: Groovy files appear to recompiled when no changes have been made
Posted by Wayne Fay <wa...@gmail.com>.
> It appears that gmaven is always recompiling groovy files even when valid
> and up to date class files already exist. Is this the expected behavior or
> do I need to alter my configuration? To clarify, if I execute "mvn test
Most likely the groovy compiler simply does not have the functionality
that you expect. It is all open source so you can add this feature if
you truly need it. If you do this, please donate your work back for
possible inclusion in a future release of the plugin.
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org