|
Re: prevent compiling in xtext-maven-plugin [message #1753008 is a reply to message #1753007] |
Wed, 01 February 2017 06:20 |
|
Hi,
i dont get that.
there are actual references inside the xcore file. thus it needs to see the xtend files (well you could call the xtend maven plugin first.
and cant reproduce it.
did you adapt the pom to handle xtend files ?!?
</language>
<language>
<setup>org.eclipse.xtend.core.XtendStandaloneSetup</setup>
<outputConfigurations>
<outputConfiguration>
<outputDirectory>${project.basedir}/src/main/java-gen</outputDirectory>
</outputConfiguration>
</outputConfigurations>
</language>
//deps of xtext-maven-plugin
<dependency>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.core</artifactId>
<version>${xtext-version}</version>
</dependency>
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
|
|
|
|
|
Re: prevent compiling in xtext-maven-plugin [message #1753013 is a reply to message #1753010] |
Wed, 01 February 2017 06:45 |
chris yo Messages: 146 Registered: February 2013 |
Senior Member |
|
|
Hi Christian,
I tried your suggestion above but I get this error.
[INFO] --- xtext-maven-plugin:2.10.0:generate (default) @ xtext ---
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/eclipse/xtend/org.eclipse.xtend.core/2.10.0/org.eclipse.xtend.core-2.10.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.529 s
[INFO] Finished at: 2017-02-01T14:40:24+08:00
[INFO] Final Memory: 10M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.xtext:xtext-maven-plugin:2.10.0:generate (default) on project xtext: Execution default of goal org.eclipse.xtext:xtext-maven-plugin:2.10.0:generate failed: Plugin org.eclipse.xtext:xtext-maven-plugin:2.10.0 or one of its dependencies could not be resolved: Failed to collect dependencies at org.eclipse.xtext:xtext-maven-plugin:jar:2.10.0 -> org.eclipse.xtend:org.eclipse.xtend.core:jar:2.10.0: Failed to read artifact descriptor for org.eclipse.xtend:org.eclipse.xtend.core:jar:2.10.0: Could not transfer artifact org.eclipse.xtend:org.eclipse.xtend.core:pom:2.10.0 from/to central (https://repo.maven.apache.org/maven2): connect timed out -> [Help 1]
[ERROR]
This is the content of my pom.xml.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>xtext</groupId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>xtext</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<emf-version>2.12.0</emf-version>
<emf-common-version>2.12.0</emf-common-version>
<emf-codegen-version>2.11.0</emf-codegen-version>
<xtext-version>2.10.0</xtext-version>
<ecore-xtext-version>1.2.0</ecore-xtext-version>
<ecore-xcore-version>1.3.1</ecore-xcore-version>
<ecore-xcore-lib-version>1.1.100</ecore-xcore-lib-version>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.common</artifactId>
<version>${emf-common-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>${emf-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.xcore.lib</artifactId>
<version>${ecore-xcore-lib-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.xtext</groupId>
<artifactId>org.eclipse.xtext.xbase.lib</artifactId>
<version>${xtext-version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.6.1</version>
<configuration>
<filesets>
<fileset>
<directory>emf-gen</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/emf-gen</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-maven-plugin</artifactId>
<version>${xtext-version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<languages>
<language>
<setup>org.eclipse.xtext.ecore.EcoreSupport</setup>
</language>
<language>
<setup>org.eclipse.emf.codegen.ecore.xtext.GenModelSupport</setup>
</language>
<language>
<setup>org.eclipse.xtend.core.XtendStandaloneSetup</setup>
<outputConfigurations>
<outputConfiguration>
<outputDirectory>${project.basedir}/xtend-gen</outputDirectory>
</outputConfiguration>
</outputConfigurations>
</language>
<language>
<setup>org.eclipse.emf.ecore.xcore.XcoreStandaloneSetup</setup>
<outputConfigurations>
<outputConfiguration>
<outputDirectory>${project.basedir}/emf-gen</outputDirectory>
</outputConfiguration>
</outputConfigurations>
</language>
</languages>
<sourceRoots>
<root>${basedir}/src/org</root>
</sourceRoots>
<compilerSourceLevel>1.7</compilerSourceLevel>
<compilerTargetLevel>1.7</compilerTargetLevel>
</configuration>
<dependencies>
<dependency>
<groupId>org.eclipse.text</groupId>
<artifactId>org.eclipse.text</artifactId>
<version>3.5.101</version>
</dependency>
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.resources</artifactId>
<version>3.7.100</version>
</dependency>
<dependency>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.core</artifactId>
<version>${xtext-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.xtext</groupId>
<artifactId>org.eclipse.xtext.ecore</artifactId>
<version>${xtext-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.xtext</groupId>
<artifactId>org.eclipse.xtext.xbase</artifactId>
<version>${xtext-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.codegen.ecore.xtext</artifactId>
<version>${ecore-xtext-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.common</artifactId>
<version>${emf-common-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>${emf-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.xmi</artifactId>
<version>${emf-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.codegen</artifactId>
<version>${emf-codegen-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.codegen.ecore</artifactId>
<version>${emf-codegen-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.xcore</artifactId>
<version>${ecore-xcore-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.xcore.lib</artifactId>
<version>${ecore-xcore-lib-version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Do I need to create a separate plugin for xtend?
[Updated on: Wed, 01 February 2017 06:52] Report message to a moderator
|
|
|
|
Re: prevent compiling in xtext-maven-plugin [message #1753016 is a reply to message #1753014] |
Wed, 01 February 2017 07:33 |
chris yo Messages: 146 Registered: February 2013 |
Senior Member |
|
|
i managed to make it work. but I encountered another problem.
My project's flow is this:
xcore
-> used by the xtext grammar
-> also does some operations and refers to the methods defined in xtend.
xtend
-> transforms and generate the classes
-> calls the op methods in xcore
-> refers to the xtext variables
Thus, xcore depends on the java classes of xtend, and xtend depends on the xtext variables which also depends on the xcore stuffs.
All these are in one project. This is not a problem if build is being handled by Eclipse IDE. But when being run by the maven script in a "clean" environment (no generated sources from xtend yet), this becomes a problem.
So, I was thinking that for XcoreStandaloneSetup, it just simple generates the .java files without checking for the validity. The validity will be checked anyway, when xtend is compiled. I noticed that with Eclipse IDE, only the java files are generated. There are no .class files. But when running maven, .class files are there. Thus, is it possible to skip this part (the .class files) of the xcore compiler?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04226 seconds