<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Java</title>
        <link>http://geekswithblogs.net/jolson/category/4153.aspx</link>
        <description>Java</description>
        <language>en-US</language>
        <copyright>Jason Olson</copyright>
        <managingEditor>jolson88@yahoo.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Using tomcat-maven-plugin from Maven 2</title>
            <link>http://geekswithblogs.net/jolson/archive/2006/03/09/71857.aspx</link>
            <description>&lt;P&gt;I was having some problems getting the &lt;A href="http://mojo.codehaus.org/tomcat-maven-plugin/introduction.html"&gt;tomcat-maven-plugin&lt;/A&gt; working with Maven 2 and found a lack of documentation on the subject (although after a while, I did find the _one_ page that seems to point out how to get this to work). So, how do we do this?&lt;/P&gt;
&lt;P&gt;Since the &lt;A href="http://mojo.codehaus.org/tomcat-maven-plugin/introduction.html"&gt;tomcat-maven-plugin&lt;/A&gt; is not in Maven's core set of plugins, you need to tell Maven that it needs to look into the Mojo Sandbox where the plugin resides. This can be done by adding the following segment into your pom.xml:&lt;/P&gt;
&lt;P&gt;
&lt;HR&gt;

&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;repositories&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;repository&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;id&amp;gt;Maven Snapshots&amp;lt;/id&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;url&amp;gt;http://snapshots.maven.codehaus.org/maven2/&amp;lt;/url&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;snapshots&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/snapshots&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;releases&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;enabled&amp;gt;false&amp;lt;/enabled&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/releases&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/repository&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/repositories&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;pluginRepositories&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;pluginRepository&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;id&amp;gt;Maven Snapshots&amp;lt;/id&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;url&amp;gt;http://snapshots.maven.codehaus.org/maven2/&amp;lt;/url&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;snapshots&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/snapshots&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;releases&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;enabled&amp;gt;false&amp;lt;/enabled&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/releases&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/pluginRepository&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/pluginRepositories&amp;gt;&lt;/P&gt;
&lt;P&gt;
&lt;HR&gt;

&lt;P&gt;&lt;/P&gt;
&lt;P&gt;There is one more thing you must do though. You need to tell Maven the version of the Snapshot you want to grab. Once again, you can do this by adding the following section to your pom.xml:&lt;/P&gt;
&lt;P&gt;
&lt;HR&gt;

&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;build&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugins&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugin&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.codehaus.mojo&amp;lt;/groupId&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;tomcat-maven-plugin&amp;lt;/artifactId&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugin&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugins&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/build&amp;gt;&lt;/P&gt;
&lt;P&gt;
&lt;HR&gt;

&lt;P&gt;&lt;/P&gt;
&lt;P&gt;This configuration assumes that you have tomcat installed locally with the default configuration (port 8080, username "admin", no password). I in no way promote using this default configuration. However, this article is about getting the plugin working in Maven and not about using Tomcat, so I figure we'll let that slide :). &lt;/P&gt;
&lt;P&gt;If you wish to configure your pom.xml to allow you to deploy to different Tomcat installations (like Dev, Test, Prod, etc.), you can do so by using &lt;A href="http://maven.apache.org/guides/introduction/introduction-to-profiles.html"&gt;build profiles&lt;/A&gt;. The plugin configuration above can reside in a profile just as easily as in the root project element.&lt;/P&gt;
&lt;P&gt;Now, with that said, you should be ready to go. You should now be able to deploy to your local Tomcat installation using the command "mvn tomcat:deploy". Have fun :).&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;This might come as a shock to some of you, but yes, this is a post about Java technologies. Why the departure? Well, I'm coming up to speed with some of these technologies and I find that sometimes there can sure be a lack of documentation. I'm hoping that by making this post, I can save others some of the pain that I experienced.&lt;/EM&gt;&lt;/P&gt;&lt;img width="0" height="0" src="http://www.managed-world.com/cptrk.ashx?id=119e4a2c-88e2-4626-a812-741647059eef"&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=71857"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=71857" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/jolson/aggbug/71857.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jason Olson</dc:creator>
            <guid>http://geekswithblogs.net/jolson/archive/2006/03/09/71857.aspx</guid>
            <pubDate>Fri, 10 Mar 2006 02:31:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/jolson/comments/71857.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/jolson/archive/2006/03/09/71857.aspx#feedback</comments>
            <slash:comments>17</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/jolson/comments/commentRss/71857.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/jolson/services/trackbacks/71857.aspx</trackback:ping>
        </item>
    </channel>
</rss>