mirror of https://github.com/apache/maven.git
o updating the example
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@512583 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4d8b30460a
commit
e981109693
|
@ -74,4 +74,13 @@
|
|||
<artifactId>jdom</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>apache.website</id>
|
||||
<!--
|
||||
<url>scp://people.apache.org/www/maven.apache.org/embedder/${project.version}/</url>
|
||||
-->
|
||||
<url>scp://people.apache.org/home/jvanzyl/public_html/embedder/</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
|
|
|
@ -14,4 +14,7 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<environment>development</environment>
|
||||
</properties>
|
||||
</project>
|
||||
|
|
|
@ -40,7 +40,7 @@ public class MavenEmbedderExampleTest
|
|||
{
|
||||
// START SNIPPET: simple-embedder-example
|
||||
|
||||
File projectDirectory = new File( getBasedir(), "examples/simple-project" );
|
||||
File projectDirectory = new File( getBasedir(), "src/examples/simple-project" );
|
||||
|
||||
File user = new File( projectDirectory, "settings.xml" );
|
||||
|
||||
|
@ -72,6 +72,31 @@ public class MavenEmbedderExampleTest
|
|||
MavenProject project = result.getMavenProject();
|
||||
|
||||
// Do something with the project
|
||||
|
||||
String groupId = project.getGroupId();
|
||||
|
||||
String artifactId = project.getArtifactId();
|
||||
|
||||
String version = project.getVersion();
|
||||
|
||||
String name = project.getName();
|
||||
|
||||
String environment = project.getProperties().getProperty( "environment" );
|
||||
|
||||
assertEquals( "development", environment );
|
||||
|
||||
System.out.println( "You are working in the '" + environment + "' environment!" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ! validationResult.isUserSettingsFilePresent() )
|
||||
{
|
||||
System.out.println( "The specific user settings file '" + user + "' is not present." );
|
||||
}
|
||||
else if ( ! validationResult.isUserSettingsFileParses() )
|
||||
{
|
||||
System.out.println( "Please check your settings file, it is not well formed XML." );
|
||||
}
|
||||
}
|
||||
|
||||
// END SNIPPET: simple-embedder-example
|
||||
|
|
Loading…
Reference in New Issue