update references to beta-1

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@289594 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-09-16 16:09:56 +00:00
parent d922db3226
commit 38d4a61e39
8 changed files with 300 additions and 173 deletions

View File

@ -8,8 +8,6 @@
Build Lifecycle
<<PLEASE NOTE:>> this documentation is current only as of alpha-3.
* Build Lifecycle Basics
Maven 2.0 is based around the central concept of a build lifecycle. What this means is that the process for building
@ -165,8 +163,7 @@ m2 clean:clean install
* Build Lifecycle Phase Reference
The following phases are all the ones available as of the Maven 2.0 alpha-3 release. They are executed in the order
given, up to the point of the one specified.
The following phases are executed in the order given, up to the point of the one specified.
*-------------------------------+--------------------------------------------------------------------------------------+
| <<<validate>>> | validate the project is correct and all necessary information is available.

View File

@ -39,7 +39,7 @@ Building a Site
The FML format is the FAQ format, also used in Maven 1.0.
Other formats are available, but at this point these 3 are the best tested. There are also several possible output formats,
but as of alpha-3, only XHTML is available.
but as of beta-1, only XHTML is available.
Note that all of the above is optional - just one index file is required in one of the input trees. Each of the paths will be merged
together to form the root directory of the site.

View File

@ -19,7 +19,8 @@
Maven has also grown into a project that is building other products to help in the software development
lifecycle<!--,
such as the <a href="http://maven.apache.org/continuum">Continuum</a> continuous integration server -->.
<a href="http://maven.apache.org/project/index.html">More information about the Maven Project</a>.
<a href="http://maven.apache.org/project/index.html">More information about the Maven Project</a>
.
</p>
</answer>
</faq>
@ -41,7 +42,8 @@
<li>Extensible, with the ability to easily write plugins in Java or other scripting languages</li>
<li>Instant access to new features with little or no extra configuration</li>
<li>
<a href="ant-tasks.html">Ant tasks</a>for dependency management and deployment outside of Maven
<a href="ant-tasks.html">Ant tasks</a>
for dependency management and deployment outside of Maven
</li>
</ul>
<p>
@ -61,7 +63,8 @@
<answer>
<p>
You've seen
<a href="#what-is-maven">above</a>the goals that Maven aims to achieve, however there have also
<a href="#what-is-maven">above</a>
the goals that Maven aims to achieve, however there have also
been questions about why Maven 2.0 is rewritten from the successful Maven 1.0. In summary, the main goals of
the new Maven 2.0 architecture are:
</p>
@ -93,7 +96,8 @@
</p>
<p>
For more information on whether this release of Maven 2.0 should be used in your environment, please consult
<a href="maven1.html#m1-or-m2">this topic</a>.
<a href="maven1.html#m1-or-m2">this topic</a>
.
</p>
</answer>
</faq>
@ -117,7 +121,8 @@
</p>
<p>
For more information, consult the
<a href="roadmap.html">Road Map</a>.
<a href="roadmap.html">Road Map</a>
.
</p>
</answer>
</faq>
@ -135,11 +140,13 @@
</p>
<p>
For instructions on checking out and building Maven 2.0, see
<a href="/maven2/developers/building.html">Building Maven 2.0</a>.
<a href="/maven2/developers/building.html">Building Maven 2.0</a>
.
</p>
<p>
For more information, please see
<a href="http://maven.apache.org/contributing/help.html">How to Help</a>.
<a href="http://maven.apache.org/contributing/help.html">How to Help</a>
.
</p>
</answer>
</faq>
@ -148,7 +155,7 @@
<question>What plugin languages will Maven 2.0 support? What about [insert language here]?</question>
<answer>
<p>
As of the current alpha-3 release, Maven supports pure Java, Beanshell and Marmalade. Java is the preferred
As of the current release, Maven supports pure Java, Beanshell and Marmalade. Java is the preferred
language for it's familiarity and speed, while Marmalade is preferred for porting Maven 1.x plugins, and
writing
plugins based on Ant tasks.
@ -182,18 +189,25 @@
<answer>
<p>
Help for both Maven 1.0 and Maven 2.0 can be obtained by subscribing and posting to the
<a href="http://maven.apache.org/mail-lists.html">Maven Users List</a>. If you are posting about Maven 2.0,
<a href="http://maven.apache.org/mail-lists.html">Maven Users List</a>
. If you are posting about Maven 2.0,
please make that clear in your email.
</p>
<p>
You can also join us on IRC at
<code>irc.codehaus.org</code>on
<code>#maven</code>. This is available both
<code>irc.codehaus.org</code>
on
<code>#maven</code>
. This is available both
over
<a href="irc://irc.codehaus.org/#maven">IRC</a>and
<a href="http://irc.codehaus.org/">HTTP</a>for those behind firewalls (enter
<code>#maven</code>in the
<i>Channel</i>box).
<a href="irc://irc.codehaus.org/#maven">IRC</a>
and
<a href="http://irc.codehaus.org/">HTTP</a>
for those behind firewalls (enter
<code>#maven</code>
in the
<i>Channel</i>
box).
</p>
<p>
Please remember that it is a preview release, so please be patient with features that are not yet implemented,

View File

@ -10,14 +10,17 @@
</p>
<ul>
<li>
<i>Project</i>- most static configuration occurs in
<i>Project</i>
- most static configuration occurs in
<code>pom.xml</code>
</li>
<li>
<i>Installation</i>- this is configuration added once for a Maven installation
<i>Installation</i>
- this is configuration added once for a Maven installation
</li>
<li>
<i>User</i>- this is configuration specific to a particular user
<i>User</i>
- this is configuration specific to a particular user
</li>
</ul>
<p>
@ -25,18 +28,24 @@
building it, while the others both define settings for the current environment.
</p>
<p>
<b>Note:</b>the installation and user configuration can not be used to add shared project information -
<b>Note:</b>
the installation and user configuration can not be used to add shared project information -
for example setting
<code>&lt;organization&gt;</code>or
<code>&lt;distributionManagement&gt;</code>company-wide.
<code>&lt;organization&gt;</code>
or
<code>&lt;distributionManagement&gt;</code>
company-wide.
For this, you should have your projects inherit from a company-wide parent
<code>pom.xml</code>.
<code>pom.xml</code>
.
<!-- TODO: versioning doc that discusses this -->
</p>
<p>
You can specify your user configuration in
<code>${user.home}/.m2/settings.xml</code>. A
<a href="maven-settings/settings.html">full reference</a>to the
<code>${user.home}/.m2/settings.xml</code>
. A
<a href="maven-settings/settings.html">full reference</a>
to the
configuration file is available. This section will show how to make some common configurations.
Note that the file is not required - defaults will be used if it is not found.
</p>
@ -58,16 +67,19 @@
<h4>Configuring a Proxy</h4>
<p>
You can configure a proxy to use for some or all of your HTTP requests in Maven 2.0. The username and
password are only required if your proxy requires basic authentication (note that later alphas will support
password are only required if your proxy requires basic authentication (note that later releases may support
storing your passwords in a secured keystore - in the mean time, please ensure your
<code>settings.xml</code>
file is secured with permissions appropriate for your operating system).
</p>
<p>
The
<code>nonProxyHosts</code>setting accepts wild cards, and each host not to proxy is separated by the
<code>|</code>character. This matches the
<a href="http://java.sun.com/j2se/1.4.2/docs/guide/net/properties.html">JDK configuration</a>equivalent.
<code>nonProxyHosts</code>
setting accepts wild cards, and each host not to proxy is separated by the
<code>|</code>
character. This matches the
<a href="http://java.sun.com/j2se/1.4.2/docs/guide/net/properties.html">JDK configuration</a>
equivalent.
</p>
<source><![CDATA[
<settings>
@ -89,16 +101,19 @@
<h4>Security and Deployment Settings</h4>
<p>
Repositories to deploy to are defined in a project in the
<code>&lt;distributionManagement&gt;</code>section.
<code>&lt;distributionManagement&gt;</code>
section.
However, you cannot put your username, password, or other security settings in that project. For that reason,
you should add a server definition to your own settings with an
<code>id</code>that matches that of the
<code>id</code>
that matches that of the
deployment repository in the project.
</p>
<p>
In addition, some repositories may require authorisation to download from, so the corresponding settings can
be specified in a
<code>server</code>element in the same way.
<code>server</code>
element in the same way.
</p>
<p>
Which settings are required will depend on the type of repository you are deploying to. As of the first release,
@ -140,12 +155,16 @@
<p>
To configure a mirror of a given repository, you provide it in your settings file, giving the new repository
it's own
<code>id</code>and
<code>url</code>, and specify the
<code>mirrorOf</code>setting that is the ID of
<code>id</code>
and
<code>url</code>
, and specify the
<code>mirrorOf</code>
setting that is the ID of
the repository you are using a mirror of. For example, the ID of the main Maven repository included by default
is
<code>central</code>, so to use an Australian mirror, you would configure the following:
<code>central</code>
, so to use an Australian mirror, you would configure the following:
</p>
<source><![CDATA[
<settings>
@ -162,7 +181,8 @@
.
.]]></source>
<p>
<i>Please note:</i>this particular is not actually set up for Maven 2 yet, so this should be treated as an
<i>Please note:</i>
this particular is not actually set up for Maven 2 yet, so this should be treated as an
example only.
</p>
</section>

View File

@ -2,7 +2,7 @@
<properties>
<title>Dependency Mechanism</title>
<author email="brett@apache.org">Brett Porter</author>
<author email="trygvis@apache.org">Trygve Laugstol </author>
<author email="trygvis@apache.org">Trygve Laugstol</author>
</properties>
<body>
<section name="Dependency Mechanism">
@ -57,11 +57,6 @@
of the build. This is described in more detail below.
</li>
</ul>
<p>
More features are planned, such as different mediation techniques and conflict management as well as
reporting,
in later alpha versions of Maven 2.0.
</p>
</subsection>
<subsection name="Dependency Scope">
<a name="dependency_scope"/>
@ -270,7 +265,8 @@
</p>
<p>
The reference information about the dependency management tags is available from the
<a href="maven-model/maven.html#class_DependencyManagement">project descriptor reference</a>.
<a href="maven-model/maven.html#class_DependencyManagement">project descriptor reference</a>
.
</p>
</subsection>
</section>

View File

@ -4,7 +4,7 @@
<author email="brett@apache.org">Brett Porter</author>
</properties>
<body>
<section name="Download Maven 2.0 Alpha 3 Technology Preview">
<section name="Download Maven 2.0 Beta 1">
<p>
Maven is distributed in several formats for your convenience.
</p>
@ -13,42 +13,52 @@
hours to reach all mirrors.
</p>
<p>
<b>IMPORTANT:</b> Some plugins built for alpha-2 will not work with alpha-3. If you are experiencing
<b>IMPORTANT:</b>
Some plugins built for alpha-3 will not work with beta-1. If you are experiencing
"plugin not found" or other messages, please try running the command with -U first to ensure you have the
latest version.
</p>
<ul>
<li>
<a href="http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-2.0-alpha-3-bin.tar.bz2">
<code>.tar.bz2</code>archive
<a href="http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-2.0-beta-1-bin.tar.bz2">
<code>.tar.bz2</code>
archive
</a>
<span style="font-size: smaller">
(
<a href="http://www.apache.org/dist/maven/binaries/maven-2.0-alpha-3-bin.tar.bz2.md5">checksum</a>)
<a href="http://www.apache.org/dist/maven/binaries/maven-2.0-beta-1-bin.tar.bz2.md5">checksum</a>
)
(
<a href="http://www.apache.org/dist/maven/binaries/maven-2.0-alpha-3-bin.tar.bz2.asc">PGP</a>)
<a href="http://www.apache.org/dist/maven/binaries/maven-2.0-beta-1-bin.tar.bz2.asc">PGP</a>
)
</span>
</li>
<li>
<a href="http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-2.0-alpha-3-bin.tar.gz">
<code>.tar.gz</code>archive
<a href="http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-2.0-beta-1-bin.tar.gz">
<code>.tar.gz</code>
archive
</a>
<span style="font-size: smaller">
(
<a href="http://www.apache.org/dist/maven/binaries/maven-2.0-alpha-3-bin.tar.gz.md5">checksum</a>)
<a href="http://www.apache.org/dist/maven/binaries/maven-2.0-beta-1-bin.tar.gz.md5">checksum</a>
)
(
<a href="http://www.apache.org/dist/maven/binaries/maven-2.0-alpha-3-bin.tar.gz.asc">PGP</a>)
<a href="http://www.apache.org/dist/maven/binaries/maven-2.0-beta-1-bin.tar.gz.asc">PGP</a>
)
</span>
</li>
<li>
<a href="http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-2.0-alpha-3-bin.zip">
<code>.zip</code>archive
<a href="http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-2.0-beta-1-bin.zip">
<code>.zip</code>
archive
</a>
<span style="font-size: smaller">
(
<a href="http://www.apache.org/dist/maven/binaries/maven-2.0-alpha-3-bin.zip.md5">checksum</a>)
<a href="http://www.apache.org/dist/maven/binaries/maven-2.0-beta-1-bin.zip.md5">checksum</a>
)
(
<a href="http://www.apache.org/dist/maven/binaries/maven-2.0-alpha-3-bin.zip.asc">PGP</a>)
<a href="http://www.apache.org/dist/maven/binaries/maven-2.0-beta-1-bin.zip.asc">PGP</a>
)
</span>
</li>
</ul>
@ -57,28 +67,34 @@
Also available is a distribution suitable for use with Ant to use Maven 2.0's dependency
management (including transitive dependencies), repository and artifact deployment support.
See
<a href="ant-tasks.html">Ant Tasks</a>for more information and installation instructions.
<a href="ant-tasks.html">Ant Tasks</a>
for more information and installation instructions.
</p>
<ul>
<li>
<a href="http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-artifact-ant-2.0-alpha-3-dep.jar">
<code>.jar</code>archive
<a href="http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-artifact-ant-2.0-beta-1-dep.jar">
<code>.jar</code>
archive
</a>
<span style="font-size: smaller">
(
<a href="http://www.apache.org/dist/maven/binaries/maven-artifact-ant-2.0-alpha-3-dep.jar.md5">checksum</a>)
<a href="http://www.apache.org/dist/maven/binaries/maven-artifact-ant-2.0-beta-1-dep.jar.md5">checksum</a>
)
(
<a href="http://www.apache.org/dist/maven/binaries/maven-artifact-ant-2.0-alpha-3-dep.jar.asc">PGP</a>)
<a href="http://www.apache.org/dist/maven/binaries/maven-artifact-ant-2.0-beta-1-dep.jar.asc">PGP</a>
)
</span>
</li>
</ul>
<p>
Maven 2.0 is distributed under the
<a href="http://maven.apache.org/license.html">Apache License, version 2.0</a>.
<a href="http://maven.apache.org/license.html">Apache License, version 2.0</a>
.
</p>
<p>
The Ant tasks contain the JCraft Jsch library for deployment via SSH. For more information, see their
<a href="http://www.jcraft.com/jsch/LICENSE.txt">License and Copyright notice</a>.
<a href="http://www.jcraft.com/jsch/LICENSE.txt">License and Copyright notice</a>
.
</p>
<a name="requirements"/>
<subsection name="System Requirements">
@ -115,27 +131,31 @@
<ol>
<li>
Unzip
<code>maven-2.0-alpha-3-bin.zip</code>to the directory you wish to install Maven 2.0. These instructions
<code>maven-2.0-beta-1-bin.zip</code>
to the directory you wish to install Maven 2.0. These instructions
assume you chose
<code>C:\Program Files\Apache Software Foundation\maven-2.0-alpha-3</code>
<code>C:\Program Files\Apache Software Foundation\maven-2.0-beta-1</code>
</li>
<li>
Add the
<code>bin</code>directory to your path, by opening up the system properties (WinKey + Pause),
<code>bin</code>
directory to your path, by opening up the system properties (WinKey + Pause),
selecting the "Advanced" tab, and the "Environment Variables" button, then editing the
<code>PATH</code>
variable in the user variables.
eg.
<code>"C:\Program Files\Apache Software Foundation\maven-2.0-alpha-3\bin";%PATH%</code>
<code>"C:\Program Files\Apache Software Foundation\maven-2.0-beta-1\bin";%PATH%</code>
</li>
<li>
In the same dialog, make sure that
<code>JAVA_HOME</code>is set to the location of your JDK, eg.
<code>JAVA_HOME</code>
is set to the location of your JDK, eg.
<code>C:\Program Files\Java\jdk1.5.0_02</code>
</li>
<li>
Run
<code>m2 --version</code>to verify that it is correctly installed.
<code>m2 --version</code>
to verify that it is correctly installed.
</li>
</ol>
<p style="font-weight: bold; font-size: larger">
@ -145,23 +165,27 @@
<li>
Extract the distribution archive to the directory you wish to install Maven 2.0. These instructions
assume you chose
<code>/usr/local/maven-2.0-alpha-3</code>. The directory
<code>maven-2.0-alpha-3</code>
<code>/usr/local/maven-2.0-beta-1</code>
. The directory
<code>maven-2.0-beta-1</code>
will be created from the archive.
</li>
<li>
Add the
<code>bin</code>directory to your path, eg.
<code>export PATH=/usr/local/maven-2.0-alpha-3/bin:$PATH</code>
<code>bin</code>
directory to your path, eg.
<code>export PATH=/usr/local/maven-2.0-beta-1/bin:$PATH</code>
</li>
<li>
Make sure that
<code>JAVA_HOME</code>is set to the location of your JDK, eg.
<code>JAVA_HOME</code>
is set to the location of your JDK, eg.
<code>export JAVA_HOME=/usr/java/jdk1.5.0_02</code>
</li>
<li>
Run
<code>m2 --version</code>to verify that it is correctly installed.
<code>m2 --version</code>
to verify that it is correctly installed.
</li>
</ol>
</subsection>

View File

@ -8,11 +8,13 @@
<p>
This section will help you create a trivial project, and build it, and should provide enough information
to build any project that requires Maven 2.0. It assumed that you have already
<a href="download.html">Downloaded and Installed</a> a Maven 2.0 release.
<a href="download.html">Downloaded and Installed</a>
a Maven 2.0 release.
</p>
<p>
If you are behind a proxy, make sure that you've read
<a href="configuration.html">Configuring Maven</a> first
<a href="configuration.html">Configuring Maven</a>
first
for instructions on how to configure your proxy.
</p>
<subsection name="Creating a Project Skeleton">
@ -22,7 +24,8 @@
<source>m2 archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app</source>
<p>
This command has created a layout according the the conventions laid out
<a href="http://maven.apache.org/reference/conventions.html">here</a>.
<a href="http://maven.apache.org/reference/conventions.html">here</a>
.
</p>
<!-- TODO
<p>
@ -31,7 +34,8 @@
-->
<p>
The file
<code>pom.xml</code> is the Maven 2.0 project descriptor.
<code>pom.xml</code>
is the Maven 2.0 project descriptor.
</p>
<source><![CDATA[
<project>
@ -51,14 +55,17 @@
</project>]]></source>
<p>
You can get a full reference to the
<a href="maven-model/maven.html">project descriptor</a> to see what other
<a href="maven-model/maven.html">project descriptor</a>
to see what other
elements are available.
</p>
<p>
You'll notice there is a
<code>src/main/java</code> directory containing a simple source file to compile,
<code>src/main/java</code>
directory containing a simple source file to compile,
and a
<code>src/test/java</code> directory containing a trivial unit test.
<code>src/test/java</code>
directory containing a trivial unit test.
</p>
<p>
Let's now change into the project's directory and try a few things...
@ -71,23 +78,30 @@
</p>
<ul>
<li>
<code>generate-sources</code> - perform any source generation
<code>generate-sources</code>
- perform any source generation
</li>
<li>
<code>compile</code> - compile the sources in
<code>src/main/java</code> as well as any generated source
<code>compile</code>
- compile the sources in
<code>src/main/java</code>
as well as any generated source
</li>
<li>
<code>test</code> - compile and run the unit tests
<code>test</code>
- compile and run the unit tests
</li>
<li>
<code>package</code> - package the source code into an archive (primarily a JAR)
<code>package</code>
- package the source code into an archive (primarily a JAR)
</li>
<li>
<code>install</code> - install the package in the local repository for use with other projects
<code>install</code>
- install the package in the local repository for use with other projects
</li>
<li>
<code>deploy</code> - deploy the package to the remote repository
<code>deploy</code>
- deploy the package to the remote repository
</li>
</ul>
<p>
@ -95,16 +109,26 @@
</p>
<source>m2 install</source>
<p>
<b>Note:</b> if you are using the project you generated in the first step, make sure you are running this
command from inside the directory it created, where <code>pom.xml</code> resides.
<b>Note:</b>
if you are using the project you generated in the first step, make sure you are running this
command from inside the directory it created, where
<code>pom.xml</code>
resides.
</p>
<p>
This will do all of the steps - generating sources, compiling, copying resources, packaging and finally installing.
This will do all of the steps - generating sources, compiling, copying resources, packaging and finally
installing.
</p>
<p>
If you try that, you'll see that the file is copied to a directory under <code>~/.m2/repository</code>.
This is also where all those downloaded files go - it is called your <i>local repository</i>.
The location is configurable - see <a href="configuration.html">Configuration</a> for more information.
If you try that, you'll see that the file is copied to a directory under
<code>~/.m2/repository</code>
.
This is also where all those downloaded files go - it is called your
<i>local repository</i>
.
The location is configurable - see
<a href="configuration.html">Configuration</a>
for more information.
</p>
<!-- TODO
<p>
@ -116,7 +140,9 @@
</p>
<source>m2 clean:clean install</source>
<p>
This will remove the <code>target</code> directory with all the build data before starting so that it is
This will remove the
<code>target</code>
directory with all the build data before starting so that it is
fresh.
</p>
<p>
@ -124,24 +150,35 @@
</p>
<source>m2 idea:idea</source>
<p>
This can be run over the top of a previous IDEA project - it will update the settings rather than starting fresh.
This can be run over the top of a previous IDEA project - it will update the settings rather than starting
fresh.
</p>
<p>
<b>Note:</b> some familiar goals from Maven 1.0 are still there - such as
<code>jar:jar</code>, but they might
<b>Note:</b>
some familiar goals from Maven 1.0 are still there - such as
<code>jar:jar</code>
, but they might
not behave like you'd expect. Presently,
<code>jar:jar</code> will not recompile sources - it will simply just
<code>jar:jar</code>
will not recompile sources - it will simply just
create a JAR from the
<code>target/classes</code> directory, under the assumption everything else had already
<code>target/classes</code>
directory, under the assumption everything else had already
been done.
</p>
</subsection>
<a name="configuring_plugins"/>
<subsection name="Configuring Plugins">
<p>
What if you would like to customise whether a plugins is enabled, or how a plugin operates?
In Maven 1.0, you would have added some <code>preGoal</code> to <code>maven.xml</code> and some
entries to <code>project.properties</code>. Here, it is a little different.
What if you would like to customise whether a plugins is enabled, or how a plugin operates?
In Maven 1.0, you would have added some
<code>preGoal</code>
to
<code>maven.xml</code>
and some
entries to
<code>project.properties</code>
. Here, it is a little different.
</p>
<p>
For this example, we will configure the Java compiler to allow JDK 5.0 sources. This is as simple as
@ -169,7 +206,9 @@
(the default is to use the latest available).
</p>
<p>
The <code>configuration</code> element applies the given parameters to every goal from the compiler plugin.
The
<code>configuration</code>
element applies the given parameters to every goal from the compiler plugin.
It is possible to change a parameter just for an individual goal as well - for example, to change the
debug flag for test sources:
</p>
@ -190,21 +229,24 @@
.
.]]></source>
<p>
To find out what configuration is available for a plugin, you can see the <a href="plugins/">Plugins List</a>
To find out what configuration is available for a plugin, you can see the
<a href="plugins/">Plugins List</a>
and navigate to the plugin and goal you are using.
</p>
</subsection>
<subsection name="Other Project Types">
<p>
Note that the lifecycle applies to any project type. For example, back in the base direcotry we can create a simple web application:
Note that the lifecycle applies to any project type. For example, back in the base direcotry we can create a
simple web application:
</p>
<source>
m2 archetype:create \
-DgroupId=com.mycompany.app -DartifactId=my-webapp \
-DarchetypeArtifactId=maven-archetype-webapp</source>
m2 archetype:create \
-DgroupId=com.mycompany.app -DartifactId=my-webapp \
-DarchetypeArtifactId=maven-archetype-webapp</source>
<p>
Note that these must all be on a single line. This will create a directory
<code>my-webapp</code> and the following
<code>my-webapp</code>
and the following
project descriptor:
</p>
<source><![CDATA[<project>
@ -227,12 +269,14 @@ m2 archetype:create \
</project>]]></source>
<p>
Note the
<code>&lt;packaging&gt;</code> element - this tells Maven to build as a WAR. Change into the webapp project's directory and try:
<code>&lt;packaging&gt;</code>
element - this tells Maven to build as a WAR. Change into the webapp project's directory and try:
</p>
<source>m2 clean:clean package</source>
<p>
You'll see
<code>target/my-webapp.war</code> is built, and that all the normal steps were executed.
<code>target/my-webapp.war</code>
is built, and that all the normal steps were executed.
</p>
</subsection>
<subsection name="Multiple Modules">
@ -242,14 +286,15 @@ m2 archetype:create \
</p>
<p>
Firstly, we need to add a parent
<code>pom.xml</code> file in the directory above the other two, so it should look like this:
<code>pom.xml</code>
file in the directory above the other two, so it should look like this:
</p>
<source>
+- pom.xml
+- my-app
| +- pom.xml
+- my-webapp
| +- pom.xml
+- pom.xml
+- my-app
| +- pom.xml
+- my-webapp
| +- pom.xml
</source>
<p>
The POM file you'll create should contain the following:
@ -267,7 +312,8 @@ m2 archetype:create \
</project>]]></source>
<p>
We'll need a dependency on the JAR from the webapp, so add this to
<code>my-webapp/pom.xml</code>:
<code>my-webapp/pom.xml</code>
:
</p>
<source><![CDATA[
.
@ -284,8 +330,10 @@ m2 archetype:create \
.]]></source>
<p>
Finally, add the following
<code>&lt;parent&gt;</code> element to both of the other
<code>pom.xml</code> files
<code>&lt;parent&gt;</code>
element to both of the other
<code>pom.xml</code>
files
in the subdirectories:
</p>
<source><![CDATA[<project>
@ -302,63 +350,74 @@ m2 archetype:create \
</p>
<source>m2 clean:clean install</source>
<p>
<b>Note: </b> If you didn't remove the
<code>warName</code> plugin configuration, this will have
<b>Note:</b>
If you didn't remove the
<code>warName</code>
plugin configuration, this will have
failed due to a bug. Please remove that section, and try again.
</p>
<p>
The WAR has now been created in
<code>my-webapp/target/my-webapp.war</code>, and the JAR is
<code>my-webapp/target/my-webapp.war</code>
, and the JAR is
included:
</p>
<source>$ jar tvf my-webapp/target/my-webapp-1.0-SNAPSHOT.war
0 Fri Jun 24 10:59:56 EST 2005 META-INF/
222 Fri Jun 24 10:59:54 EST 2005 META-INF/MANIFEST.MF
0 Fri Jun 24 10:59:56 EST 2005 META-INF/maven/
0 Fri Jun 24 10:59:56 EST 2005 META-INF/maven/com.mycompany.app/
0 Fri Jun 24 10:59:56 EST 2005 META-INF/maven/com.mycompany.app/my-webapp/
3239 Fri Jun 24 10:59:56 EST 2005 META-INF/maven/com.mycompany.app/my-webapp/pom.xml
0 Fri Jun 24 10:59:56 EST 2005 WEB-INF/
215 Fri Jun 24 10:59:56 EST 2005 WEB-INF/web.xml
123 Fri Jun 24 10:59:56 EST 2005 META-INF/maven/com.mycompany.app/my-webapp/pom.properties
52 Fri Jun 24 10:59:56 EST 2005 index.jsp
0 Fri Jun 24 10:59:56 EST 2005 WEB-INF/lib/
2713 Fri Jun 24 10:59:56 EST 2005 WEB-INF/lib/my-app-1.0-SNAPSHOT.jar</source>
0 Fri Jun 24 10:59:56 EST 2005 META-INF/
222 Fri Jun 24 10:59:54 EST 2005 META-INF/MANIFEST.MF
0 Fri Jun 24 10:59:56 EST 2005 META-INF/maven/
0 Fri Jun 24 10:59:56 EST 2005 META-INF/maven/com.mycompany.app/
0 Fri Jun 24 10:59:56 EST 2005 META-INF/maven/com.mycompany.app/my-webapp/
3239 Fri Jun 24 10:59:56 EST 2005 META-INF/maven/com.mycompany.app/my-webapp/pom.xml
0 Fri Jun 24 10:59:56 EST 2005 WEB-INF/
215 Fri Jun 24 10:59:56 EST 2005 WEB-INF/web.xml
123 Fri Jun 24 10:59:56 EST 2005 META-INF/maven/com.mycompany.app/my-webapp/pom.properties
52 Fri Jun 24 10:59:56 EST 2005 index.jsp
0 Fri Jun 24 10:59:56 EST 2005 WEB-INF/lib/
2713 Fri Jun 24 10:59:56 EST 2005 WEB-INF/lib/my-app-1.0-SNAPSHOT.jar</source>
<p>
How does this work? Firstly, the parent POM created (called
<code>app</code>), has a packaging of
<code>app</code>
), has a packaging of
<code>pom</code>
and a list of modules defined. This tells Maven to run all operations over the set of projects instead of
just the current one (to override this behaviour, you can use the
<code>--non-recursive</code> command line
<code>--non-recursive</code>
command line
option).
</p>
<p>
Next, we tell the WAR that it requires the
<code>my-app</code> JAR. This does a few things: it makes it available
<code>my-app</code>
JAR. This does a few things: it makes it available
on the classpath to any code in the WAR (none in this case), it makes sure the JAR is always built before the
WAR, and it indicates to the WAR plugin to include the JAR in it's library directory.
</p>
<p>
You may have noticed that
<code>junit-3.8.1.jar</code> was a dependency, but didn't end up in the WAR. The
<code>junit-3.8.1.jar</code>
was a dependency, but didn't end up in the WAR. The
reason for this is the
<code>&lt;scope&gt;test&lt;/scope&gt;</code> element - it is only required for testing,
<code>&lt;scope&gt;test&lt;/scope&gt;</code>
element - it is only required for testing,
and so is not included in the web application as the compile time dependency
<code>my-app</code> is.
<code>my-app</code>
is.
</p>
<p>
The final step was to include a parent definition. This is different to the
<code>extend</code> element you
<code>extend</code>
element you
may be familiar with from Maven 1.0: this ensures that the POM can always be located even if the project
is distributed separately from its parent by looking it up in the repository.
</p>
<p>
Like Maven 1.0, as of the current Maven release (
<code>2.0-alpha-3</code>), it is required that you run
<code>install</code> to successfully perform these steps. If you run
<code>package</code>, the JAR will not be
copied to the local repository and Maven will not be able to find it. This will be improved in future versions.
Unlike Maven 1.0, it is not required that you run
<code>install</code>
to successfully perform these steps - you can run
<code>package</code>
on its own
and the artifacts in the reactor will be used from the target directories instead of the local repository.
</p>
<p>
You might like to generate you IDEA workspace again from the top level directory...
@ -373,11 +432,13 @@ m2 archetype:create \
<p>
If you'd like to know more about general Maven concepts, in association with how the current stable release,
Maven 1.0, works, see the
<a href="http://maven.apache.org">Maven website</a>.
<a href="http://maven.apache.org">Maven website</a>
.
</p>
<p>
For more information on Maven 2.0, you can consult the
<a href="plugins/index.html">list of available plugins</a>,
<a href="plugins/index.html">list of available plugins</a>
,
or the other documentation on this site.
</p>
</subsection>

View File

@ -12,8 +12,9 @@
<a href="download.html">
<img valign="top" src="http://maven.apache.org/images/folder-open.gif" border="0" alt="" title="download"/>
Download
</a> Maven 2.0 Alpha 3
<small>(1.2Mb)</small>
</a>
Maven 2.0 Beta 1
<small>(1.1Mb)</small>
<br/>
</p>
<ul>
@ -37,7 +38,7 @@
</p>
<p>
Maven 2.0 is a rewrite of the popular Maven application to achieve a number of goals, and to provide a stable
basis to take it into the future. It is currently available as a Technology Preview.
basis to take it into the future. It is currently available for beta testing.
</p>
<ul>
<li>
@ -47,7 +48,8 @@
</li>
<li>
<i>What are the
<a href="about.html#features">features of Maven 2.0</a>?
<a href="about.html#features">features of Maven 2.0</a>
?
</i>
</li>
<li>
@ -57,22 +59,26 @@
</li>
<li>
<i>What does
<a href="about.html#tech-preview">Technology Preview</a> mean?
<a href="about.html#tech-preview">beta testing</a>
mean?
</i>
</li>
<li>
<i>How often will Maven 2.0 be
<a href="about.html#release-schedule">released</a>?
<a href="about.html#release-schedule">released</a>
?
</i>
</li>
<li>
<i>Can I
<a href="about.html#get-involved">get involved</a>?
<a href="about.html#get-involved">get involved</a>
?
</i>
</li>
<li>
<i>Where do I
<a href="about.html#get-help">get help</a> with Maven 2.0?
<a href="about.html#get-help">get help</a>
with Maven 2.0?
</i>
</li>
</ul>
@ -96,12 +102,14 @@
</li>
<li>
<i>
<a href="maven1.html#m1-future">What will happen</a> to Maven 1.0?
<a href="maven1.html#m1-future">What will happen</a>
to Maven 1.0?
</i>
</li>
<li>
<i>Will my
<a href="maven1.html#m1-plugins">Maven 1.0 plugins</a> be supported?
<a href="maven1.html#m1-plugins">Maven 1.0 plugins</a>
be supported?
</i>
</li>
</ul>
@ -146,8 +154,10 @@
</li>
</ul>
<p>
<b>More coming soon - </b> we will continue to flesh out the documentation, so stay tuned, and join the
<a href="/mail-lists.html">user's mailing list</a> if you have any questions.
<b>More coming soon -</b>
we will continue to flesh out the documentation, so stay tuned, and join the
<a href="/mail-lists.html">user's mailing list</a>
if you have any questions.
</p>
<subsection name="Developing Maven 2">
<p>
@ -159,21 +169,26 @@
<ul>
<li>
<i>How can I
<a href="about.html#get-involved">get involved</a>?
<a href="about.html#get-involved">get involved</a>
?
</i>
</li>
<li>
<i>What
<a href="docs-required.html">documentation is needed</a>?
<a href="docs-required.html">documentation is needed</a>
?
</i>
</li>
<li>
<i>How do I
<a href="/developers/building.html">build Maven 2.0</a>?
<a href="/developers/building.html">build Maven 2.0</a>
?
</i>
</li>
<li>
<i>Draft <a href="http://docs.codehaus.org/display/MAVEN/Home">design documents</a> are in
<i>Draft
<a href="http://docs.codehaus.org/display/MAVEN/Home">design documents</a>
are in
Confluence, until they are implemented and added to the developers section.
</i>
</li>