Maven is not that much more difficult then ant, it is different.

Please take a look at the maven book [1], this explains everything in
a very good way!

Oh, and for your compile problem. Put your java sources in
src/main/java, your resources in src/main/resources, your unit tests
in src/test/java/ en your unit test resources in src/test/java. These
are the default directories for maven.

Hth,

[1] http://books.sonatype.com/maven-book/index.html

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



On Tue, Dec 16, 2008 at 10:17 AM, Joey Krane <linuxbsd2...@gmail.com> wrote:
> Hello,
>
> I'm exploring Maven and hence started to work with a simple web
> application. I used the one I had already (mywebapp)
>
> with the following directory structure.
>
> mywebapp/
> login.html
> wEB-INF/
>               src/LoginServlet.java
>               src/EmailServlet.java
>               web.xml
>
> I used to manually compile my sources and copy them to
> WEB-INF/classes/mywebapp The application works well with tomcat.
>
> Enter Maven and what a nightmare! I haven't used any tool that is as
> complicated as Maven! You may all diagree (since you know maven) but
> for firsttime users, this is useless.
>
> I installed Maven and compiled the Hello World test application successfully.
>
> Then I created a webapp archetype,
>
> $ mvn archetype:generate -DgroupId=mywebapp  -DartifactId=mywebapp
> -DpackageName=mywebapp -DarchetypeArtifactId=maven-archetype-webapp
> -Dversion=1.0.0
>
> (oh yeah, it complains that "create" is deprecated and to use
> "generate"... while there is no mention of this anywhere online)
>
> I copied my source to resources/, and web.xml to the  WEB-INF/
>
> Here's my pom.xml
>
> <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>
>  <groupId>mywebapp</groupId>
>  <artifactId>mywebapp</artifactId>
>  <packaging>war</packaging>
>  <version>1.0-SNAPSHOT</version>
>  <name>poc Maven Webapp</name>
>  <url>http://maven.apache.org</url>
>  <dependencies>
>    <dependency>
>      <groupId>junit</groupId>
>      <artifactId>junit</artifactId>
>      <version>3.8.1</version>
>      <scope>test</scope>
>    </dependency>
>  </dependencies>
>  <build>
>    <finalName>LoginServlet</finalName>
>  </build>
> </project>
>
> And when I run mvn compile, I get
>
> [INFO] Scanning for projects...
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Building mywebapp Maven Webapp
> [INFO]    task-segment: [compile]
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] No sources to compile
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 1 second
> [INFO] Finished at: Tue Dec 16 14:15:55 IST 2008
> [INFO] Final Memory: 6M/86M
> [INFO] -----------------------------
>
> So I'm not sure where to go from here. Most examples never talk about
> the compile process and what happens during this phase. I have looked
> plenty online for help and clues but found none to be useful. The
> maven documentation itself is complicated.
>
> Why isn't there a simple webapplication example using maven?. No i
> don't want to use Jetty. I just want to compile a war file and deploy
> it on tomcat (manually).
>
> Sorry for venting. Ant is so much better in simplicity. But I don't
> want to use Ant tasks in Maven since my application will grow to be
> complex and I want to use Maven as advertised but the learning curve
> sucks!
>
> Joey
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to