Maven EJB packaging with dependent libraries

試著忘記壹切 提交于 2019-11-30 05:36:41

I managed to solve the problem. It seems that these libraries has to be packaged within /lib directory and not in root of EAR. Adding defaultLibBundleDir element solved the problem.

E.g.:

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ear-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <defaultLibBundleDir>lib</defaultLibBundleDir>
...

Did you leave the <addClasspath>true</addClasspath> on the EJB config?

Well, you can leave it like this, but you'll get a heap of log entries (WARN) on server start complaining about the classpath entries. I prefer to set it to false. <addClasspath>false</addClasspath>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!