0

I am following the instructions here to try to pass in a custom property to my glassfish 4 container. https://codehaus-cargo.github.io/cargo/Passing+system+properties.html I have it set up in my pom as:

<plugin>    
                    <groupId>org.codehaus.cargo</groupId>
                    <artifactId>cargo-maven2-plugin</artifactId>
                    <version>1.5.0</version>
                    <configuration> 

                        <container>
                            <containerId>${glassfishId}</containerId>
                            <type>remote</type>
                            <systemProperties>
                                <foofy>barr</foofy>
                            </systemProperties>
                        </container>        
                        <configuration>
                            <type>runtime</type>
                            <properties>
                                <cargo.hostname>${target}</cargo.hostname>
                                <cargo.remote.name>wiley</cargo.remote.name>
                                <cargo.remote.username>${username}</cargo.remote.username>
                                <cargo.remote.password>${password}</cargo.remote.password>
                                <cargo.glassfish.admin.port>4848</cargo.glassfish.admin.port>
                            </properties>
                        </configuration>
                        <deployables>
                            <deployable>
                              <artifactId>wiley</artifactId>
                              <type>war</type>
                              <properties>
                                <context>/wiley</context>
                              </properties>
                            </deployable>
                        </deployables>              
                    </configuration>
                    <dependencies>
                        <dependency> 
                            <groupId>org.glassfish.deployment</groupId> 
                            <artifactId>deployment-client</artifactId> 
                            <version>3.2-b06</version> 
                        </dependency>
                    </dependencies>
                </plugin>    

But when I try to access foofy in the java code using either System.getenv("foofy") or System.getProperty("foofy") both return null. I googled a lot, all working examples seem to be with Tomcat. Does this not work with Glassfish when type="remote"?

vanval
  • 997
  • 1
  • 9
  • 19

1 Answers1

0

Looked into the cargo source code, looks like system properties, and configuration files - both these features are not supported in remote mode. Ended up running an ant task prior to cargo plugin to modify my war to replace certain configuration files.

vanval
  • 997
  • 1
  • 9
  • 19