[英]How to add libraries to Wildfly Application Server using module?
I want to load the Application server Libraries in Java Build Path in Eclipse, 我想在Eclipse的Java Build Path中加载Application Server库,
I have 5 applications in Eclipse which shares common libraries, I can't put all the libraries in each project lib folder, so i want to add the libraries in Wildfly Application server using modules. 我在Eclipse中有5个共享公用库的应用程序,我不能将所有库都放在每个项目的lib文件夹中,所以我想使用模块在Wildfly Application Server中添加这些库。
This is my module.xml
file add added the lib at WILDFLY_HOME/modules/system/layers/base/com/mysql/main/mysql-connector-java-5.1.23-bin.jar
这是我的
module.xml
文件,它在WILDFLY_HOME/modules/system/layers/base/com/mysql/main/mysql-connector-java-5.1.23-bin.jar
添加了lib
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.23-bin.jar" />
</resources>
<dependencies>
<module name="javax.api" />
<module name="javax.transaction.api" />
</dependencies>
</module>
After Restarting the server, this module is not loading in Eclipse Build path. 重新启动服务器后,此模块未在Eclipse构建路径中加载。
Can any one knows what wrong with this modules ? 有人知道这个模块有什么问题吗?
In Wildfly I have some predefined modules, those are loading in build path successfully, but user-defined modules are not loading ? 在Wildfly中,我有一些预定义的模块,这些模块已成功加载到构建路径中,但是用户定义的模块未加载?
Why ? 为什么呢
Solution found: 找到解决方案:
Follow below steps : 请按照以下步骤操作:
Go To Eclipse > preferences > Server > Runtime Environments > Default Classpath Entries 转到Eclipse>首选项>服务器>运行时环境>默认类路径条目
Select "Wildfly 8.x Runtime" and add a module 选择“ Wildfly 8.x运行时”并添加一个模块
and click on apply, now rebuild your application and check, 并点击“应用”,现在重建您的应用并检查,
the library will be added in buildpath by module name. 该库将通过模块名称添加到buildpath中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.