Question

I see that supports GlassFish v3, but the online examples is sparse. I continue to get the same error back from cargo: Cannot find the GlassFish admin CLI JAR: admin-cli.jar

Here is my pom

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.0.3</version>
    <configuration>
        <container>
            <containerId>glassfish3x</containerId>
            <type>installed</type>
        </container>
        <configuration>
            <type>standalone</type>
            <home>C:\glassfishv3</home>
            <properties>
                <cargo.hostname>localhost</cargo.hostname>
                <cargo.servlet.port>8082</cargo.servlet.port>
                <cargo.remote.username></cargo.remote.username>
                <cargo.remote.password></cargo.remote.password>
            </properties>
        </configuration>
        <deployer>
            <type>installed</type>
            <deployables>
                <deployable>
                    <groupId>${groupId}</groupId>
                    <artifactId>${artifactId}</artifactId>
                    <type>war</type>
                </deployable>
            </deployables>
        </deployer>
    </configuration>
</plugin>

corrected Pom:

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.0.3</version>
    <configuration>
        <container>
            <containerId>glassfish3x</containerId>
            <type>installed</type>
            <home>C:\glassfishv3</home>
        </container>
        <configuration>
            <type>standalone</type>
            <properties>
                <cargo.hostname>localhost</cargo.hostname>
                <cargo.servlet.port>8082</cargo.servlet.port>
                <!-- if no username/password don't use these, it will fail
                <cargo.remote.username></cargo.remote.username>
                <cargo.remote.password></cargo.remote.password> -->
            </properties>
        </configuration>
        <deployer>
            <type>installed</type>
            <deployables>
                <deployable>
                    <groupId>${groupId}</groupId>
                    <artifactId>${artifactId}</artifactId>
                    <type>war</type>
                </deployable>
            </deployables>
        </deployer>
    </configuration>
</plugin>
Was it helpful?

Solution

In your Glassfish installation, do you have the admin-cli.jar file present in modules directory?

For more information about this module, check this link.


Edit

It seems that you have a problem in your configuration. As you can see here, there are several <home> nodes that can be used in the <configuration> of the Cargo plugin.

If you define the <home> inside the <configuration> tag, like you do in your pom.xml, this tag is used for:

For standalone configuration this is the location where Cargo will create the configuration and for existing configuration this is where it is located

However, in your case, you must move the <home> in the <container> tag. As described in the link above, this <home> is used for:

Location where the container is installed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top