maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curtis Rueden <ctrue...@wisc.edu>
Subject Re: Configuring POM for Tomcat
Date Fri, 06 Dec 2013 17:30:27 GMT
Hi Eric,

Related to what Ron is suggesting, you can use Maven's "import" scope to
import dependencies en masse. Then you would only need to maintain a single
POM project with all Tomcat dependencies, as Ron suggests, and just import
them into each project that needs them.

http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies

Regards,
Curtis


On Fri, Dec 6, 2013 at 8:13 AM, Ron Wheeler
<rwheeler@artifact-software.com>wrote:

> This produces a pom that we include as a dependency in our war projects to
> give them access to the methods that Tomcat provides.
>
> This avoids having to maintain the tomcat dependencies in each project.
> just a single dependency on the right version of this pom and your project
> can use Tomcat.
>
> This is for Tomcat 7. The tomcat version is 7.0.25 but that really does
> not affect its use with later versions. I think that we are mostly using
> 7.0.36 on deployment now.
>
> The parent POM has nothing particularly interesting for this pom.
>
> I hope that this helps.
> Most of the Tomcat jars are not interesting to you and you really only
> need to code to the interfaces that are exposed to webapps not all the
> internal methods that Tomcat uses.
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>     <modelVersion>4.0.0</modelVersion>
>     <parent>
>         <artifactId>util-pom-master</artifactId>
>         <groupId>com.artifact_software.util</groupId>
>         <version>2.1</version>
>     </parent>
>     <artifactId>util-pom-tomcat</artifactId>
>     <packaging>pom</packaging>
>     <name>Tomcat</name>
>
>     <version>7.0.25</version>
>     <description>
>     Tomcat configuration.
>     This does not produce a jar since Tomcat provides the jars in its
> distribution.
>     </description>
>
>     <properties>
>         <jstl.version>1.2</jstl.version>
> <taglibs-standard.version>1.1.2</taglibs-standard.version>
> <servlet-api.version>3.0.1</servlet-api.version>
>         <tomcat.version>7.0.25</tomcat.version>
>     </properties>
>     <dependencies>
>         <dependency>
>             <groupId>javax.servlet</groupId>
>             <artifactId>javax.servlet-api</artifactId>
>             <version>${servlet-api.version}</version>
>             <scope>runtime</scope>
>         </dependency>
>         <dependency>
>             <groupId>javax.servlet</groupId>
>             <artifactId>jstl</artifactId>
>             <version>${jstl.version}</version>
>             <scope>runtime</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.glassfish.web</groupId>
>             <artifactId>jstl-impl</artifactId>
>             <version>${jstl.version}</version>
>             <scope>runtime</scope>
>             <exclusions>
>                 <exclusion>
> <artifactId>servlet-api</artifactId>
>                     <groupId>javax.servlet</groupId>
>                 </exclusion>
>                 <exclusion>
>                     <artifactId>jsp-api</artifactId>
> <groupId>javax.servlet.jsp</groupId>
>                 </exclusion>
>                 <exclusion>
>                     <artifactId>jstl-api</artifactId>
> <groupId>javax.servlet.jsp.jstl</groupId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>         <!-- No longer required for Tomcat 7+ <dependency>
> <groupId>taglibs</groupId>
>             <artifactId>standard</artifactId> <version>${taglibs-standard.
> version}</version>
>             </dependency> <dependency> <groupId>taglibs</groupId>
> <artifactId>request</artifactId>
> <version>${taglibs-request.version}</version> </dependency> -->
>     </dependencies>
>
> </project>
>
>
> On 05/12/2013 6:17 PM, Eric Kolotyluk wrote:
>
>> OK, there must be an easier way to do this...
>>
>> I am trying to figure out how to configure my POM to depend on tomcat,
>> without creating dependencies on each individual tomcat jar file.
>>
>> After googling around for answers, I cannot seem to find any simple way
>> to set up my web app so that right dependencies are defined (i.e.
>> HttpServlet)
>>
>> Can anyone point me to some simple guide on how this is done?
>>
>> Cheers, Eric
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>
> --
> Ron Wheeler
> President
> Artifact Software Inc
> email: rwheeler@artifact-software.com
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message