To reference javax.servlet, after <url> in your pom, add:
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
That tells it you need servlet-api to compile, but it's provided for you at
runtime by the container (JetSpeed I assume).
You don't need to specify a lib directory and Maven figures out which jars to
include based on your dependencies.
There are several ways to deploy your webapp to your container. Check out
war:exploded
(http://maven.apache.org/plugins/maven-war-plugin/exploded-mojo.html) to unjar
the war in a directory where JetSpeed can serve it up.
You can also look at Cargo for deployment, although I don't see that it
specifically supports JetSpeed.
(http://blogs.codehaus.org/people/vmassol/archives/001307_cargo_v07_and_maven2_plugin_v01.html)
K.C.
-----Original Message-----
From: devosc [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 09, 2006 9:22 AM
To: [email protected]
Subject: [mvn] sample webapp
Hi,
I would like to start using mvn, but I'm having problems getting started.
my-webapp/
my-webapp/pom.xml
my-webapp/src/main/java/mypackage/Hello.java
my-webapp/src/main/resources
my-webapp/src/main/webapp/hello.jsp
my-webapp/src/main/webapp/images
my-webapp/src/main/webapp/WEB-INF/web.xml
Hello.java is dependent on javax.servlet
my-webapp/pom.xml
------------------------------------------------------------------------------------------------------------------------------------
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-webapp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven Webapp Archetype</name>
<url>http://maven.apache.org</url>
<build>
<finalName>my-webapp</finalName>
</build>
</project>
------------------------------------------------------------------------------------------------------------------------------------
What's the easiest way to specify where the lib directories and which
jars to include ? I'm trying to find something comparitive to ant's:
------------------------------------------------------------------------------------------------------------------------------------
<path id="compile.classpath">
<!-- Include all elements that Tomcat exposes to applications -->
<pathelement location="${catalina.home}/common/classes"/>
<fileset dir="${catalina.home}/common/endorsed">
<include name="*.jar"/>
</fileset>
<fileset dir="${catalina.home}/common/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${catalina.home}/shared/classes"/>
<fileset dir="${catalina.home}/shared/lib">
<include name="*.jar"/>
</fileset>
</path>
------------------------------------------------------------------------------------------------------------------------------------
Assuming now that the above class dependencies are resolved, and
mvn clean package
creates the target ready to be deployed to Tomcat, how would this be achieved ?
e.g. in ant there is something like:
------------------------------------------------------------------------------------------------------------------------------------
<deploy url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
path="${app.path}"
localWar="file://${build.home}"/>
------------------------------------------------------------------------------------------------------------------------------------
I'm trying to work with jetspeed2, so what I did previously was to
<copy> the war files to the jetspeed/WEB-INF/deploy directory instead
of using the above <deploy>, so I would need to customize the install
?
I was hoping to not neccessarily have to create an ant build.xml ?
--
devosc
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]