Generated sources aren't compiled when using a Maven pom to initialize a Gradle build


(Jason Zwolak) #1

When compiling OpenJPA using the Maven POM in the OpenJPA source control (subversion), generated sources are not compiled and therefore are not found in the classpath while compiling sources dependent on them.

To reproduce:

  1. svn checkout http://svn.apache.org/repos/asf/openjpa/trunk openjpa 2. cd openjpa 3. gradle init 4. gradle compileJava

Expected result: Build Successful

Actual result: Build Failed because JPQLTreeConstants could not be found.

JPQLTreeConstants is a generated source. As can be seen when performing a find after a mvn compile.

mvn compile

find . -name “JPQLTreeConstants*”

./openjpa-kernel/target/classes/org/apache/openjpa/kernel/jpql/JPQLTreeConstants.class

./openjpa-kernel/target/generated-sources/javacc/org/apache/openjpa/kernel/jpql/JPQLTreeConstants.java

./openjpa-kernel/target/generated-sources/jjtree/org/apache/openjpa/kernel/jpql/JPQLTreeConstants.java

------------------------------------------------------------ Gradle 1.9-rc-4 ------------------------------------------------------------

Build time:

2013-11-18 09:32:42 UTC Build number: none Revision:

7970ec3503b4f5767ee1c1c69f8b4186c4763e3d

Groovy:

1.8.6 Ant:

Apache Ant™ version 1.9.2 compiled on July 8 2013 Ivy:

2.2.0 JVM:

1.7.0_10 (Oracle Corporation 23.6-b04) OS:

Mac OS X 10.9 x86_64


(Luke Daley) #2

The maven import doesn’t support plugins outside the standard lifecycle. Projects that do code generation will need some further work after the import.