2

我看到支持 GlassFish v3,但在线示例很少。我继续从货物返回相同的错误:找不到 GlassFish 管理员 CLI JAR:admin-cli.jar

这是我的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>

更正了 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>
4

1 回答 1

4

在您的 Glassfish 安装中,您的目录中是否存在该admin-cli.jar文件modules

有关此模块的更多信息,请查看此链接


编辑

看来您的配置有问题。正如你在这里看到的,有几个<home>节点可以在<configuration>Cargo 插件中使用。

如果您定义标签<home>内部<configuration>,就像您在 中所做的那样pom.xml,此标签用于:

对于独立配置,这是 Cargo 将创建配置的位置,对于现有配置,这是它所在的位置

但是,在您的情况下,您必须<home><container>标签中移动。如上面链接中所述,这<home>用于:

安装容器的位置。

于 2010-09-30T17:35:44.860 回答