开发者

How do I configure Maven Cargo to use an embedded Tomcat 6 server?

I'm using Maven 3.0.3. Is there a way I can use the Maven Cargo plugin to spin up an embedded Tomcat server? Right now, it seems I have to install it myself first. I get this error when I try and change the container type to "embedded" ...

[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.1.2:run (default-cli) on project jx: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.1.2:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [tomcat6x], type = [embedded]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1]

The configuration that I used was ...

                            <plugins>
                                    <plugin>
                                            <groupId>org.codehaus.cargo</groupId>
                                            <artifactId>cargo-maven2-plugin</artifactId>
                                            <configuration>
                                                    <container>
                                                            <containerId>tomcat6x</containerId>
                                                            <type>embedded</type>
                                                    </container>

                                                    <configuration>
                                                            <properties>
                                                                    <cargo.servlet.port>8080</cargo.servlet.port>
                                                                    <cargo.logging>high</cargo.logging>
     开发者_运维知识库                                                       </properties>

Any help is appreciated. The reason I'm not using the Maven embedded Tomcat plugin is that it doesn't support multiple deployment artifacts. Thanks, - Dave


From cargo documentation Embedded Container is not supported on tomcat6. It is only supported for jetty.


Maybe the t7mp Plugin would be an alternative? The Overview of the configuration options shows how to deploy multiple webapps and how to configure shared libs. As far as I know the current version is not available in maven central so you would have to download it from github and build and deploy it yourself.

When running it populates the target/tomcat folder with the libs of a specified tomcat 6 or 7 version and bootstrap tomcat using a new classloader in the same jvm.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜