gpt4 book ai didi

java - Maven编译失败但没有java错误

转载 作者:行者123 更新时间:2023-11-29 09:28:06 25 4
gpt4 key购买 nike

我正在 Eclipse Neon 中开发一个编辑器插件。该项目分为一个父项目,管理它的依赖项和一个包含实际源代码的子项目。将我的插件从 Eclipse Mars 迁移到 Neon 后,我将方法 IEditorDescriptor editorDescriptor = IDE.getEditorDescriptor(storage.getName(), true); 更改为 IEditorDescriptor editorDescriptor = IDE.getEditorDescriptor( storage.getName(), true, true);,因为现在不推荐使用第一个。如果我尝试使用 Maven 重建项目,它会导致编译失败:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.22.0:compile (default-compile) on project language-editor-core: Compilation failure: Compilation failure:
[ERROR] C:\Users\X\Documents\tfeditor\language-editor-core\src\main\java\de\se_rwth\langeditor\texteditor\hyperlinks\HyperlinkDetectorImpl.java:[228]
[ERROR] IEditorDescriptor editorDescriptor = IDE.getEditorDescriptor(storage.getName(), true, true);
[ERROR] ^^^^^^^^^^^^^^^^^^^
[ERROR] The method getEditorDescriptor(String, boolean) in the type IDE is not applicable for the arguments (String, boolean, boolean)
[ERROR] 1 problem (1 error)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :language-editor-core

父项目的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>de.monticore</groupId>
<artifactId>language-editor</artifactId>
<version>1.0.0-SNAPSHOT</version>

<name>Language Editor</name>

<organization>
<name>Department of Software Engineering, RWTH Aachen University</name>
<url>http://www.se-rwth.de/</url>
</organization>

<packaging>pom</packaging>

<modules>
<module>language-editor-core</module>
<module>cdtrans-editor</module>
<module>matrans-editor</module>
<module>language-editor-updatesite</module>
</modules>

<properties>
<monticore.version>4.5.0</monticore.version>
<monticoreRuntime.version>4.5.0</monticoreRuntime.version>
<cd4a.version>1.3.7-SNAPSHOT</cd4a.version>
<cd4a-trans.version>0.0.3-SNAPSHOT</cd4a-trans.version>
<typestrans.version>0.0.3-SNAPSHOT</typestrans.version>
<literalstrans.version>0.0.3-SNAPSHOT</literalstrans.version>
<tfruntime.version>4.4.0-SNAPSHOT</tfruntime.version>
<odrules.version>4.4.0-SNAPSHOT</odrules.version>
<secommons.version>1.7.7</secommons.version>
<antlr.version>4.5</antlr.version>
<guava.version>18.0</guava.version>
<matrans.version>0.0.2.E-SNAPSHOT</matrans.version>
<macommontrans.version>0.0.2-SNAPSHOT</macommontrans.version>


<tycho.version>0.22.0</tycho.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<wagon.version>1.0</wagon.version>
<compiler.plugin>3.3</compiler.plugin>
<java.version>1.8</java.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>de.se_rwth.commons</groupId>
<artifactId>se-commons-utilities</artifactId>
<version>${secommons.version}</version>
</dependency>

<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-runtime</artifactId>
<version>${monticoreRuntime.version}</version>
</dependency>

<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-grammar</artifactId>
<version>${monticore.version}</version>
</dependency>

<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>cd4analysis</artifactId>
<version>${cd4a.version}</version>
</dependency>

<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>cd4a-trans</artifactId>
<version>${cd4a-trans.version}</version>
</dependency>

<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>literalstrans</artifactId>
<version>${literalstrans.version}</version>
</dependency>

<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>typestrans</artifactId>
<version>${typestrans.version}</version>
</dependency>

<dependency>
<groupId>de.monticore.lang.tf</groupId>
<artifactId>de.monticore.tf.runtime</artifactId>
<version>${tfruntime.version}</version>
</dependency>

<dependency>
<groupId>de.monticore.lang.tf</groupId>
<artifactId>de.monticore.tf.odrules</artifactId>
<version>${tfruntime.version}</version>
</dependency>

<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
<version>${antlr.version}</version>
</dependency>

<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>${antlr.version}</version>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>

<dependency>
<groupId>de.monticore.lang.tf</groupId>
<artifactId>matrans</artifactId>
<version>${matrans.version}</version>
</dependency>

<dependency>
<groupId>de.monticore.lang.tf</groupId>
<artifactId>macommontrans</artifactId>
<version>${macommontrans.version}</version>
</dependency>

</dependencies>
</dependencyManagement>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<target>
<artifact>
<groupId>de.se_rwth.eclipse</groupId>
<artifactId>de.se_rwth.eclipse.targetplatform.luna</artifactId>
<version>1.0.2-SNAPSHOT</version>
</artifact>
</target>
<pomDependencies>consider</pomDependencies>
<environments>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>${wagon.version}</version>
<executions>
<execution>
<id>deploy-repository</id>
<phase>deploy</phase>
<goals>
<goal>upload-single</goal>
</goals>
<configuration>
<fromFile>${project.build.directory}/${project.build.finalName}.zip</fromFile>
<serverId>se-nexus</serverId>
<url>https://nexus.se.rwth-aachen.de/service/local/repositories/monticore-snapshots/content-compressed</url>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<distributionManagement>
<repository>
<id>se-nexus</id>
<url>http://nexus.se.rwth-aachen.de/content/repositories/monticore-releases/</url>
</repository>
<snapshotRepository>
<id>se-nexus</id>
<url>http://nexus.se.rwth-aachen.de/content/repositories/monticore-snapshots/</url>
</snapshotRepository>
<site>
<id>se-nexus</id>
<url>dav:http://nexus.se.rwth-aachen.de/content/sites/se-sites/monticore/${project.version}/</url>
</site>
</distributionManagement>

<repositories>
<repository>
<id>se-public</id>
<url>http://nexus.se.rwth-aachen.de/content/groups/public</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>se-public</id>
<url>http://nexus.se.rwth-aachen.de/content/groups/public</url>
</pluginRepository>
</pluginRepositories>

</project>

代码中的具体行没有被Eclipse标记为错误,代码执行也很好,那么问题在哪里呢?

最佳答案

确实,在将 Eclipse Neon 存储库添加到 pom.xml 之后:

<repositories>
<repository>
<id>eclipse-neon</id>
<url>http://download.eclipse.org/releases/neon</url>
<layout>p2</layout>
</repository>
</repositories>

,Maven 构建有效并且不会将 editorDescriptor = IDE.getEditorDescriptor(storage.getName(), true, true); 标记为错误 -> 问题已解决

关于java - Maven编译失败但没有java错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41166433/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com