You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by bu...@apache.org on 2013/08/02 15:42:37 UTC

svn commit: r872469 - in /websites/staging/maven/trunk/content: ./ guides/getting-started/index.html maven-site-1.0-site.jar

Author: buildbot
Date: Fri Aug  2 13:42:36 2013
New Revision: 872469

Log:
Staging update by buildbot for maven

Modified:
    websites/staging/maven/trunk/content/   (props changed)
    websites/staging/maven/trunk/content/guides/getting-started/index.html
    websites/staging/maven/trunk/content/maven-site-1.0-site.jar

Propchange: websites/staging/maven/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Aug  2 13:42:36 2013
@@ -1 +1 @@
-1509687
+1509706

Modified: websites/staging/maven/trunk/content/guides/getting-started/index.html
==============================================================================
--- websites/staging/maven/trunk/content/guides/getting-started/index.html (original)
+++ websites/staging/maven/trunk/content/guides/getting-started/index.html Fri Aug  2 13:42:36 2013
@@ -339,7 +339,7 @@ Vincent Siveton" />
 <li><b>name</b> This element indicates the display name used for the project. This is often used in Maven's generated documentation.</li>
 <li><b>url</b> This element indicates where the project's site can be found. This is often used in Maven's generated documentation.</li>
 <li><b>description</b> This element provides a basic description of your project. This is often used in Maven's generated documentation.</li></ul>
-<p>For a complete reference of what elements are available for use in the POM please refer to our <a href="../../maven-model/maven.html">POM Reference</a>. Now let's get back to the project at hand.</p>
+<p>For a complete reference of what elements are available for use in the POM please refer to our <a href="/ref/current/maven-model/maven.html">POM Reference</a>. Now let's get back to the project at hand.</p>
 <p>After the archetype generation of your first project you will also notice that the following directory structure has been created:</p>
 <div class="source">
 <pre>my-app
@@ -359,7 +359,7 @@ Vincent Siveton" />
                         `-- AppTest.java</pre></div>
 <p>As you can see, the project created from the archetype has a POM, a source tree for your application's sources and a source tree for your test sources. This is the standard layout for Maven projects (the application sources reside in <tt>${basedir}/src/main/java</tt> and test sources reside in <tt>${basedir}/src/test/java</tt>, where ${basedir} represents the directory containing <tt>pom.xml</tt>).</p>
 <p>If you were to create a Maven project by hand this is the directory structure that we recommend using. This is a Maven convention and to learn more about it you can read our <a href="../introduction/introduction-to-the-standard-directory-layout.html">Introduction to the Standard Directory Layout</a>.</p>
-<p>Now that we have a POM, some application sources, and some test sources you are probably asking ...</p></div>
+<p>Now that we have a POM, some application sources, and some test sources you are probably asking...</p></div>
 <div class="section">
 <h3><a name="How_do_I_compile_my_application_sources">How do I compile my application sources?</a></h3>
 <p>Change to the directory where pom.xml is created by archetype:generate and execute the following command to compile your application sources:</p>
@@ -388,8 +388,8 @@ Compiling 1 source file to &lt;dir&gt;/m
 [INFO] Finished at: Fri Sep 23 15:48:34 GMT-05:00 2005
 [INFO] Final Memory: 2M/6M
 [INFO] ----------------------------------------------------------------------------</pre></div>
-<p>The first time you execute this (or any other) command, Maven will need to download all the plugins and related dependencies it needs to fulfill the command. From a clean installation of Maven this can take quite a while (in the output above, it took almost 4 minutes). If you execute the command again, Maven will now have what it needs, so it won't need to download anything new and will be able to execute the command much more quickly.</p>
-<p>As you can see from the output, the compiled classes were placed in <tt>${basedir}/target/classes</tt>, which is another standard convention employed by Maven. So, if you're a keen observer, you'll notice that by using the standard conventions the POM above is very small and you haven't had to tell Maven explicitly where any of your sources are or where the output should go. By following the standard Maven conventions you can get a lot done with very little effort! Just as a casual comparison, let's take a look at what you might have had to do in <a class="externalLink" href="http://ant.apache.org">Ant</a> to accomplish the same <a href="../../ant/build-a1.xml">thing</a>.</p>
+<p>The first time you execute this (or any other) command, Maven will need to download all the plugins and related dependencies it needs to fulfill the command. From a clean installation of Maven, this can take quite a while (in the output above, it took almost 4 minutes). If you execute the command again, Maven will now have what it needs, so it won't need to download anything new and will be able to execute the command much more quickly.</p>
+<p>As you can see from the output, the compiled classes were placed in <tt>${basedir}/target/classes</tt>, which is another standard convention employed by Maven. So, if you're a keen observer, you'll notice that by using the standard conventions, the POM above is very small and you haven't had to tell Maven explicitly where any of your sources are or where the output should go. By following the standard Maven conventions, you can get a lot done with very little effort! Just as a casual comparison, let's take a look at what you might have had to do in <a class="externalLink" href="http://ant.apache.org">Ant</a> to accomplish the same <a href="../../ant/build-a1.xml">thing</a>.</p>
 <p>Now, this is simply to compile a single tree of application sources and the Ant script shown is pretty much the same size as the POM shown above. But we'll see how much more we can do with just that simple POM!</p></div>
 <div class="section">
 <h3><a name="How_do_I_compile_my_test_sources_and_run_my_unit_tests">How do I compile my test sources and run my unit tests?</a></h3>
@@ -648,8 +648,8 @@ InputStream is = getClass().getResourceA
   &lt;/build&gt;
 &lt;/project&gt;</pre></div>
 <p>You'll notice that we had to add the <tt>build</tt>, <tt>resources</tt>, and <tt>resource</tt> elements which weren't there before. In addition, we had to explicitly state that the resources are located in the src/main/resources directory. All of this information was provided as default values previously, but because the default value for <tt>filtering</tt> is false, we had to add this to our pom.xml in order to override that default value and set <tt>filtering</tt> to true.</p>
-<p>To reference a property defined in your pom.xml, the property name uses the names of the XML elements that define the value, with &quot;pom&quot; being allowed as an alias for the project (root) element. So ${pom.name} refers to the name of the project, ${pom.version} refers to the version of the project, ${pom.build.finalName} refers to the final name of the file created when the built project is packaged, etc. Note that some elements of the POM have default values, so don't need to be explicitly defined in your pom.xml for the values to be available here. Similarly, values in the user's settings.xml can be referenced using property names beginning with &quot;settings&quot; (for example, ${settings.localRepository} refers to the path of the user's local repository).</p>
-<p>To continue our example, let's add a couple of properties to the application.properties file (which we put in the src/main/resources directory) whose values will be supplied when the resource is filtered:</p>
+<p>To reference a property defined in your pom.xml, the property name uses the names of the XML elements that define the value, with &quot;pom&quot; being allowed as an alias for the project (root) element. So <tt>${pom.name}</tt> refers to the name of the project, <tt>${pom.version}</tt> refers to the version of the project, <tt>${pom.build.finalName}</tt> refers to the final name of the file created when the built project is packaged, etc. Note that some elements of the POM have default values, so don't need to be explicitly defined in your <tt>pom.xml</tt> for the values to be available here. Similarly, values in the user's <tt>settings.xml</tt> can be referenced using property names beginning with &quot;settings&quot; (for example, <tt>${settings.localRepository}</tt> refers to the path of the user's local repository).</p>
+<p>To continue our example, let's add a couple of properties to the <tt>application.properties</tt> file (which we put in the <tt>src/main/resources</tt> directory) whose values will be supplied when the resource is filtered:</p>
 <div class="source">
 <pre># application.properties
 application.name=${pom.name}
@@ -657,16 +657,16 @@ application.version=${pom.version}</pre>
 <p>With that in place, you can execute the following command (process-resources is the build lifecycle phase where the resources are copied and filtered):</p>
 <div class="source">
 <pre>mvn process-resources</pre></div>
-<p>and the application.properties file under target/classes (and will eventually go into the jar) looks like this:</p>
+<p>and the <tt>application.properties</tt> file under <tt>target/classes</tt> (and will eventually go into the jar) looks like this:</p>
 <div class="source">
 <pre># application.properties
 application.name=Maven Quick Start Archetype
 application.version=1.0-SNAPSHOT</pre></div>
-<p>To reference a property defined in an external file, all you need to do is add a reference to this external file in your pom.xml. First, let's create our external properties file and call it src/main/filters/filter.properties:</p>
+<p>To reference a property defined in an external file, all you need to do is add a reference to this external file in your pom.xml. First, let's create our external properties file and call it <tt>src/main/filters/filter.properties</tt>:</p>
 <div class="source">
 <pre># filter.properties
 my.filter.value=hello!</pre></div>
-<p>Next, we'll add a reference to this new file in the pom.xml:</p>
+<p>Next, we'll add a reference to this new file in the <tt>pom.xml</tt>:</p>
 <div class="source">
 <pre>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
   xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
@@ -703,13 +703,13 @@ my.filter.value=hello!</pre></div>
     &lt;/resources&gt;
   &lt;/build&gt;
 &lt;/project&gt;</pre></div>
-<p>Then, if we add a reference to this property in the application.properties file:</p>
+<p>Then, if we add a reference to this property in the <tt>application.properties</tt> file:</p>
 <div class="source">
 <pre># application.properties
 application.name=${pom.name}
 application.version=${pom.version}
 message=${my.filter.value}</pre></div>
-<p>the next execution of the <tt>mvn process-resources</tt> command will put our new property value into <tt>application.properties</tt>. As an alternative to defining the my.filter.value property in an external file, you could also have defined it in the <tt>properties</tt> section of your pom.xml and you'd get the same effect (notice I don't need the references to <tt>src/main/filters/filter.properties</tt> either):</p>
+<p>the next execution of the <tt>mvn process-resources</tt> command will put our new property value into <tt>application.properties</tt>. As an alternative to defining the my.filter.value property in an external file, you could also have defined it in the <tt>properties</tt> section of your <tt>pom.xml</tt> and you'd get the same effect (notice I don't need the references to <tt>src/main/filters/filter.properties</tt> either):</p>
 <div class="source">
 <pre>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
   xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
@@ -747,12 +747,12 @@ message=${my.filter.value}</pre></div>
     &lt;my.filter.value&gt;hello&lt;/my.filter.value&gt;
   &lt;/properties&gt;
 &lt;/project&gt;</pre></div>
-<p>Filtering resources can also get values from system properties; either the system properties built into Java (like java.version or user.home) or properties defined on the command line using the standard Java -D parameter. To continue the example, let's change our application.properties file to look like this:</p>
+<p>Filtering resources can also get values from system properties; either the system properties built into Java (like <tt>java.version</tt> or <tt>user.home</tt>) or properties defined on the command line using the standard Java -D parameter. To continue the example, let's change our <tt>application.properties</tt> file to look like this:</p>
 <div class="source">
 <pre># application.properties
 java.version=${java.version}
 command.line.prop=${command.line.prop}</pre></div>
-<p>Now, when you execute the following command (note the definition of the command.line.prop property on the command line), the application.properties file will contain the values from the system properties.</p>
+<p>Now, when you execute the following command (note the definition of the command.line.prop property on the command line), the <tt>application.properties</tt> file will contain the values from the system properties.</p>
 <div class="source">
 <pre>mvn process-resources &quot;-Dcommand.line.prop=hello again&quot;</pre></div></div>
 <div class="section">
@@ -783,7 +783,7 @@ command.line.prop=${command.line.prop}</
     &lt;/dependency&gt;
   &lt;/dependencies&gt;
 &lt;/project&gt;</pre></div>
-<p>For each external dependency, you'll need to define at least 4 things: groupId, artifactId, version, and scope. The groupId, artifactId, and version are the same as those given in the pom.xml for the project that built that dependency. The scope element indicates how your project uses that dependency, and can be values like <tt>compile</tt>, <tt>test</tt>, and <tt>runtime</tt>. For more information on everything you can specify for a dependency, see the <a href="../../../maven-model/maven.html">Project Descriptor Reference</a>.</p><!-- DJ: Does this link work? I can't find the document. -->
+<p>For each external dependency, you'll need to define at least 4 things: groupId, artifactId, version, and scope. The groupId, artifactId, and version are the same as those given in the <tt>pom.xml</tt> for the project that built that dependency. The scope element indicates how your project uses that dependency, and can be values like <tt>compile</tt>, <tt>test</tt>, and <tt>runtime</tt>. For more information on everything you can specify for a dependency, see the <a href="/ref/current/maven-model/maven.html">Project Descriptor Reference</a>.</p><!-- DJ: Does this link work? I can't find the document. -->
 <p>For more information about the dependency mechanism as a whole, see <a href="../introduction/introduction-to-dependency-mechanism.html">Introduction to Dependency Mechanism</a>.</p>
 <p>With this information about a dependency, Maven will be able to reference the dependency when it builds the project. Where does Maven reference the dependency from? Maven looks in your local repository (<tt>~/.m2/repository</tt> is the default location) to find all dependencies. In a <a href="#How_do_I_create_a_JAR_and_install_it_in_my_local_repository">previous section</a>, we installed the artifact from our project (my-app-1.0-SNAPSHOT.jar) into the local repository. Once it's installed there, another project can reference that jar as a dependency simply by adding the dependency information to its pom.xml:</p>
 <div class="source">

Modified: websites/staging/maven/trunk/content/maven-site-1.0-site.jar
==============================================================================
Binary files - no diff available.