【发布时间】:2015-08-23 08:49:57
【问题描述】:
我正在尝试使用 Tycho 构建一个插件。 Eclipse 工作区中没有错误,但是当我尝试使用 Maven 编译它时,出现以下错误(超过 57 个错误):
[INFO] Resolving dependencies of MavenProject: uk.xman.tool:xman.xtend.conditiondsl:2.0.0 @ C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\pom.xml
[INFO] Resolving class path of MavenProject: uk.xman.tool:xman.xtend.conditiondsl:2.0.0 @ C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\pom.xml
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] xman.maven.parent
[INFO] xman.eclipse.target_definition
[INFO] xman.xtend.conditiondsl
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xman.maven.parent 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ xman.maven.parent ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xman.eclipse.target_definition 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ xman.eclipse.target_definition ---
[INFO] Deleting C:\Users\Simone\OneDrive\Eclipse\xman.eclipse.target_definition\target
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xman.xtend.conditiondsl 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ xman.xtend.conditiondsl ---
[INFO] Deleting C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\target
[INFO]
[INFO] --- tycho-packaging-plugin:0.22.0:build-qualifier (default-build-qualifier) @ xman.xtend.conditiondsl ---
[INFO] The project's OSGi version is 2.0.0
[INFO]
[INFO] --- tycho-packaging-plugin:0.22.0:validate-id (default-validate-id) @ xman.xtend.conditiondsl ---
[INFO]
[INFO] --- tycho-packaging-plugin:0.22.0:validate-version (default-validate-version) @ xman.xtend.conditiondsl ---
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ xman.xtend.conditiondsl ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\src\main\resources
[INFO]
[INFO] --- tycho-compiler-plugin:0.22.0:compile (default-compile) @ xman.xtend.conditiondsl ---
[INFO] Compiling 36 source files to C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] xman.maven.parent ................................. SUCCESS [ 0.087 s]
[INFO] xman.eclipse.target_definition .................... SUCCESS [ 0.005 s]
[INFO] xman.xtend.conditiondsl ........................... FAILURE [ 2.628 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.542 s
[INFO] Finished at: 2015-06-08T19:36:02+00:00
[INFO] Final Memory: 64M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.22.0:compile (default-compile) on project xman.xtend.conditiondsl: Compilation failure: Compilation failure:
[ERROR] C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\src-gen\uk\ac\man\xman\dsl\services\ConditionDSLGrammarAccess.java:[937]
[ERROR] public XbaseGrammarAccess.XExpressionInsideBlockElements getXExpressionInsideBlockAccess() {
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] XbaseGrammarAccess.XExpressionInsideBlockElements cannot be resolved to a type
[ERROR] C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\src-gen\uk\ac\man\xman\dsl\services\ConditionDSLGrammarAccess.java:[938]
[ERROR] return gaXbase.getXExpressionInsideBlockAccess();
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The method getXExpressionInsideBlockAccess() is undefined for the type XbaseGrammarAccess
[ERROR] C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\src-gen\uk\ac\man\xman\dsl\services\ConditionDSLGrammarAccess.java:[942]
[ERROR] return getXExpressionInsideBlockAccess().getRule();
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The method getXExpressionInsideBlockAccess() is undefined for the type ConditionDSLGrammarAccess
[ERROR] C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\src-gen\uk\ac\man\xman\dsl\parser\antlr\internal\InternalConditionDSLParser.java:[3918]
[ERROR] newLeafNode(kw, grammarAccess.getOpCompareAccess().getLessThanSignEqualsSignKeyword_1());
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The method getLessThanSignEqualsSignKeyword_1() is undefined for the type XbaseGrammarAccess.OpCompareElements
[ERROR] C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\src-gen\uk\ac\man\xman\dsl\parser\antlr\internal\InternalConditionDSLParser.java:[4541]
[ERROR] newLeafNode(kw, grammarAccess.getOpOtherAccess().getLessThanSignEqualsSignGreaterThanSignKeyword_9());
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The method getLessThanSignEqualsSignGreaterThanSignKeyword_9() is undefined for the type XbaseGrammarAccess.OpOtherElements
[ERROR] C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\src-gen\uk\ac\man\xman\dsl\parser\antlr\internal\InternalConditionDSLParser.java:[5748]
[ERROR] newCompositeNode(grammarAccess.getXCastedExpressionAccess().getXMemberFeatureCallParserRuleCall_0());
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The method getXMemberFeatureCallParserRuleCall_0() is undefined for the type XbaseGrammarAccess.XCastedExpressionElements
[ERROR] C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\src-gen\uk\ac\man\xman\dsl\parser\antlr\internal\InternalConditionDSLParser.java:[6946]
[ERROR] newCompositeNode(grammarAccess.getXPrimaryExpressionAccess().getXFeatureCallParserRuleCall_3());
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The method getXFeatureCallParserRuleCall_3() is undefined for the type XbaseGrammarAccess.XPrimaryExpressionElements
[ERROR] C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\src-gen\uk\ac\man\xman\dsl\parser\antlr\internal\InternalConditionDSLParser.java:[6968]
[ERROR] newCompositeNode(grammarAccess.getXPrimaryExpressionAccess().getXLiteralParserRuleCall_4());
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The method getXLiteralParserRuleCall_4() is undefined for the type XbaseGrammarAccess.XPrimaryExpressionElements
[ERROR] C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\src-gen\uk\ac\man\xman\dsl\parser\antlr\internal\InternalConditionDSLParser.java:[6990]
[ERROR] newCompositeNode(grammarAccess.getXPrimaryExpressionAccess().getXIfExpressionParserRuleCall_5());
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The method getXIfExpressionParserRuleCall_5() is undefined for the type XbaseGrammarAccess.XPrimaryExpressionElements
[ERROR] C:\Users\Simone\OneDrive\Eclipse\xman.xtend.conditiondsl\src-gen\uk\ac\man\xman\dsl\parser\antlr\internal\InternalConditionDSLParser.java:[7012]
[ERROR] newCompositeNode(grammarAccess.getXPrimaryExpressionAccess().getXForLoopExpressionParserRuleCall_6());
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
这是清单:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: xman.xtext.conditiondsl
Bundle-Vendor: University of Manchester
Bundle-Version: 2.0.0
Bundle-SymbolicName: xman.xtend.conditiondsl;singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.xtext.xbase;bundle-version="2.4.3",
org.eclipse.xtext.generator;bundle-version="2.4.3",
org.eclipse.emf.mwe2.launch;resolution:=optional,
org.eclipse.xtext;bundle-version="2.4.3",
org.eclipse.xtext.util;bundle-version="2.4.3",
org.eclipse.emf.ecore,
org.eclipse.emf.common,
org.antlr.runtime,
org.eclipse.xtext.common.types;bundle-version="2.4.3",
org.eclipse.xtext.xbase.lib;bundle-version="2.4.3"
Import-Package: org.apache.commons.logging;version="1.1.1",
org.apache.log4j;version="1.2.15",
org.eclipse.xtext.xbase.lib
Export-Package: uk.ac.man.xman.dsl,
uk.ac.man.xman.dsl.conditionDSL,
uk.ac.man.xman.dsl.conditionDSL.impl,
uk.ac.man.xman.dsl.conditionDSL.util,
uk.ac.man.xman.dsl.formatting;uses:="org.eclipse.xtext.formatting.impl",
uk.ac.man.xman.dsl.generator;uses:="org.eclipse.emf.ecore.resource,org.eclipse.xtext.generator",
uk.ac.man.xman.dsl.jvmmodel;uses:="org.eclipse.emf.ecore,org.eclipse.xtext.xbase.jvmmodel",
uk.ac.man.xman.dsl.parser.antlr,
uk.ac.man.xman.dsl.parser.antlr.internal,
uk.ac.man.xman.dsl.scoping;uses:="org.eclipse.xtext.scoping.impl",
uk.ac.man.xman.dsl.serializer,
uk.ac.man.xman.dsl.services,
uk.ac.man.xman.dsl.validation
Bundle-ClassPath: .
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Tycho 编译器在尝试编译时似乎没有考虑插件依赖项:缺少的类型是在 MANIFEST 中所需的 jar org.eclipse.xtext.xbase 中定义的。
任何想法如何解决这个问题?
【问题讨论】:
-
检查你的
pom.xml文件,更多信息:vogella.com/tutorials/EclipseTycho/article.html -
谢谢。你认为它在 pom 中缺少什么?我的 pom 现在非常简单(只是对父 pom 的引用)。
-
你把
tycho-maven-plugin当作artefactId吗? -
当然!父 pom 有它。不幸的是它的孩子无法编译......我真的不明白为什么。
-
@flafoux:从日志输出中可以明显看出该项目启用了 Tycho。
标签: eclipse maven build eclipse-plugin tycho