问题标签 [maven-tomcat-plugin]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
11240 浏览

remote-debugging - 如何为 mvn tomcat 插件(jpda)设置 agentlib 属性

Eclipse 调试远程 Web 应用程序相关=>如何在我的 Eclipse 中调试远程应用程序

如何在 mvn tomcat 插件中设置/存档? http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/tomcat7-maven-plugin/

唯一可能有帮助的是设置 systemProperty 但这对我不起作用;/

目标:让tomcat通过maven在控制台上运行,但对不同的IDE启用远程调试

(是的,我们可以在 Eclipse WTP 中运行 tomcat!这不是问题;)

0 投票
1 回答
1550 浏览

spring - Spring Roo Tomcat 问题

我在 Spring Roo 和 Tomcat 上遇到了一个非常烦人的问题。在 spring roo 披萨店教程之后,我发出了以下命令:

然后从命令行我调用:

当我在 Pizza 实体中添加新字段时,出现错误:

编辑:只是一点澄清。当我停止服务器并重新启动它时,一切正常,并且正常添加了该字段。我尝试使用 roo 命令和修改 java 代码来添加该字段。

有什么建议么?

干杯

0 投票
3 回答
6740 浏览

java - Maven:将生成的 tomcat-maven-plugin 资源放在哪里?

我的项目目录中有 CSS 和 JavaScript 文件src/main/webapp。我想加入将这些资源的加入和缩小版本添加到我的 WAR 文件和tomcat-maven-plugin获取它的位置。

我使用 yuicompressor-maven-plugin 创建文件并将其放入${project.build.directory}/${project.build.finalName}. 它适用于 maven 包,并且这些资源进入 WAR 文件,但不知何故tomcat-maven-plugin根本看不到这些。我应该为它使用不同的目录吗?

我的pom:

我应该怎么做才能 mvn tomcat:run提取我生成的文件?

0 投票
1 回答
611 浏览

maven - 嵌入式 tomcat 不会让我的 selenium/jbehave 故事运行

我正在尝试让嵌入式 tomcat 在集成测试之前启动(我使用 Selenium + JBehave)并在之后停止

以下是我尝试配置 maven 的方法:

但是,当我运行时,Tomcat 启动正常mvn integration-test,似乎它不会让我的故事运行......

任何人都可以帮忙吗?

0 投票
1 回答
504 浏览

spring - 嵌入式 tomcat 不会解析消息源的 Spring 应用程序资源包

我的嵌入式 tomcat 遇到问题:当我使用嵌入式 Tomcat 运行 Spring 应用程序时,似乎属性没有解决。

即使加载了属性文件:

找不到资源包:

但是,当我从 Eclipse/STS 运行我的应用程序时,我没有这样的问题。

0 投票
2 回答
2949 浏览

mysql - Adding mySql to eclipse project with maven tomcat plugin

I have a spring mvc project downloaded from the web and fully working. I'm using maven and maven tomcat plugin to manage dependencies and to run the webapp in the built-in tomcat. I'm trying to add mySql support in my project. Since i'm new to maven and maven tomcat plugin, I don't know hot to do this. Before i tried to add mysql, all was working and i was able to launch my web app simply executing a tomcat:run maven goal.

For now, when i execute tomcat:run i get a

Here is what i've already done after some reading around the web: I added dependencies for mysql driver (and Hibernate annotations too since i want to use it) in my pom.xml, and specified the dependency for tomcat plugin:

You can also notice a tag to specify to use a context.xml file. But I don't know where to put this file. I readed it should be generated automatically in tomcat/conf, but it's not present. So i added it manually with this content:

Then in web.xml, located in tomcat/conf i added:

I placed the same content in src/main/webapp/META-INF/context.xml and in src/main/webapp/WEB-INF/web.xml

With all these configuration, the error mentioned above doesn't appears. But if i try to use hibernate adding

then i get the comunication link failure. What i'm missing? If it's needed i can add the full stack trace.

0 投票
1 回答
1697 浏览

maven - Maven tomcat插件依赖错误

我有一个使用 1.1 版 tomcat maven 插件的完整项目。我试图切换到最后一个 maven tomcat 插件版本,在pom.xml

但是,使用tomcat7:run而不是tomcat:run我启动项目会收到以下错误:

我怎样才能解决这个问题?

0 投票
2 回答
4984 浏览

maven-3 - Tomcat Maven 插件和多模块 Maven 项目

我们有一个应用程序,直到最近它还是一个 Maven WAR 项目。我们使用 Tomcat Maven 插件在本地开发人员工作站上运行应用程序,使用:

我们能够在嵌入式 Tomcat 实例运行时更改 JSP 文件,并且更改会很好地显示在 Web 浏览器中。我了解(从插件文档中)当使用 tomcat:run 目标时,WAR 被加载为动态 Web 应用程序,因此 Tomcat 在运行时拾取源代码中对 JSP 文件所做的更改而无需重新启动。

应用程序已经达到了相当大的规模,我们需要在 Web 项目之外的几个不同地方重用大量的类,因此我们将代码库重构为一个多模块的 Maven 项目。现在的结构是:

重构后,我们无法使用项目根目录中的 tomcat:run 来运行 WAR 项目,因为插件无法检测到 JAR 工件。所以,我们转而使用 tomcat:run-war-only 插件。WAR 模块现在可以正常启动。

但是,从文档看来,run-war-only 目标似乎将 WAR 文件视为打包的 Web 应用程序。因此,我们现在对 JSP 文件所做的任何更改都不会在运行时被嵌入式 Tomcat 服务器拾取。对于 JSP 文件的每次更改,我们都必须重新启动服务器。

在这个多模块 Maven 设置中,我们有没有办法将 WAR 项目作为动态 Web 应用程序运行,以便 Tomcat 在不重新启动的情况下至少获取对 JSP 文件的更改?

0 投票
1 回答
953 浏览

tomcat - tomcat maven插件的嵌入式tomcat实例中的空白页面

我有一个可以从 Android 客户端或作为 webapp 访问的 Spring 服务器应用程序。当我使用我的 Android 客户端时,一切正常。但是,当我尝试访问 webapp,将其运行到以 tomcat7:run from tomcat maven 插件开头的嵌入式 tomcat(版本 7)中时,我http://localhost:8080/http://localhost:8080/my-app-name.

0 投票
1 回答
3855 浏览

spring - tomcat7 maven插件无法访问src/main/resources中的资源?

当我在 src/main/resources 中放置 xml 资源(例如 spring 配置文件、日志记录...等)时,当我在嵌入式 tomcat 插件中运行这些文件时,我的应用程序无法读取这些文件。然而,将这些文件移动到 src/main/java 可以解决问题。

这是我正在使用的插件定义:

为什么我把资源放到 src/main/java 里面可以找到,但是运行的时候放到 src/main/resources 里面找不到mvn tomcat7:run

更新:我正在使用带有 m2e 的 eclipse 我可以使用指向本地 tomcat 服务器的 Run As > Run on Server 来运行应用程序。文件夹结构正确,eclipse 设置来自 pom.xml 通过 m2e。

在这种情况下,log4j-config.xml 位于 src/main/resources 中,很少有例外,例如 src/main/resources 文件夹中的文件不存在。

更新 2:问题原来是<resources>父 POM 中的一个元素导致 .xml 文件不包含在生成的输出中。