tomcat maven plugin with jndi
程序员文章站
2022-03-03 08:19:53
...
参考
http://tomcat.apache.org/maven-plugin.html
http://www.tuicool.com/articles/fYRnmy
插件配置概貌:
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <!-- or if you want to use tomcat 6.x <artifactId>tomcat6-maven-plugin</artifactId> --> <version>2.3-SNAPSHOT</version> <configuration> <!-- http port --> <port>9090</port> <!-- application path always starts with /--> <path>/</path> <!-- optional path to a context file --> <contextFile>${tomcatContextXml}</contextFile> <!-- optional system propoerties you want to add --> <systemProperties> <appserver.base>${project.build.directory}/appserver-base</appserver.base> <appserver.home>${project.build.directory}/appserver-home</appserver.home> <derby.system.home>${project.build.directory}/appserver-base/logs</derby.system.home> <java.io.tmpdir>${project.build.directory}</java.io.tmpdir> </systemProperties> <!-- if you want to use test dependencies rather than only runtime --> <useTestClasspath>false</useTestClasspath> <!-- optional if you want to add some extra directories into the classloader --> <additionalClasspathDirs> <additionalClasspathDir></additionalClasspathDir> </additionalClasspathDirs> </configuration> <!-- For any extra dependencies needed when running embedded Tomcat (not WAR dependencies) add them below --> <dependencies> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> <version>\${derbyVersion}</version> </dependency> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4</version> </dependency> </dependencies> </plugin>
可以看出,如果不使用contextFile配置,插件只能配置端口,应用路径,系统属性简单的配置。如果要配置如数据源复杂的配置,需要配置自定义的server.xml了,但配置了这个后,项目的加载就只能通过context.xml的方式整合。 通过contextFile引用外部定义context.xml配置。
上一篇: Spring3-装配Bean
下一篇: 获取实时汇率代码片段
推荐阅读
-
使用maven-assembly-plugin打包
-
eclipse-maven项目使用maven的tomcat插件启动
-
No plugin found for prefix 'tomcat7'解决方案
-
maven tomcat plugin实现热部署
-
IntelliJ IDEA使用maven实现tomcat的热部署
-
Maven项目打包成war包部署到Tomcat的方法
-
MyEclipse+Tomcat+MAVEN+SVN项目完整环境搭建(图文教程)
-
Maven2 plugin开发教程详解
-
maven利用tomcat插件部署远程Linux服务器的步骤详解
-
Eclipse中导入Maven Web项目并配置其在Tomcat中运行图文详解