Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » SonarQube and Xtend(SonarQube has a problem during maven build regarding xtend files)
SonarQube and Xtend [message #1349503] Mon, 12 May 2014 08:15 Go to next message
Marcus Höpfner is currently offline Marcus HöpfnerFriend
Messages: 53
Registered: February 2014
Member
Hi,

we have an xtext grammar for mathematical expressions.
During maven build SonarQube runs.

For the test plugin of our grammar it fails with
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.2:sonar (default-cli) on project com.sap.bw.parent: Can not execute SonarQube analysis: Unable to read and import the source file : '/Disk1/home/hudson/hudson/jobs/com.sap.bw.modeling.deploy/workspace/gitRepo/com.sap.bw.qd.formula.tests/xtend-gen/com/sap/bw/qd/formula/scoping/ScopeUnitTest.java' with the charset : 'UTF-8'. Duplicate source for resource: com.sap.bw.qd.formula.scoping.ScopeUnitTest -> [Help 1]


I checked the folder [code]/Disk1/home/hudson/hudson/jobs/com.sap.bw.modeling.deploy/workspace/gitRepo/com.sap.bw.qd.formula.tests/xtend-gen/com/sap/bw/qd/formula/scoping/[code] and there is only resource named "ScopeUnitTest".

But in the target folder [code][...]com.sap.bw.qd.formula.tests/target/classes/com/sap/bw/qd/formula/scoping/[code] there are two files with the name ScopeUnitTest.
-ScopeUnitTest.class
-ScopeUnitTest.xtend

In my local eclipse the xtend files are not moved to bin folder when building locally.

Here is the relevant part of the pom.xml of the test plugin:
<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.xtend</groupId>
				<artifactId>xtend-maven-plugin</artifactId>
				<!-- in the target we use 2.4.3 but in ide 2.5.x, so we use 2.5.x here 
					as well since it works -->
				<version>2.5.2</version>
				<executions>
					<execution>
						<goals>
							<goal>compile</goal>
							<!-- <goal>xtend-install-debug-info</goal> -->
							<goal>testCompile</goal>
							<!--  <goal>xtend-test-install-debug-info</goal> -->
						</goals>
					</execution>
				</executions>
				<configuration>
					<outputDirectory>xtend-gen</outputDirectory>
					<testOutputDirectory>xtend-gen</testOutputDirectory>					
				</configuration>
			</plugin>
			<!-- <plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
				<version>0.19.0</version>
				<extensions>true</extensions>
			</plugin> -->
		</plugins>
	</build>


How do I need to configure the maven plugin to prevent to copying of the xtend files to the target (binary) folder?

Thanks, Marcus
Re: SonarQube and Xtend [message #1350458 is a reply to message #1349503] Mon, 12 May 2014 17:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13358
Registered: July 2009
Senior Member
Hi can you share a small sample project.

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: SonarQube and Xtend [message #1350467 is a reply to message #1350458] Mon, 12 May 2014 17:29 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13358
Registered: July 2009
Senior Member
p.S: maybe the problem is using the xtend-gen folder twice

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:"Couldn't resolve reference" problem with programmatically created object
Next Topic:Accessing an EObject's source
Goto Forum:
  


Current Time: Thu Feb 20 13:55:52 GMT 2020

Powered by FUDForum. Page generated in 0.04393 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top