You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by James Mitchell <jm...@apache.org> on 2005/06/29 06:13:23 UTC
Maven will change your life [was: Re: Eclipse .project & .classpath files]
No, Maven won't change the ocean currents, or help you stop smoking, but it
comes pretty close.
When I say you DON'T know what you are missing, that is an understatement.
It is difficult to describe in words what Maven brings to the table with
respect to building java projects. All you have to do is *describe* the
layout of your project in 1 single xml file (and a few properties in another
file), and Maven will do the rest.
Q. We have to change the layout of our project right?
A. *NO*, that is the biggest misconception.
Still not convinced?
Want to try before you buy?
Here's all you need to get started.
1. download Maven -
http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-1.0.2.zip
2. unzip it somewhere
3. setup MAVEN_HOME (same way you have to do for Ant)
4. make a tmp dir somewhere
5. cd to that dir and execute "maven genapp"
you will be prompted for the following:
template
id
name
package
I used these for values:
template : "struts"
id : "my-sample"
name : "Sample App"
package : "org.sample"
(there are other 'templates' available, just look under
~/.maven\cache\maven-genapp-plugin-2.2\plugin-resources)
[by the way, "~" is your home directory, /home/user on *unix, C:\Documents
and Settings\user on winders]
For example, here's what my console looks like when I do the above:
$ maven genapp
__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0.2
Enter a project template to use: [default]
struts
Please specify an id for your application: [app]
my-sample
Please specify a name for your application: [Example Application]
Sample App
Please specify the package for your application: [example.web]
org.sample
build:start:
genapp:
[copy] Copying 1 file to
C:\cygwin\home\jmitchell\ttt\src\java\org\sample
[copy] Copying 1 file to
C:\cygwin\home\jmitchell\ttt\src\test\org\sample
[copy] Copying 2 files to
C:\cygwin\home\jmitchell\ttt\src\test-cactus\org\sample
[copy] Copying 6 files to C:\cygwin\home\jmitchell\ttt
[copy] Copying 5 files to C:\cygwin\home\jmitchell\ttt
BUILD SUCCESSFUL
Total time: 28 seconds
Finished at: Tue Jun 28 23:23:43 EDT 2005
Now what?
---------
In the same directory, type "maven dist".
Now, after that finishes, take a look under the "target" directory.
Open target/docs/index.htm and click around for a while.
...to be continued.
--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM: jmitchtx
MSN: jmitchell@apache.org
Skype: jmitchtx
----- Original Message -----
From: "Sean Schofield" <se...@gmail.com>
To: "MyFaces Development" <de...@myfaces.apache.org>; "Heinz Drews"
<he...@gmail.com>
Sent: Tuesday, June 28, 2005 3:58 PM
Subject: Re: Eclipse .project & .classpath files
> I hope that maven will not be used for MyFaces.
Don't worry. Ant will continue to be the build mechanism for the
foreseeable future. We should Maven though and see what it has to
offer. Even if we adopt Maven I would think we would keep the Ant
build files up to date since most developers (myself included) are
unfamiliar with Maven.
> Heinz
sean
Re: Maven will change your life [was: Re: Eclipse .project & .classpath files]
Posted by James Mitchell <jm...@apache.org>.
Can you send me the entire output log?
I just tried this again and it worked flawlessly.
--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM: jmitchtx
Yahoo: jmitchtx
MSN: jmitchell@apache.org
Skype: jmitchtx
On Jul 6, 2005, at 10:57 AM, Sean Schofield wrote:
> James,
>
> I couldn't get your maven example working ...
>
> sean
>
> ==============
>
> build:start:
>
> dist:build-setup:
> [delete] Deleting directory D:\crap\maven-test\target
> \distributions
> [mkdir] Created dir: D:\crap\maven-test\target\distributions
> Tag library requested that is not present: 'maven' in plugin:
> 'maven-xdoclet-plu
> gin-1.2'
> Attempting to download xjavadoc-1.0.2.jar.
> WARNING: Failed to download xjavadoc-1.0.2.jar.
>
> BUILD FAILED
> File...... D:\crap\maven-test\maven.xml
> Element... attainGoal
> Line...... 23
> Column.... 43
> The build cannot continue because of the following unsatisfied
> dependency:
>
> xjavadoc-1.0.2.jar
>
> Total time: 3 seconds
> Finished at: Wed Jul 06 10:55:46 EDT 2005
>
Re: Maven will change your life [was: Re: Eclipse .project & .classpath files]
Posted by Sean Schofield <se...@gmail.com>.
James,
I couldn't get your maven example working ...
sean
==============
build:start:
dist:build-setup:
[delete] Deleting directory D:\crap\maven-test\target\distributions
[mkdir] Created dir: D:\crap\maven-test\target\distributions
Tag library requested that is not present: 'maven' in plugin: 'maven-xdoclet-plu
gin-1.2'
Attempting to download xjavadoc-1.0.2.jar.
WARNING: Failed to download xjavadoc-1.0.2.jar.
BUILD FAILED
File...... D:\crap\maven-test\maven.xml
Element... attainGoal
Line...... 23
Column.... 43
The build cannot continue because of the following unsatisfied dependency:
xjavadoc-1.0.2.jar
Total time: 3 seconds
Finished at: Wed Jul 06 10:55:46 EDT 2005