Author: vsiveton
Date: Sat Nov 4 06:54:34 2006
New Revision: 471207
URL: http://svn.apache.org/viewvc?view=rev&rev=471207
Log:
MNG-1997: document xsd support for pom and settings in guides
o added project and settings xsd schema
o added new FAQ entry for xsd location
Modified:
maven/site/trunk/src/site/apt/guides/getting-started/index.apt
maven/site/trunk/src/site/apt/settings.apt
maven/site/trunk/src/site/fml/general.fml
Modified: maven/site/trunk/src/site/apt/guides/getting-started/index.apt
URL:
http://svn.apache.org/viewvc/maven/site/trunk/src/site/apt/guides/getting-started/index.apt?view=diff&rev=471207&r1=471206&r2=471207
==============================================================================
--- maven/site/trunk/src/site/apt/guides/getting-started/index.apt (original)
+++ maven/site/trunk/src/site/apt/guides/getting-started/index.apt Sat Nov 4
06:54:34 2006
@@ -122,9 +122,10 @@
<<<pom.xml>>> that should look like this:
+-----+
-
-<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">
+<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>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
@@ -248,9 +249,11 @@
[INFO] Building Maven Quick Start Archetype
[INFO] task-segment: [compile]
[INFO]
----------------------------------------------------------------------------
-[INFO] artifact org.apache.maven.plugins:maven-resources-plugin: checking for
updates from central
+[INFO] artifact org.apache.maven.plugins:maven-resources-plugin: \
+ checking for updates from central
...
-[INFO] artifact org.apache.maven.plugins:maven-compiler-plugin: checking for
updates from central
+[INFO] artifact org.apache.maven.plugins:maven-compiler-plugin: \
+ checking for updates from central
...
[INFO] [resources:resources]
...
@@ -302,7 +305,8 @@
[INFO] Building Maven Quick Start Archetype
[INFO] task-segment: [test]
[INFO]
----------------------------------------------------------------------------
-[INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for
updates from central
+[INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: \
+ checking for updates from central
...
[INFO] [resources:resources]
[INFO] [compiler:compile]
@@ -407,7 +411,8 @@
[INFO] [jar:jar]
[INFO] Building jar: <dir>/my-app/target/my-app-1.0-SNAPSHOT.jar
[INFO] [install:install]
-[INFO] Installing <dir>/my-app/target/my-app-1.0-SNAPSHOT.jar to
<local-repository>/com/mycompany/app/my-app/1.0-SNAPSHOT/my-app-1.0-SNAPSHOT.jar
+[INFO] Installing <dir>/my-app/target/my-app-1.0-SNAPSHOT.jar to \
+
<local-repository>/com/mycompany/app/my-app/1.0-SNAPSHOT/my-app-1.0-SNAPSHOT.jar
[INFO]
----------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
----------------------------------------------------------------------------
@@ -495,8 +500,7 @@
adding this to your POM:
+----+
-
-.
+...
<build>
<plugins>
<plugin>
@@ -509,9 +513,7 @@
</plugin>
</plugins>
</build>
-.
-.
-
+...
+----+
You'll notice that all plugins in Maven 2.0 look much like a dependency -
and in some ways they are.
@@ -658,8 +660,10 @@
+----+
-<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">
+<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>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
@@ -743,9 +747,10 @@
Next, we'll add a reference to this new file in the 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">
+<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>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
@@ -792,9 +797,10 @@
section of your pom.xml and you'd get the same effect (notice I don't need
the references to src/main/filters/filter.properties either):
+----+
-
-<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">
+<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>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
@@ -859,9 +865,10 @@
now, our project is depending on JUnit only (I took out all of the resource
filtering stuff for clarity):
+----+
-
-<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">
+<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>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
@@ -896,8 +903,10 @@
as a dependency simply by adding the dependency information to its pom.xml:
+----+
-
-<project>
+<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">
<groupId>com.mycompany.app</groupId>
<artifactId>my-other-app</artifactId>
...
@@ -962,9 +971,10 @@
Now that we know the information we need, we can add the dependency to our
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">
+<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>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
@@ -998,8 +1008,10 @@
+----+
-<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">
+<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>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
@@ -1048,10 +1060,11 @@
+----+
+----+
-
-<settings>
- .
- .
+<settings 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/xsd/settings-1.0.0.xsd">
+ ...
<servers>
<server>
<id>mycompany-repository</id>
@@ -1061,8 +1074,7 @@
<passphrase>my_key_passphrase</passphrase>
</server>
</servers>
- .
- .
+ ...
</settings>
+----+
@@ -1074,7 +1086,8 @@
+----+
-mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
-DarchetypeGroupId=org.apache.maven.archetypes
-DarchetypeArtifactId=maven-archetype-site
+mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app \
+ -DarchetypeGroupId=org.apache.maven.archetypes
-DarchetypeArtifactId=maven-archetype-site
+----+
@@ -1258,7 +1271,10 @@
POM in a friendly format:
-------------------
-<project>
+<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">
...
<reporting>
<plugins>
@@ -1284,7 +1300,10 @@
To enable multiple locales, add configuration similar to the following to
your POM:
-------------------
-<project>
+<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">
...
<build>
<plugins>
@@ -1334,7 +1353,10 @@
<<<my-webapp>>> containing the following project descriptor:
-------------------
-<project>
+<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>com.mycompany.app</groupId>
<artifactId>my-webapp</artifactId>
@@ -1381,7 +1403,10 @@
The POM file you'll create should contain the following:
-------------------
-<project>
+<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>com.mycompany.app</groupId>
<version>1.0-SNAPSHOT</version>
@@ -1397,32 +1422,30 @@
We'll need a dependency on the JAR from the webapp, so add this to
<<<my-webapp/pom.xml>>>:
-------------------
- .
- .
- .
+ ...
<dependencies>
<dependency>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
- .
- .
- .
+ ...
+ </dependencies>
-------------------
Finally, add the following <<<\<parent\>>>> element to both of the other
<<<pom.xml>>> files in the subdirectories:
-------------------
-<project>
+<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">
<parent>
<groupId>com.mycompany.app</groupId>
<artifactId>app</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
- .
- .
- .
+ ...
-------------------
Now, try it... from the top level directory, run:
Modified: maven/site/trunk/src/site/apt/settings.apt
URL:
http://svn.apache.org/viewvc/maven/site/trunk/src/site/apt/settings.apt?view=diff&rev=471207&r1=471206&r2=471207
==============================================================================
--- maven/site/trunk/src/site/apt/settings.apt (original)
+++ maven/site/trunk/src/site/apt/settings.apt Sat Nov 4 06:54:34 2006
@@ -53,7 +53,10 @@
Here is an overview of the top elements under <<<settings>>>:
+------------------------------------+
-<settings>
+<settings 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/xsd/settings-1.0.0.xsd">
<localRepository/>
<interactiveMode/>
<usePluginRegistry/>
@@ -75,7 +78,10 @@
values which describe elements of the build system that are active full-time.
+------------------------------------+
-<settings>
+<settings 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/xsd/settings-1.0.0.xsd">
<localRepository>${user.dir}/.m2/repository</localRepository>
<interactiveMode>true</interactiveMode>
<usePluginRegistry>false</usePluginRegistry>
@@ -127,7 +133,10 @@
<<<settings.xml>>>.
+------------------------------------+
-<settings>
+<settings 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/xsd/settings-1.0.0.xsd">
...
<servers>
<server>
@@ -167,7 +176,10 @@
* {Mirrors}
+------------------------------------+
-<settings>
+<settings 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/xsd/settings-1.0.0.xsd">
...
<mirrors>
<mirror>
@@ -199,7 +211,10 @@
* {Proxies}
+------------------------------------+
-<settings>
+<settings 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/xsd/settings-1.0.0.xsd">
...
<proxies>
<proxy>
@@ -255,7 +270,10 @@
element.
+------------------------------------+
-<settings>
+<settings 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/xsd/settings-1.0.0.xsd">
...
<profiles>
<profile>
@@ -340,7 +358,10 @@
[]
+------------------------------------+
-<settings>
+<settings 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/xsd/settings-1.0.0.xsd">
...
<profiles>
<profile>
@@ -365,7 +386,10 @@
be searched for a matching release or snapshot artifact.
+------------------------------------+
-<settings>
+<settings 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/xsd/settings-1.0.0.xsd">
...
<profiles>
<profile>
@@ -434,7 +458,10 @@
* {Active Profiles}
+------------------------------------+
-<settings>
+<settings 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/xsd/settings-1.0.0.xsd">
...
<activeProfiles>
<activeProfile>env-test</activeProfile>
Modified: maven/site/trunk/src/site/fml/general.fml
URL:
http://svn.apache.org/viewvc/maven/site/trunk/src/site/fml/general.fml?view=diff&rev=471207&r1=471206&r2=471207
==============================================================================
--- maven/site/trunk/src/site/fml/general.fml (original)
+++ maven/site/trunk/src/site/fml/general.fml Sat Nov 4 06:54:34 2006
@@ -11,11 +11,11 @@
</p>
<p>
Dependencies with this scope will not be passed on transitively, nor
will they be bundled in an package such
- as
- a WAR, or included in the runtime classpath.
+ as a WAR, or included in the runtime classpath.
</p>
</answer>
</faq>
+
<faq id="available-plugins">
<question>How do I list available plugins?</question>
<answer>
@@ -31,11 +31,13 @@
</p>
</answer>
</faq>
+
<faq id="plugin-version">
<question>How do I determine what version of a plugin I am
using?</question>
<answer>
<p>
- You can use the Maven Help Plugin's <code>describe</code> goal. For
example, to find out the version of the install plugin:
+ You can use the Maven Help Plugin's <code>describe</code> goal. For
example, to find out the version
+ of the install plugin:
</p>
<source>mvn -Dplugin=install help:describe</source>
<p>
@@ -43,6 +45,7 @@
</p>
</answer>
</faq>
+
<faq id="using-ant-tasks">
<question>How can I use Ant tasks in Maven 2?</question>
<answer>
@@ -68,10 +71,9 @@
<question>How do I set up Maven so it will compile with a target and
source JVM of my choice?</question>
<answer>
<p>
- You must configure the source and target parameters in your pom. For
example, to set the source and target JVM
- to 1.5, you should have in your pom :
+ You must configure the source and target parameters in your pom. For
example, to set the source and
+ target JVM to 1.5, you should have in your pom :
</p>
-
<source>
...
<build>
@@ -136,7 +138,7 @@
<question>I have a jar that I want to put into my local repository. How
can I copy it in?</question>
<answer>
<p>
- If you understand the layout of the maven repository, you can copy
the jar directly into where it
+ If you understand the layout of the maven repository, you can copy
the jar directly into where it
is meant to go. Maven will find this file next time it is run.
</p>
@@ -165,6 +167,7 @@
</p>
</answer>
</faq>
+
<faq id="unsubscribing-from-mailing-lists">
<question>How do I unsubscribe from Maven mailing lists?</question>
<answer>
@@ -173,32 +176,34 @@
<source>[EMAIL PROTECTED]</source>
</p>
<p>
- So, if you have subscribed to <code>[email protected]</code> then
you would
- send a message to <code>[EMAIL PROTECTED]</code> in order to
+ So, if you have subscribed to <code>[email protected]</code> then
you would
+ send a message to <code>[EMAIL PROTECTED]</code> in order to
get off the list.
People tend to have problems when they subscribe with one address and
attempt to unsubscribe with another. So make sure that you are using
the
same address when unsubscribing that you used to subscribe before
- asking for help.
+ asking for help.
</p>
<p>
If you find you still cannot get off a list then
send a message to <code>[EMAIL PROTECTED]</code>. These
- instructions are also appended to every message sent out on a maven
mailing
+ instructions are also appended to every message sent out on a maven
mailing
list ...
</p>
</answer>
</faq>
+
<faq id="skip-test">
<question>How to skip the tests</question>
<answer>
Add the parameter <code>-Dmaven.test.skip=true</code> in the command
line
- </answer>
+ </answer>
</faq>
+
<faq id="special-characters-site">
<question>Handle special characters in site</question>
<answer>
- <p>Configure your ide to use the correct encoding. With eclipse, add
+ <p>Configure your ide to use the correct encoding. With eclipse, add
<code>-Dfile.encoding=ISO-8859-1</code> in eclipse.ini file</p>
<p>Configure the output encoding in your pom
<source>
@@ -219,6 +224,7 @@
</p>
</answer>
</faq>
+
<faq id="tools-jar-dependency">
<question>How do I include <code>tools.jar</code> in my
dependencies?</question>
<answer>
@@ -250,6 +256,7 @@
...</source>
</answer>
</faq>
+
<faq id="test-property-name">
<question>Why does Maven compile my test classes but don't run
them?</question>
<answer>
@@ -279,11 +286,12 @@
...</source>
</answer>
</faq>
+
<faq id="snapshot-artifacts">
<question>Where are Maven SNAPSHOT artifacts?</question>
<answer>
<p>
- If you are trying to build a development version of Maven or
plugins,
+ If you are trying to build a development version of Maven or plugins,
you may need to access the maven snapshot repositories.
</p>
@@ -291,6 +299,35 @@
You need to update your settings.xml file using the
<a href="guides/development/guide-plugin-snapshot-repositories.html">
Guide to Plugin Snapshot Repositories</a>
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="maven-xsd">
+ <question>Where are the Maven XSD schemas?</question>
+ <answer>
+ <p>
+ The Maven XSD is located <a
href="http://maven.apache.org/maven-v4_0_0.xsd">here</a> and the Maven
+ Settings XSD is located <a
href="http://maven.apache.org/xsd/settings-1.0.0.xsd">here</a>.
+ </p>
+ <p>
+ Your favorite IDE probably supports XSD schema's for pom.xml and
settings.xml editing. You need to
+ specify the following:
+ <source>
+<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">
+
+ ...
+</project></source>
+ <source>
+<settings 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/xsd/settings-1.0.0.xsd">
+ ...
+</settings></source>
</p>
</answer>
</faq>