简体   繁体   English

如何为*嵌入式* JBoss将jar添加到服务器库?

[英]How to add a jar to the server lib for *embedded* JBoss?

I need to add a crypto provider to the embedded JBoss used by Seam for integration tests. 我需要向Seam用于集成测试的嵌入式JBoss添加一个加密提供程序。

For the regular JBoss it's a simple matter, just drop the files into the /lib folder of the server instance. 对于普通的JBoss,这很简单,只需将文件放入服务器实例的/ lib文件夹中即可。 With the embedded JBoss, however, things seem to be different. 但是,对于嵌入式JBoss,情况似乎有所不同。 I've tried putting the jars in /embedded-jboss/bootstrap/lib and /embedded-jboss but no change, the classes are not seen. 我试过把罐子放在/ embedded-jboss / bootstrap / lib和/ embedded-jboss中,但是没有变化,看不到类。

I've read http://community.jboss.org/wiki/EmbeddedAndJavaSE and also looked in the source of org.jboss.embedded.Bootstrap but I haven't found a way yet. 我已经阅读了http://community.jboss.org/wiki/EmbeddedAndJavaSE ,还查看了org.jboss.embedded.Bootstrap的源代码,但我还没有找到方法。 The build is done with Maven if it matters. 如果重要,则使用Maven完成构建。

Thanks a lot for any suggestions. 非常感谢您的任何建议。

I found an answer in the meantime: they can be added to the classpath of the plugin that runs the tests, like below. 在此期间,我找到了一个答案:可以将它们添加到运行测试的插件的类路径中,如下所示。 Works for me. 为我工作。

 <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <!-- snip -->
        <additionalClasspathElements>
            <additionalClasspathElement>add/here/your/jar</additionalClasspathElement>
        </additionalClasspathElements>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM