maven and jboss modules

↘锁芯ラ 提交于 2019-12-24 03:27:23

问题


I'm new to maven and jboss so I'm tring to get benefit of cooperation between them. I have a maven project in eclipse. The project has many dependencies that at runtime I want to provide as module from jboss, otherwise my EAR will be very big. I also use a nexus repo for my dependencies. My question is: is there a way to sync the dependencies I have at compile time in my pom.xml with modules on jboss? Is there a way to create jboss modules according to dependencies I declared in pom?

Probably I'm doing something wrong, because I'm loosing many time configuring jboos modules on the server and declaring dependencies in jboss-deplyment-structure.xml exactly they are in pom files. What's Is the best practice?

Keep in mind that my first requirement is to not put all JAR in the EAR.

Thanks


回答1:


The smartics JBoss Modules Maven Plugin creates the modules structure based on dependencies declared in your POM. Usually you have to fine tune the configuration to match your requirements.

This blog article may give you the basic idea to judge if this is the right approach to tackle your problem: Modules Descriptor for smartics-jboss-modules-maven-plugin

You'll find more information on the plugin (and the project blog) on the plugin's site.

The project is available on GitHub.

Disclaimer: I'm one of the authors of this plugin. :)




回答2:


define module dependencies in pom.xml

maven-assembly-plugin:single collects dependency jars.

Generate module.xml with xslt:

maven-dependency-plugin:build-classpath creates a property containing the modules as one string. Now run maven-antrun-plugin with a build.xml containing JavaScript that splits the classpath string giving individual jars and adds them to ant properties, using a prefix. echoproperties writes these properties to an xml file giving the input for xslt.



来源:https://stackoverflow.com/questions/28573009/maven-and-jboss-modules

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