You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Eric Kolotyluk <er...@gmail.com> on 2013/12/06 00:17:35 UTC
Configuring POM for Tomcat
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
Re: Configuring POM for Tomcat
Posted by Curtis Rueden <ct...@wisc.edu>.
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
<rw...@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
>
>
Re: Configuring POM for Tomcat
Posted by Ron Wheeler <rw...@artifact-software.com>.
http://blog.artifact-software.com/tech/?p=121 "Aggregation jars make
development simpler and wars smaller" is a blog article that relates to
this approach.
n 06/12/2013 12:54 PM, Eric Kolotyluk wrote:
> Thanks so much, that does exactly what I wanted.
>
> Cheers, Eric
>
> On 12/6/2013 6:13 AM, Ron Wheeler 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
>>>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> 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
Re: Configuring POM for Tomcat
Posted by Eric Kolotyluk <er...@gmail.com>.
Thanks so much, that does exactly what I wanted.
Cheers, Eric
On 12/6/2013 6:13 AM, Ron Wheeler 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
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Configuring POM for Tomcat
Posted by Ron Wheeler <rw...@artifact-software.com>.
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
Re: Configuring POM for Tomcat
Posted by Eric Kolotyluk <er...@gmail.com>.
I am converting a manual Eclipse built of our WebApp to Maven. I have
never done a WebApp in Maven before, and was not really sure how to
handle the dependencies on tomcat.
When I looked for tomcat on Maven Central what I wound was various
archives of jar files, but that would not link into maven properly, so I
was unsure of how to access them.
I was trying to resolve dependencies on HttpServlet, and did not want to
have to create dependencies for all the tomcat jars.
Fortunately, Ron Wheeler gave me a workable solution - thanks Ron.
Cheers, Eric
On 12/5/2013 4:43 PM, Olivier Lamy wrote:
> Hi,
> I don't understand your point :-)
> You want to depends on Tomcat runtime implementation or just want to
> web dependencies (HttpServlet etc..)
> What is your use case?
>
>
> On 6 December 2013 10:17, Eric Kolotyluk <er...@gmail.com> 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
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Configuring POM for Tomcat
Posted by Olivier Lamy <ol...@apache.org>.
Hi,
I don't understand your point :-)
You want to depends on Tomcat runtime implementation or just want to
web dependencies (HttpServlet etc..)
What is your use case?
On 6 December 2013 10:17, Eric Kolotyluk <er...@gmail.com> 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
>
--
Olivier Lamy
Ecetera: http://ecetera.com.au
http://twitter.com/olamy | http://linkedin.com/in/olamy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org