我可以使用Maven构建我的Xtext项目的可执行jar文件(我希望自动化此过程用于CI)。
但是,在执行过程中出现了一个错误。 尽管有这个错误,但执行仍然成功。 我附上了用于打包目标的pom.xml文件。
错误:
1 [main] ERROR xt.validation.ResourceValidatorImpl - The string resource '_UI_DiagnosticRoot_diagnostic' could not be located
java.util.MissingResourceException: The string resource '_UI_DiagnosticRoot_diagnostic' could not be located
at org.eclipse.emf.common.util.DelegatingResourceLocator.delegatedGetString(DelegatingResourceLocator.java:541)
at org.eclipse.emf.common.util.DelegatingResourceLocator.getString(DelegatingResourceLocator.java:445)
at org.eclipse.emf.common.util.DelegatingResourceLocator.getString(DelegatingResourceLocator.java:560)
at org.eclipse.emf.common.util.DelegatingResourceLocator.getString(DelegatingResourceLocator.java:552)
at org.eclipse.emf.ecore.util.Diagnostician.createDefaultDiagnostic(Diagnostician.java:111)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:140)
at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:147)
at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:125)
at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:91)
at langage.generator.Main.runGenerator(Main.java:66)
at langage.generator.Main.main(Main.java:35)
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>comp_go</groupId>
<artifactId>go.prettyprinter</artifactId>
<version>1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<finalName>Main</finalName>
<sourceDirectory>src/langage/generator</sourceDirectory>
<outputDirectory>target/classes</outputDirectory>
<!-- PLUGINS -->
<plugins>
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
<version>2.23.0</version>
<dependencies>
<dependency>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
<version>3.10.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<archive>
<manifest>
<mainClass>langage.generator.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- DEPENDENCES -->
<dependencies>
<!-- https://mvnrepository.com/artifact/org.eclipse.emf/ecore -->
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.6.0.v20100614-1136</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.common</artifactId>
<version>2.20.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.inject/guice -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>5.0.0-BETA-1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.eclipse.xtext/org.eclipse.xtext -->
<dependency>
<groupId>org.eclipse.xtext</groupId>
<artifactId>org.eclipse.xtext</artifactId>
<version>2.23.0</version>
</dependency>
</dependencies>
</project>
我想错误是由依赖项com.google.inject引起的,它不是100%兼容,但这是一个真正的问题,管道由于此失败。