Tomcat 7 - Maven 插件?

发布于 2024-09-19 12:31:29 字数 135 浏览 4 评论 0原文

我只是想仔细检查一下,是否有人找到或正在开发 Tomcat 7 插件?如果没有,有人有兴趣帮助我启动和运行它吗?

我想要 Glassfish 的另一个快速替代品,JBoss AS 6.0 对于快速模型来说仍然有点重。

沃尔特

I just wanted to double-check, has anyone found or is working on a Tomcat 7 plugin? If not, is anyone interested in helping me get it up and running?

I want another quick alternative to Glassfish, JBoss AS 6.0 is a bit heavy still for quick mockups.

Walter

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

梦途 2024-09-26 12:31:30

使用 Maven Cargo 你可以这样配置你的项目:

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.0.6</version>
    <configuration>
        <container>
            <containerId>tomcat7x</containerId>
            <type>installed</type>
            <home>${catalina.home}</home>
        </container>
        <configuration>
            <type>existing</type>
            <home>${catalina.home}</home>
        </configuration>
        <deployer>
            <type>installed</type>
            <deployables>
                <deployable>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>${project.artifactId}</artifactId>
                    <type>war</type>
                </deployable>
            </deployables>
        </deployer>
    </configuration>
</plugin>       

不要忘记配置你的 catalina.home 属性

,你可以使用以下方式部署它:

mvn cargo:deploy

Using maven cargo your can coufigure your project that way :

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.0.6</version>
    <configuration>
        <container>
            <containerId>tomcat7x</containerId>
            <type>installed</type>
            <home>${catalina.home}</home>
        </container>
        <configuration>
            <type>existing</type>
            <home>${catalina.home}</home>
        </configuration>
        <deployer>
            <type>installed</type>
            <deployables>
                <deployable>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>${project.artifactId}</artifactId>
                    <type>war</type>
                </deployable>
            </deployables>
        </deployer>
    </configuration>
</plugin>       

don't forget to configure your catalina.home property

The you can deploy it using:

mvn cargo:deploy
天煞孤星 2024-09-26 12:31:30

Apache Tomcat 团队开发了 Tomcat Maven Plugin 7 插件。

目前,您必须签出源并将其安装到本地存储库。
之后你可以在 pom 的插件部分使用它:

      <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat7-maven-plugin</artifactId>
          <version>2.0-SNAPSHOT</version>
        <executions>
          <execution>
            <id>start-tomcat</id>
            <phase>compile</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
                  <path>/</path>
                  <serverXml>src/main/tomcatconf/server.xml</serverXml>
                </configuration>
          </execution>
        </executions>
      </plugin>

There is the Tomcat Maven Plugin 7 plugin developed by the Apache Tomcat team.

Currently you have to checkout the sources and install it to your local repository.
After that you can use it in the plugin section of your pom:

      <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat7-maven-plugin</artifactId>
          <version>2.0-SNAPSHOT</version>
        <executions>
          <execution>
            <id>start-tomcat</id>
            <phase>compile</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
                  <path>/</path>
                  <serverXml>src/main/tomcatconf/server.xml</serverXml>
                </configuration>
          </execution>
        </executions>
      </plugin>
薯片软お妹 2024-09-26 12:31:30

在我连续三天遇到此错误后,这是我的解决方案:

您用于连接的用户至少需要角色管理器脚本。
在你的 /conf/tomcat-users.xml 中

<role rolename="manager-script"/>
<user username="test" password="test" roles="manager-script"/>

在你的 pom.xml 中,包含以下插件

    <plugin>
      <groupId>org.apache.tomcat.maven</groupId>
      <artifactId>tomcat7-maven-plugin</artifactId>
      <version>2.0</version>
      <configuration>
        <url>http://server.url:8080/manager/text</url>
        <path>/YourApp</path>
        <username>test</username>
        <password>test</password>
      </configuration>
    </plugin>

与我在互联网上发现的相反,你不需要编辑你的 Maven 设置.xml。 tomcat7-maven-plugin可以直接在configuration-tag中配置

url-tag的一句话:我测试了后缀

  • /manager
  • /manager/html
  • /manager/text

其中只有 /manager/text 有效

我的版本:

  • Tomcat: 7.0.33
  • Maven:3.0.4
  • tomcat7-maven-插件:2.0
  • Java:1.7.0_07

After I had this error for three days in a row, here's my solution:

The user you are using to connect needs at least the role manager-script.
In your /conf/tomcat-users.xml

<role rolename="manager-script"/>
<user username="test" password="test" roles="manager-script"/>

In your pom.xml, include the following plugin

    <plugin>
      <groupId>org.apache.tomcat.maven</groupId>
      <artifactId>tomcat7-maven-plugin</artifactId>
      <version>2.0</version>
      <configuration>
        <url>http://server.url:8080/manager/text</url>
        <path>/YourApp</path>
        <username>test</username>
        <password>test</password>
      </configuration>
    </plugin>

Contrary to what I found in the internet you DON'T need to edit your maven setting.xml. The tomcat7-maven-plugin can be configured directly in the configuration-tag

A word to the url-tag: I tested the suffix

  • /manager
  • /manager/html
  • /manager/text

of which only /manager/text worked

My versions:

  • Tomcat: 7.0.33
  • Maven: 3.0.4
  • tomcat7-maven-plugin: 2.0
  • Java: 1.7.0_07
空袭的梦i 2024-09-26 12:31:30

我正在将 tomcat7-maven-plugin 用于嵌入式 tomcat 实例。这是我的配置方法。由于我的应用程序需要 jaas 身份验证,我也可以在设置本身中提供该身份验证。

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <configuration>
    <!-- http port -->
        <port>8080</port>
        <path>/gcs-explorers</path>
        <contextFile>${basedir}/src/main/webapp/META-INF/context.xml</contextFile>
        <addWarDependenciesInClassloader>true</addWarDependenciesInClassloader>
        <systemProperties>
            <java.security.auth.login.config>${basedir}/conf/jaas.config</java.security.auth.login.config>
        </systemProperties>
        <url>http://127.0.0.1:8080/manager/html</url>
        <username>admin</username>
        <password>admin</password>
        <addContextWarDependencies>true</addContextWarDependencies>
        <addWarDependenciesInClassloader>true</addWarDependenciesInClassloader>
        <configurationDir>${basedir}</configurationDir>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>2.2.0</version>
            <type>jar</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.company.package.jaas</groupId>
            <artifactId>gcs-jaas</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <type>jar</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.company.gcs</groupId>
            <artifactId>package-file-share</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.3</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
</plugin>

I'm using tomcat7-maven-plugin for my embedded tomcat instance. Here is how I have configured it. Since my app requires jaas authentication I can also provide that in the setting itself.

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <configuration>
    <!-- http port -->
        <port>8080</port>
        <path>/gcs-explorers</path>
        <contextFile>${basedir}/src/main/webapp/META-INF/context.xml</contextFile>
        <addWarDependenciesInClassloader>true</addWarDependenciesInClassloader>
        <systemProperties>
            <java.security.auth.login.config>${basedir}/conf/jaas.config</java.security.auth.login.config>
        </systemProperties>
        <url>http://127.0.0.1:8080/manager/html</url>
        <username>admin</username>
        <password>admin</password>
        <addContextWarDependencies>true</addContextWarDependencies>
        <addWarDependenciesInClassloader>true</addWarDependenciesInClassloader>
        <configurationDir>${basedir}</configurationDir>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>2.2.0</version>
            <type>jar</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.company.package.jaas</groupId>
            <artifactId>gcs-jaas</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <type>jar</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.company.gcs</groupId>
            <artifactId>package-file-share</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.3</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
</plugin>
把人绕傻吧 2024-09-26 12:31:30

实际上,标准插件适合我。我只需在 tomcat 用户中创建角色管理器脚本并将 url 参数更改为 http://localhost:8080/manager/html 即可使其工作:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <configuration>
        <url>http://localhost:8080/manager/html</url>
        <server>local</server>
        <path>/${project.artifactId}</path>
        <update>true</update>
    </configuration>
</plugin>

Actually, the standard plugin works for me . I just had to create the role manager-script in tomcat users and change the url parameter to http://localhost:8080/manager/html in order to make it work :

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <configuration>
        <url>http://localhost:8080/manager/html</url>
        <server>local</server>
        <path>/${project.artifactId}</path>
        <update>true</update>
    </configuration>
</plugin>
帝王念 2024-09-26 12:31:30

对于 Tomcat 7,

步骤 1:
服务器添加

Document base: <PATH>\Apache-Tomcat-7.0.0\webapps\manager
Path: /manager

步骤 2 的“模块”选项卡:
将 POM 更新为:

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>tomcat-maven-plugin</artifactId>
        <configuration>
          <url>http://localhost:8080/manager/text</url>
          <update>true</update>
                <warFile>target/${project.artifactId}-${project.version}.war</warFile>
                <path>/${project.artifactId}</path>
                <username>tomcat_user</username>
                <password>tomcat_password</password>
        </configuration>
</plugin>

For Tomcat 7,

Step 1:
Modules tab of server add

Document base: <PATH>\Apache-Tomcat-7.0.0\webapps\manager
Path: /manager

Step 2:
Update POM to:

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>tomcat-maven-plugin</artifactId>
        <configuration>
          <url>http://localhost:8080/manager/text</url>
          <update>true</update>
                <warFile>target/${project.artifactId}-${project.version}.war</warFile>
                <path>/${project.artifactId}</path>
                <username>tomcat_user</username>
                <password>tomcat_password</password>
        </configuration>
</plugin>
多情癖 2024-09-26 12:31:29

它对我来说如下。

我的setting.xml

 <server>  
   <id>local_tomcat</id>  
   <username>ray</username>  
   <password>password</password>  
 </server>  

我的插件配置

 <plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>tomcat-maven-plugin</artifactId>
  <configuration>
     <server>local_tomcat</server>  
     <url>http://localhost:8080/manager/text</url>  
  </configuration>
 </plugin>

我的tomcat-users.xml

 <role rolename="manager-gui"/>
    <role rolename="manager-script"/>
  <user password="password" roles="manager-gui, manager-script" username="ray"/>

It work for me as the following.

My setting.xml

 <server>  
   <id>local_tomcat</id>  
   <username>ray</username>  
   <password>password</password>  
 </server>  

My plugin configuration

 <plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>tomcat-maven-plugin</artifactId>
  <configuration>
     <server>local_tomcat</server>  
     <url>http://localhost:8080/manager/text</url>  
  </configuration>
 </plugin>

My tomcat-users.xml

 <role rolename="manager-gui"/>
    <role rolename="manager-script"/>
  <user password="password" roles="manager-gui, manager-script" username="ray"/>
情场扛把子 2024-09-26 12:31:29

我使用 Apache 的官方 Tomcat7 Maven 插件,如下所示:

            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.0</version>
                <configuration>
                    <path>/${project.artifactId}</path>
                    <port>8080</port>
                </configuration>
            </plugin>

并运行它:mvn tomcat7:run

i use the official Tomcat7 Maven Plugin from Apache as follows:

            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.0</version>
                <configuration>
                    <path>/${project.artifactId}</path>
                    <port>8080</port>
                </configuration>
            </plugin>

and to run it: mvn tomcat7:run

满地尘埃落定 2024-09-26 12:31:29

Google 代码上有 t7mp - 一个 Tomcat 7 Maven 插件。

Cargo(及其 Cargo Maven2 插件)也支持 Tomcat 7 (这是 CARGO-790)。

Apache Tomcat Maven 插件 2.0-beta-1 支持 Tomcat 7。

There is t7mp - a Tomcat 7 Maven Plugin - on Google code.

Cargo (and its Cargo Maven2 Plugin) also has support for Tomcat 7 (this was CARGO-790).

Apache Tomcat Maven Plugin 2.0-beta-1 supports Tomcat 7.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文