2

For example, I want to use the Wildfly deploy plugin, as outlined here:

http://docs.jboss.org/wildfly/plugins/maven/latest/deploy-artifact-mojo.html

To deploy, I would use a command like mvn wildfly:deploy -Dfilename=my.ear. But let's say I want to deploy to a particular server group. Using a POM, I would add:

<plugin>
 <groupId>org.wildfly.plugins</groupId>
 <artifactId>wildfly-maven-plugin</artifactId>
 <version>1.1.0.Alpha1</version>
 <configuration>
   <domain>
     <server-groups>
       <server-group>main-server-group</server-group>
     </server-groups>
   </domain>
 </configuration>
</plugin>

But if I can't change the POM, how would I pass this configuration in on the CLI or in $HOME\.m2\settings.xml?

The usage page indicates a configuration "type" of org.wildfly.plugin.deployment.domain.Domain for a "domain" option but I don't know how to type those options out on the CLI. Obvious answers like -Ddomain.server-groups.server-group=my-server-group don't seem to work.

jordanpg
  • 6,386
  • 4
  • 46
  • 70

2 Answers2

1

If you could change the pom using a property like <server-group>${server.group}</server-group> should work. I don't think maven has support for complex attribute properties like that.

If that's not possible you could file a feature request.

James R. Perkins
  • 16,800
  • 44
  • 60
  • Thanks. The question was, given that I can't change the POM, is this possible on the CLI or through local settings.xml. It would surprise me if it wasn't possible on the CLI somehow. – jordanpg May 12 '15 at 19:10
  • The issue is the parameter for the configuration is a Domain object. I don't think maven supports properties to complex configuration parameters. I think something would have to be introduced to allow maybe a comma delimited property value that can be parsed. – James R. Perkins May 12 '15 at 20:03
0

Not exactly the answer to the overall question, but to your specific problem.

Changing the version in the pom to 1.2.2.Final, you can now do:

-Dwildfly.serverGroups=main-server-group

which I guess wasn’t available in 1.1.0.

achAmháin
  • 4,176
  • 4
  • 17
  • 40