java - 如何配置 Maven cargo 下载部署 Wildfly 10 并添加测试用户?

标签 java maven ejb pom.xml

我在 Maven cargo 上发现了这个设置:

<plugin>
    <inherited>false</inherited>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven3-plugin</artifactId>
    <configuration>
        <container>
            <containerId>wildfly10x</containerId>
            <zipUrlInstaller>
                <url>http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.zip</url>
                <downloadDir>${project.basedir}/.cargo/downloads</downloadDir>
                <extractDir>${project.basedir}
                    /.cargo/extracts</extractDir>
            </zipUrlInstaller>
        </container>
    </configuration>
    <executions>
        <execution>
            <id>install-cargo</id>
            <phase>process-test-resources</phase>
            <goals>
                <goal>install</goal>
            </goals>
        </execution>
    </executions>
</plugin>

但这似乎不起作用。

谁能给我提供正确的配置。

我还想添加一个用户。如何做到这一点?

最佳答案

这对我有用:

<profiles>
        <!-- mvn clean package cargo:run -->
        <profile>
            <id>wildfly-standalone</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                        <artifactId>cargo-maven2-plugin</artifactId>
                        <version>${cargo-maven2-plugin.version}</version>

                        <configuration>

                            <container>
                                <containerId>wildfly10x</containerId>
                                <zipUrlInstaller>
                                    <url>http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.zip</url>
                                </zipUrlInstaller>
                            </container>

                            <configuration>
                                <properties>
                                    <cargo.hostname>127.0.0.1</cargo.hostname>
                                    <cargo.jboss.management-http.port>9990</cargo.jboss.management-http.port>
                                    <cargo.servlet.users>testUser:admin1234!</cargo.servlet.users>
                                </properties>
                            </configuration>

                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

要下载并安装设置,您需要运行以下命令:

mvn clean package cargo:run

关于java - 如何配置 Maven cargo 下载部署 Wildfly 10 并添加测试用户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41602443/

相关文章:

Java List 如何设置和获取父类型列表的子对象

java - JDBC 问题 : not being able to correctly bind variables and values (shortened)

java - javax.inject.Singleton 和 javax.ejb.Singleton 的区别

java - Eclipse (JBoss Developer Studio) 不自动构建 JPA 元模型类

java - 使用 ant 运行 32 位 java 时的类路径长度

jakarta-ee - 从非托管类获取 EntityManager

jakarta-ee - 如果有异步方法仍在运行,无状态 session 是否会被另一个线程使用?

java - 目录创建失败...Java、Android

java - 在 Spring 事务管理中使用自定义超时

java - AspectJ Maven 插件无法编译我的项目