Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367178 - [Xtend] maven-eclipse-plugin breaks .classpath
Summary: [Xtend] maven-eclipse-plugin breaks .classpath
Status: CLOSED INVALID
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: M5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-20 07:45 EST by Dénes Harmath CLA
Modified: 2017-09-19 18:14 EDT (History)
2 users (show)

See Also:
sven.efftinge: juno+


Attachments
Original .project before mvn eclipse:clean eclipse:eclipse (554 bytes, application/octet-stream)
2011-12-20 09:06 EST, Dénes Harmath CLA
no flags Details
Generated .project (410 bytes, application/octet-stream)
2011-12-20 09:16 EST, Dénes Harmath CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dénes Harmath CLA 2011-12-20 07:45:31 EST
Build Identifier: I20110613-1736

After adding the Xtend libs to the classpath in Eclipse, .classpath looks like:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src/main/xtend-gen"/>
	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
	<classpathentry kind="con" path="org.eclipse.xtend.XTEND_CONTAINER"/>
	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
	<classpathentry kind="output" path="target/classes"/>
</classpath>

But I use Xtend in a Maven project, and don't want to commit .classpath into the VCS, so I run maven eclipse:clean eclipse:eclipse. It generates the following .classpath:

<classpath>
  <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
  <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
  <classpathentry kind="src" path="src/main/xtend-gen" including="**/*.java"/>
  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
  <classpathentry kind="output" path="target/classes"/>
  <classpathentry kind="var" path="M2_REPO/com/google/guava/guava/10.0.1/guava-10.0.1.jar" sourcepath="M2_REPO/com/google/guava/guava/10.0.1/guava-10.0.1-sources.jar"/>
  <classpathentry kind="var" path="M2_REPO/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/eclipse/xtend2/org.eclipse.xtend2.lib/2.2.0/org.eclipse.xtend2.lib-2.2.0.jar" sourcepath="M2_REPO/org/eclipse/xtend2/org.eclipse.xtend2.lib/2.2.0/org.eclipse.xtend2.lib-2.2.0-sources.jar"/>
  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
</classpath>

After it, Xtend can't compile .xtend files. There are no errors, but the Java sources are not generated.

Reproducible: Always
Comment 1 Dennis Huebner CLA 2011-12-20 08:27:33 EST
Can you also attach your .project file before and after mvn clean?
Comment 2 Dénes Harmath CLA 2011-12-20 09:06:49 EST
Created attachment 208612 [details]
Original .project before mvn eclipse:clean eclipse:eclipse
Comment 3 Dénes Harmath CLA 2011-12-20 09:16:40 EST
Created attachment 208614 [details]
Generated .project
Comment 4 Dénes Harmath CLA 2011-12-20 09:20:50 EST
Note that Eclipse automatically adds the missing Xtext builder entries when opening an .xtend file but this does not solve the incremental compilation.
Comment 5 Michael Clay CLA 2011-12-20 14:54:35 EST
pls configure your maven eclipse plugin to also include  *.xtend files
e.g.

     <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.8</version>
        <configuration>
          <sourceIncludes>
            <sourceInclude>**/*.xtend</sourceInclude>
          </sourceIncludes>
        </configuration>
      </plugin>

see http://maven.apache.org/plugins/maven-eclipse-plugin/examples/specifying-source-path-inclusions-and-exclusions.html

please reopen if i missed something
Comment 6 Dénes Harmath CLA 2011-12-28 09:09:57 EST
Thank you, this solved the problem. Please include this part of the POM in the documentation!
Comment 7 Karsten Thoms CLA 2017-09-19 18:03:55 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 8 Karsten Thoms CLA 2017-09-19 18:14:01 EDT
Closing all bugs that were set to RESOLVED before Neon.0