fwelland
fwelland

Reputation: 545

JBOSS CLI adding module with optional dependency

I have a module.xml that looks like:

<module xmlns="urn:jboss:module:1.1" name="com.oracle">
    <resources>
        <resource-root path="ojdbc6.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
        <module name="javax.servlet.api" optional="true"/>
    </dependencies>    

Using JBOSS-CLI one can do this:

./jboss-cli.sh -c --command="module add --name=com.oracle --resources=<path-to-file>/ojdbc6.jar --dependencies=javax.api,javax.transaction.api,javax.servlet.api" 

to deploy the module. It is almost the same exact thing and the module.xml is generated; so I need not keep track of another xml.

But how can I get the 'optional="true"' from JBOSS-CLI?

Version: JBOSS-EAP 6.2.0. (would be great if I can find a solution that would work for either jboss 6.x EAP and wildfly 8x).

Upvotes: 2

Views: 4138

Answers (1)

shonky linux user
shonky linux user

Reputation: 6428

The CLI module command appears to only support simple dependencies.

You could work around it by supplying a pre-generated modules.xml file and specifying it in the CLI command using

--module-xml=filepath_to_modules.xml

Upvotes: 4

Related Questions