Skip to content
This repository was archived by the owner on Apr 21, 2023. It is now read-only.

Xtend-Maven Plugin does no longer work #116

Closed
cdietrich opened this issue Jan 9, 2017 · 19 comments
Closed

Xtend-Maven Plugin does no longer work #116

cdietrich opened this issue Jan 9, 2017 · 19 comments
Assignees
Labels
Milestone

Comments

@cdietrich
Copy link
Member

cdietrich commented Jan 9, 2017

Xtend-Maven Plugin does no longer work
see
https://github.com/cdietrich/xtext-211-maven
for an example

i assume there are some changes to the maven metadata or java sourcelang that cause this

@cdietrich cdietrich added the bug label Jan 9, 2017
@cdietrich cdietrich added this to the release_v2.11 milestone Jan 9, 2017
@cdietrich
Copy link
Member Author

[WARNING] Compilation of stubs had errors.
[ERROR] 
ERROR:  MyDslValidator.xtend - /home/cdietric/workspace_211-m/org.xtext.example.mydsl.parent/org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation/MyDslValidator.xtend
12: AbstractMyDslValidator cannot be resolved to a type.
[ERROR] 
ERROR:  MyDslValidator.xtend - /home/cdietric/workspace_211-m/org.xtext.example.mydsl.parent/org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation/MyDslValidator.xtend
12: Superclass must be a class
[ERROR] 
ERROR:  MyDslRuntimeModule.xtend - /home/cdietric/workspace_211-m/org.xtext.example.mydsl.parent/org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDslRuntimeModule.xtend
10: AbstractMyDslRuntimeModule cannot be resolved to a type.
[ERROR] 
ERROR:  MyDslRuntimeModule.xtend - /home/cdietric/workspace_211-m/org.xtext.example.mydsl.parent/org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDslRuntimeModule.xtend
10: Superclass must be a class
[ERROR] 
ERROR:  MyDslScopeProvider.xtend - /home/cdietric/workspace_211-m/org.xtext.example.mydsl.parent/org.xtext.example.mydsl/src/org/xtext/example/mydsl/scoping/MyDslScopeProvider.xtend
13: AbstractMyDslScopeProvider cannot be resolved to a type.
[ERROR] 
ERROR:  MyDslScopeProvider.xtend - /home/cdietric/workspace_211-m/org.xtext.example.mydsl.parent/org.xtext.example.mydsl/src/org/xtext/example/mydsl/scoping/MyDslScopeProvider.xtend
13: Superclass must be a class
[ERROR] 
ERROR:  MyDslStandaloneSetup.xtend - /home/cdietric/workspace_211-m/org.xtext.example.mydsl.parent/org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDslStandaloneSetup.xtend
10: MyDslStandaloneSetupGenerated cannot be resolved to a type.
[ERROR] 
ERROR:  MyDslStandaloneSetup.xtend - /home/cdietric/workspace_211-m/org.xtext.example.mydsl.parent/org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDslStandaloneSetup.xtend
13: The method createInjectorAndDoEMFRegistration() is undefined for the type MyDslStandaloneSetup
[ERROR] 
ERROR:  MyDslStandaloneSetup.xtend - /home/cdietric/workspace_211-m/org.xtext.example.mydsl.parent/org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDslStandaloneSetup.xtend
10: Superclass must be a class

@svenefftinge
Copy link
Member

@cdietrich Are you looking into this?

@cdietrich
Copy link
Member Author

no i have a look at the xtext-maven part

@cdietrich
Copy link
Member Author

p.s.: currently the xtend-maven tests are failing as well. probably related

@heeckhau
Copy link

I also ran into this. This fails for both beta2 and snapshot.

@svenefftinge
Copy link
Member

Ok I will have a look then

@svenefftinge svenefftinge self-assigned this Jan 11, 2017
@svenefftinge
Copy link
Member

the new jdt dep doesn't automatically pull apt. Resukting in a swallowed ClassNotFoundException :(
Anybody facing this problem, please add the following to your xtend-plugin configuration:

				<dependencies>
				<dependency>
					<groupId>org.eclipse.jdt</groupId>
					<artifactId>org.eclipse.jdt.core</artifactId>
					<version>3.12.2</version>
				</dependency>
					<dependency>
						<groupId>org.eclipse.jdt</groupId>
						<artifactId>org.eclipse.jdt.compiler.apt</artifactId>
						<version>1.2.100</version>
					</dependency>
				</dependencies>

@cdietrich
Copy link
Member Author

this should be pulled by the xtend-maven -plugin right?

@svenefftinge
Copy link
Member

I added it to xtend.core. It's a runtime dependency for the batch compiler.

@svenefftinge
Copy link
Member

could you review?

@svenefftinge
Copy link
Member

#121

svenefftinge added a commit that referenced this issue Jan 11, 2017
[batch compiler] add compiler.apt dependency (fixes #116)
kittaakos added a commit to SemanticApplicationDesignLanguage/sadl that referenced this issue Jan 11, 2017
The new JDT dependency did not automatically pull the compiler.apt
dependency. The result was a CNFE which was swallowed and the Xtend
generation silently failed. (See:
eclipse/xtext-xtend#116 (comment))

Signed-off-by: Akos Kitta <[email protected]>
@heeckhau
Copy link

Thanks. Both the workaround and the latest snapshot resolve the issue.

@cdietrich
Copy link
Member Author

@svenefftinge is this on sonatype already?

@cdietrich
Copy link
Member Author

yes it is

meysholdt added a commit to TypeFox/n4js that referenced this issue Jan 28, 2017
cortlandstarrett added a commit to cortlandstarrett/bridgepoint that referenced this issue Dec 21, 2018
@lschaus
Copy link

lschaus commented Jan 4, 2019

I am facing the same issue now.

...
[INFO] 
[INFO] --- xtend-maven-plugin:2.12.0:compile (default) @ com.modelengineers.editor.utils ---
[WARNING] Compilation of stubs had errors.
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ com.modelengineers.editor.utils 
...
1480 INFO  XtextGenerator     - Generating com.modelengineers.modelinterface.MIF
9616 INFO  XtextGenerator     - Generating common infrastructure
9660 INFO  EcoreGenerator     - generating EMF code for platform:/resource/com.modelengineers.modelinterface/model/MIF.genmodel
12139 INFO  Workflow           - Done.
[INFO] 
[INFO] --- xtend-maven-plugin:2.12.0:compile (default) @ com.modelengineers.modelinterface ---
[WARNING] Compilation of stubs had errors.
[ERROR] 
...

I have tried to add the code provided by aphethean1 into my pom.xml files but it does not work for me

@cdietrich
Copy link
Member Author

cdietrich commented Jan 4, 2019

are you sure you dont use java 11 accidentially?
are you sure you are not affected by eclipse-xtext/xtext#1373

@lschaus
Copy link

lschaus commented Jan 4, 2019

are you sure you dont use java 11 accidentially?
are you sure you are not affected by eclipse/xtext#1373

I am sure that I don't use java 11. It is not installed on my machine and I havent made changes to my setup since the last successful build (19.12.2018)

I am not sure if I am not affected by the issue you mentioned above. But I am having difficulties to identify the suggested workaround. I'd be happy to try it.

By the way. I am using XText 2.12 and I am also using the following workaround in my parent pom

<!-- Work around Maven Eclipse problem as detailed here: https://github.com/eclipse/xtext/issues/1231 --> 
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
<version>3.10.0</version>

@cdietrich
Copy link
Member Author

you basically need to specify

  • emf
  • jdt
  • core.runtime
  • equinox.common

to make sure

  • no mixed versions of equinox common and core.runtime
  • no mixed versions of jdt core and jdt compiler apt/tool are used

@lschaus
Copy link

lschaus commented Jan 4, 2019

Thank you. That worked for me. Your rapidand helpful support is awesome.

If anyone is interested, my parent pom includes this section now:

<plugins>
	<plugin>
		<groupId>org.eclipse.xtend</groupId>
		<artifactId>xtend-maven-plugin</artifactId>
		<version>${xtextVersion}</version>
		<dependencies>
			<dependency>
				<!-- Work around Maven Eclipse problem as detailed here: https://github.com/eclipse/xtext/issues/1231 -->
				<groupId>org.eclipse.platform</groupId>
				<artifactId>org.eclipse.equinox.common</artifactId>
				<version>3.10.0</version>
			</dependency>

			<!-- Workaround for https://github.com/eclipse/xtext/issues/1231 -->
			<!-- Remove with upgrade to Xtext 2.15 -->
			<dependency>
				<groupId>org.eclipse.jdt</groupId>
				<artifactId>org.eclipse.jdt.core</artifactId>
				<version>3.13.102</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.jdt</groupId>
				<artifactId>org.eclipse.jdt.compiler.apt</artifactId>
				<version>1.3.110</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.jdt</groupId>
				<artifactId>org.eclipse.jdt.compiler.tool</artifactId>
				<version>1.2.101</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.emf</groupId>
				<artifactId>org.eclipse.emf.codegen</artifactId>
				<version>2.11.0</version>
			</dependency>
		</dependencies>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants