<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/generated-sources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Sourcefolder relative, because in multi source folder projects you may end in a conflicting target folder.
I would suggest to keep xtend compiler setting as is and add src/main/generated-sources to maven sources.
--
You received this message because you are subscribed to a topic in the Google Groups "Xtend Programming Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtend-lang/vGRX59En_5g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xtend-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
hi,Sourcefolder relative, because in multi source folder projects you may end in a conflicting target folder.what do you mean with "multi source folder projects"? do you mean a maven multi-module project?I guess not, because each module would have it's own target folder and there's no conflict in that case.
I would suggest to keep xtend compiler setting as is and add src/main/generated-sources to maven sources.
I want to avoid this if possible.
Whenever I did not stick to Maven-conventions in the past, I regretted that badly and I have the feeling that it will be no different in this case.another thing I don't like about this is that I'd have to exclude parts of the src/main tree from my version control system.anyway: I'd like to avoid this if possible, so I'd be grateful for a workaround that let's me stick to maven-conventions.e.g. using '../../../target/generated-sources' (I've tried that - does not work)
thanks for the help - finally I got it working.
here's a summary - maybe it helps others.
Maven
defined variables
<xtendVersion>2.4.3</xtendVersion> <xtendGenDirectory>target/generated-sources/xtend</xtendGenDirectory>
dependencies
<dependency> <groupId>org.eclipse.xtend</groupId> <artifactId>org.eclipse.xtend.lib.gwt</artifactId> <version>${xtendVersion}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.eclipse.xtext</groupId> <artifactId>org.eclipse.xtext.xbase.lib.gwt</artifactId> <version>${xtendVersion}</version> <scope>compile</scope> </dependency>
Xtend plugin to generate java files from the xtend files:
<plugin> <groupId>org.eclipse.xtend</groupId> <artifactId>xtend-maven-plugin</artifactId> <version>${xtendVersion}</version> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>compile</goal> </goals> <configuration> <outputDirectory>${xtendGenDirectory}</outputDirectory> </configuration> </execution> </executions> </plugin>
tell the build-helper plugin to include the generated java files in the build process (the GWT compiler needs to find them):
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${xtendGenDirectory}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
Eclipse
In the Project properties - section Xtend - Compiler - Outputfolder for generated Java files set the Directory to
../../target/generated-sources/xtend