使用不同的eclipselink,而不是捆绑在glassfish-embedded-web中 [英] Using different eclipselink than bundled in glassfish-embedded-web

查看:102
本文介绍了使用不同的eclipselink,而不是捆绑在glassfish-embedded-web中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



 <依赖关系>使用glassfish-embedded-web进行maven项目中的集成测试
< groupId> org.glassfish.extras< / groupId>
< artifactId> glassfish-embedded-web< / artifactId>
< version> 3.2-b06< / version>
< scope> test< / scope>
< /依赖关系>

glassfish-embedded-web附带Eclipselink 2.2.0,但该项目需要2.4的功能。对于常规部署,这可以通过将je所需的jar添加到glassfish的模块目录和此依赖项来解决:

 < dependency> 
< groupId> org.eclipse.persistence< / groupId>
< artifactId> org.eclipse.persistence.core< / artifactId>
< version> 2.4.1< / version>
< scope>提供< / scope>
< /依赖关系>

我也试过编译范围,但仍然使用嵌入式EL 2.2.0。在EL 2.4.1上添加测试范围依赖关系并没有帮助。有没有什么办法可以解决这个问题?

解决方案

我看到了这个问题的两种可能的解决方案: glassfish-embedded ,或者您只是使用暴力方法并修改jar

第一种方法:
花了一些时间来构建GF之后,我发现即使使用我的dilettante shell脚本技能,只是使用第二种方法,而不是计算GF代码。不过,如果你想要这个,我建议从 oracle wiki 开始。


第二种方法:正如我前面提到的,在我看来,自动化这项任务是最好的方法(至少如果你'处理大量库和不断变化),所以我写了这个脚本并提供了所有必要的说明关于如何使用它。在获取新jar之后,只需安装在您当地的回购中。我正在使用 Nexus ,因此对于我来说,这是一对夫妇按钮被按下的问题。



PS:欢迎对脚本提出任何意见/建议/改进。


I use glassfish-embedded-web for integration tests inside a maven project:

    <dependency>
        <groupId>org.glassfish.extras</groupId>
        <artifactId>glassfish-embedded-web</artifactId>
        <version>3.2-b06</version>
        <scope>test</scope>
    </dependency>

glassfish-embedded-web comes with Eclipselink 2.2.0, but the project requires features of 2.4. For regular deployment, this is solved by adding je required jars to glassfish's modules directory and this dependency:

    <dependency>
      <groupId>org.eclipse.persistence</groupId>
      <artifactId>org.eclipse.persistence.core</artifactId>
      <version>2.4.1</version>
      <scope>provided</scope>
    </dependency>

I tried also compile scope, still the embedded EL 2.2.0 is used. Adding a test scope dependency on EL 2.4.1 doesn't help. Is there any way to solve this?

解决方案

I see two possible solutions to this problem: either you build your own glassfish-embedded or you just use a brute force approach and modify the jar.

On the 1st approach: After spending some time building GF I figured that even with my dilettante shell scripting skills its easier to just use the second approach instead of figuring GF code. However, if you're up for this one I'd suggest to start at oracle wiki.

On the 2nd approach: As I've mentioned above, automating this task is the best approach in my opinion (at least if you're dealing with numerous libs and continuous changes), so I wrote this script with all the necessary instructions on how to use it. After you get the new jar just install it in your local repo. I'm using Nexus so for me it was a matter of couple buttons getting pressed.

P.S.: Any comments/advices/improvements on the script are welcome.

这篇关于使用不同的eclipselink,而不是捆绑在glassfish-embedded-web中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆