简体   繁体   English

Glassfish部署项目的依赖库

[英]Glassfish deployed project's dependency libraries

I'm new to Java and dependency management. 我是Java和依赖管理的新手。

I have an EJB jar project with a few maven dependencies. 我有一个带有几个Maven依赖项的EJB jar项目。 When deploying the project to glassfish I get exceptions, that the classes from those dependencies are not found. 将项目部署到glassfish时,出现异常,即找不到那些依赖项中的类。 So I've added a maven plugin to copy over the dependencies from the local repository to {glassfish_dir}/glassfish/domains/domain1/lib every build. 因此,我添加了一个maven插件,将依赖关系从本地存储库复制到每个版本的{glassfish_dir}/glassfish/domains/domain1/lib I'm also using Netbeans. 我也在使用Netbeans。

Is copying over the the dependencies the proper way to go about this? 复制依赖项是解决此问题的正确方法吗? Is there a better way to make dependencies work with glassfish? 有没有更好的方法来使依赖项与glassfish一起工作?

The best way is to make the Maven pom.xml that builds the .war declare a dependency on your EJB jar project. 最好的方法是使构建.war的Maven pom.xml声明对EJB jar项目的依赖。 That way your EJB jar and any libraries that it has a dependency on, will be included in the .war file that Maven builds. 这样,您的EJB jar和它依赖的所有库将包含在Maven构建的.war文件中。

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

相关问题 依赖项的Jar未部署到Web项目 - Dependency's Jar not being deployed to Web Project 项目没有在glassfish服务器中部署 - project not geting deployed in glassfish server 如何用EAR中附带的依赖项取代Glassfish的内置库? - How to superseed Glassfish's built-in libraries with dependencies shipped in EAR? gradle项目是否依赖于另一个项目获得库? - Does gradle project with dependency to another project get libraries? Maven 项目 - 我的依赖项中是否存在未部署到生产环境的漏洞? - Maven project - Do I have a vulnerability in a dependency that is not deployed to production? 无法将我的项目部署到之前在Glassfish上部署过的tomcat - Unable to deploy my project on tomcat where i have deployed previously on glassfish 当使用Eclipse在Glassfish上重命名和部署动态Web项目的名称时,获取HTTP状态404 - 未找到 - Get HTTP Status 404 - Not Found, when the name of a dynamic web project renamed and deployed on Glassfish with Eclipse Maven 依赖项出现在外部库中,但在项目中使用时出错 - Maven dependency showing up in External Libraries, but errors when used in project Websocket客户端无法部署到Glassfish - Websocket client can not be deployed to Glassfish 防止Glassfish使用自己的库版本而不是项目中的库 - Prevent Glassfish from using its own versions of libraries instead of those in a project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM