maven - Maven/Xtext:找不到字符串资源“_UI_DiagnosticRoot_diagnostic”
问题描述
我可以使用 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% 兼容,但这是一个真正的问题,管道因此而失败。
解决方案
推荐阅读
- angular - 角材料复选框和选项卡
- java - MongoDB/Morphia 中的参考
- mysql - 重新排序 mysql 表行,而不考虑时间顺序
- optaplanner - 没有entityClass,由于entityClassSet中有多个,无法自动推导
- jquery - 从 fullCalendar 中的“更多”弹出窗口拖动不起作用
- magento2 - 删除已添加到购物车的消息 Magento 2
- sql-server - 在 SQL Server 对象资源管理器中找不到我的数据库
- java - sqlite select with conditions:仅在第一个条件为空时搜索
- python - 如何在不重新启动应用程序的情况下自动重新加载 python 模块?
- ruby-on-rails - 需要用表单刷新页面以在 Rails 5.1 上创建