Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.0
-
Fix Version/s: 1.0.1-beta-2, 1.0.1-beta-3, 1.0.1
-
Component/s: Maven2
-
Labels:None
-
Environment:Maven2
-
Complexity:Intermediate
-
Patch Submitted:Yes
-
Number of attachments :
Description
An interesting functionality for the Maven2 CARGO plug-in would be the following:
1. The user enters all server information (connector URLs, user names, passwords, ...) in its settings.xml file
2. When calling that server, it would only give the server name to CARGO and all options would be deduced automatically.
An example:
The Maven settings.xml file contains:
[...]
<servers>
<server>
<id>jonas1</id>
<configuration>
<cargo.remote.uri>jmx://jonas1</cargo.remote.uri>
<cargo.jonas.domain.name>jonas</cargo.jonas.domain.name>
<cargo.remote.username>jonas</cargo.remote.username>
<cargo.remote.password>jonas</cargo.remote.password>
</configuration>
</server>
<server>
<id>jonas2</id>
<configuration>
<cargo.remote.uri>jmx://jonas2</cargo.remote.uri>
<cargo.jonas.domain.name>jonas</cargo.jonas.domain.name>
<cargo.remote.username>jonas</cargo.remote.username>
<cargo.remote.password>jonas</cargo.remote.password>
</configuration>
</server>
<servers>
[...]
In this case, the following configuration in a pom.xml file:
[...]
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<configuration>
<container>
<containerId>jonas4x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.jonas.server.name>jonas1</cargo.jonas.server.name>
<cargo.jonas.domain.name>jonas</cargo.jonas.domain.name>
</properties>
</configuration>
</configuration>
</plugin>
[...]
would automatically be "expanded" into:
[...]
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<configuration>
<container>
<containerId>jonas4x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.uri>jmx://jonas1</cargo.remote.uri>
<cargo.remote.username>jonas</cargo.remote.username>
<cargo.remote.password>jonas</cargo.remote.password>
<cargo.jonas.server.name>jonas1</cargo.jonas.server.name>
<cargo.jonas.domain.name>jonas</cargo.jonas.domain.name>
</properties>
</configuration>
</configuration>
</plugin>
[...]
I'm attaching the patch to the Maven plug-in to achieve the functionality
This sounds like a good idea.
The only comment I have with this it to call the variable that sets it something like cargo.server.settings instead of cargo.<container_name>.server.name to make it the same variable name across containers.