【问题标题】:Getting Access restriction error while maven buildMaven构建时出现访问限制错误
【发布时间】:2019-11-04 02:58:35
【问题描述】:

在这里我在构建我的多模块 maven 项目时遇到访问限制错误。

添加错误详情:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.0.0:compile (default-compile) on project my.project.ui.core.communication: Compilation failure: Compilation failure:
[ERROR] C:\HOME\SOME_DIR\my.project.ui.core.communication\src\my\project\ui\core\communication\logic\RequirementLibraryDelegate.java:[474]
[ERROR] LOGGER.severe(IRequirementLibraryLogIds.REQLIBMSGID0009, e.getMessage() + e);
[ERROR] ^^^^^^^^^^^^^^
[ERROR] Access restriction: The method 'EJBException.getMessage()' is not API (restriction on classpath entry 'C:\HOME\SOME_DIR\my.project.common.server\lib\j2ee.jar')

我已经尝试过的参考:Access restriction: Is not accessible due to restriction on required library ..\jre\lib\rt.jar

谁能帮我解决这个问题?

提前致谢:)

【问题讨论】:

    标签: eclipse maven tycho


    【解决方案1】:

    尝试在 pom.xml 中设置如下目标。

                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
    

    如果没有帮助,请通过 Import-Package 在 MANIFEST.MF 中使用特定的 OSGi 依赖,如下所示:

    Import-Package: org.eclipse.jface.contentassist
    

    【讨论】:

      猜你喜欢
      • 2020-03-28
      • 2013-07-28
      • 2019-01-27
      • 2013-04-14
      • 2018-07-10
      • 2020-07-06
      • 2011-03-09
      • 1970-01-01
      • 2014-05-31
      相关资源
      最近更新 更多