Eclipse:运行时不包含一些 Maven 依赖项
我正在 Eclipse 中运行 GWT + GAE Maven 项目,该项目依赖于 lombok jar:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>0.9.3</version>
<scope>provided</scope>
</dependency>
然后我使用 Google Plugin for Eclipse 启动我的应用程序。
一切正常,除了运行时 lombok jar 存在于类路径中(System.getProperty("java.class.path") 显示包含该 jar)。这应该会导致应用引擎/datanucleus出现一些问题< /a>.
我查了一下:
- jar 未复制到 war/WEB-INF/lib 文件夹中
- jar 存在于项目构建路径的 Maven 依赖项中
- Maven 依赖项自动包含在项目配置的类路径中。
我正在寻找一种避免 jar 成为运行时类路径一部分的方法。
预先感谢您提供的任何提示,
Sébastien
I am running a GWT + GAE Maven project in Eclipse, which has a dependency on the lombok jar:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>0.9.3</version>
<scope>provided</scope>
</dependency>
I then launch my application using the Google Plugin for Eclipse.
It all works fine, except that the lombok jar is present in the classpath at runtime (System.getProperty("java.class.path") shows the jar is included). And this is supposed to a cause some issues with app engine / datanucleus.
I checked:
- The jar is not copied in the war/WEB-INF/lib folder
- The jar is present in the Maven Dependencies of the project build path
- The Maven Dependencies are automatically included in the Classpath of the project configuration.
What I am looking for is a means to avoid having the jar being part of the runtime classpath.
Thanks in advance for any hint you may offer,
Sébastien
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要将
范围
定义为provided
。这假设您将在运行时为您的应用程序提供依赖项。当然,它将用于编译您的代码。You need to define the
scope
asprovided
. This assumes you will have the dependency provided for your application at runtime. It will, of course, be used to compile your code.看起来很像 http://code.google.com /p/google-web-toolkit/issues/detail?id=4929
Looks a lot like http://code.google.com/p/google-web-toolkit/issues/detail?id=4929
使用最新版本的 lombok (0.10.0-RC1) 可以解决该问题。
Using the latest version of lombok (0.10.0-RC1) solves the issue.