flip pom format

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163511 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-03-10 01:35:25 +00:00
parent 8d74f0acc4
commit a44b6f9726
150 changed files with 2200 additions and 2129 deletions

View File

@ -9,3 +9,6 @@ mboot.jar
dummy
build.ajproperties
.generated.lst
*.iml
*.iws
*.ipr

View File

@ -1,6 +1,7 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>foo</groupId>
<artifactId>foo</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
</project>
</model>

View File

@ -1,25 +1,23 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-component</artifactId>
<groupId>maven</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-1.x-integration</artifactId>
<packaging>jar</packaging>
<name>Maven 1.x Compatibility</name>
<version>2.0-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<inceptionYear>2004</inceptionYear>
<package>org.apache.maven.legacy</package>
<!-- TODO: is there a way around this using classworlds? -->
<dependencies>
<dependency>
<groupId>forehead</groupId>
<artifactId>forehead</artifactId>
<version>1.0-beta-5</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,33 +1,42 @@
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-archetype</artifactId>
<groupId>maven</groupId>
<version>1.0-alpha-1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-archetype-core</artifactId>
<packaging>jar</packaging>
<version>1.0-alpha-1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-velocity</artifactId>
<version>1.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>wagon-http-lightweight</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,23 +1,22 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-plugin-parent</artifactId>
<groupId>maven</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<packaging>plugin</packaging>
<name>Maven Archetype Plugin</name>
<version>1.0-SNAPSHOT</version>
<type>plugin</type>
<package>org.apache.maven</package>
<dependencies>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-archetype-core</artifactId>
<version>1.0-alpha-1-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,11 +1,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-archetype</artifactId>
<groupId>maven</groupId>
<version>1.0-alpha-1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-archetype-site</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
</project>
</model>

View File

@ -1,11 +1,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-archetypes</artifactId>
<groupId>maven</groupId>
<version>1.0-alpha-1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-archetype-quickstart</artifactId>
<packaging>jar</packaging>
<version>1.0-alpha-1-SNAPSHOT</version>
</project>
</model>

View File

@ -1,13 +1,16 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<packaging>jar</packaging>
<version>${version}</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,11 +1,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-archetypes</artifactId>
<groupId>maven</groupId>
<version>1.0-alpha-1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-archetype-webapp</artifactId>
<packaging>jar</packaging>
<version>1.0-alpha-1-SNAPSHOT</version>
</project>
</model>

View File

@ -1,13 +1,16 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<packaging>jar</packaging>
<version>${version}</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
@ -17,4 +20,4 @@
</resource>
</resources>
</build>
</project>
</model>

View File

@ -1,11 +1,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-archetype</artifactId>
<groupId>maven</groupId>
<version>1.0-alpha-1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-archetypes</artifactId>
<packaging>jar</packaging>
<version>1.0-alpha-1-SNAPSHOT</version>
</project>
</model>

View File

@ -1,11 +1,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-component</artifactId>
<groupId>maven</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-archetype</artifactId>
<packaging>jar</packaging>
<version>1.0-alpha-1-SNAPSHOT</version>
</project>
</model>

View File

@ -1,48 +1,63 @@
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-component</artifactId>
<groupId>maven</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-archiver</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-monitor</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>1.0-alpha-1-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-core</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-model</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -21,14 +21,12 @@
import org.apache.maven.model.Dependency;
import org.apache.maven.plugin.PluginExecutionRequest;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.archiver.jar.JarArchiver;
import org.codehaus.plexus.archiver.jar.Manifest;
import java.io.File;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.Set;
/**
@ -43,12 +41,13 @@ public class MavenArchiver
/**
* Return a pre-configured manifest
*
* @todo Add user attributes list and user groups list
*/
public Manifest getManifest( PluginExecutionRequest request )
throws Exception
{
MavenProject project = (MavenProject)request.getParameter("project");
MavenProject project = (MavenProject) request.getParameter( "project" );
String mainClass = (String) request.getParameter( "mainClass" );
@ -62,8 +61,10 @@ public Manifest getManifest( PluginExecutionRequest request )
m.addConfiguredAttribute( buildAttr );
Manifest.Attribute createdAttr = new Manifest.Attribute( "Created-By", "Apache Maven" );
m.addConfiguredAttribute( createdAttr );
/* TODO: need to add jar plugin config
Manifest.Attribute packageAttr = new Manifest.Attribute( "Package", project.getPackage() );
m.addConfiguredAttribute( packageAttr );
*/
Manifest.Attribute buildJdkAttr = new Manifest.Attribute( "Build-Jdk", System.getProperty( "java.version" ) );
m.addConfiguredAttribute( buildJdkAttr );
@ -75,6 +76,7 @@ public Manifest getManifest( PluginExecutionRequest request )
for ( Iterator iter = dependencies.iterator(); iter.hasNext(); )
{
Dependency dependency = (Dependency) iter.next();
/* TODO: need to add to jar plugin config
Properties properties = dependency.getProperties();
if ( Boolean.valueOf(properties.getProperty("manifest.classpath")).booleanValue())
{
@ -86,8 +88,9 @@ public Manifest getManifest( PluginExecutionRequest request )
// TODO replace dependency by artifact
classpath.append( dependency.getArtifactId() + "-" + dependency.getVersion() + ".jar");
}
*/
}
Manifest.Attribute classpathAttr = new Manifest.Attribute( "Class-Path", classpath.toString() );
m.addConfiguredAttribute( classpathAttr );
}
@ -95,27 +98,32 @@ public Manifest getManifest( PluginExecutionRequest request )
// Added supplementary entries
Manifest.Attribute extensionNameAttr = new Manifest.Attribute( "Extension-Name", project.getArtifactId() );
m.addConfiguredAttribute( extensionNameAttr );
if ( project.getShortDescription() != null )
if ( project.getDescription() != null )
{
Manifest.Attribute specificationTitleAttr = new Manifest.Attribute( "Specification-Title", project.getShortDescription() );
Manifest.Attribute specificationTitleAttr = new Manifest.Attribute( "Specification-Title",
project.getDescription() );
m.addConfiguredAttribute( specificationTitleAttr );
}
if ( project.getOrganization() != null )
{
Manifest.Attribute specificationVendor = new Manifest.Attribute( "Specification-Vendor", project.getOrganization().getName() );
Manifest.Attribute specificationVendor = new Manifest.Attribute( "Specification-Vendor",
project.getOrganization().getName() );
m.addConfiguredAttribute( specificationVendor );
Manifest.Attribute implementationVendorAttr = new Manifest.Attribute( "Implementation-Vendor", project.getOrganization().getName() );
Manifest.Attribute implementationVendorAttr = new Manifest.Attribute( "Implementation-Vendor",
project.getOrganization().getName() );
m.addConfiguredAttribute( implementationVendorAttr );
}
Manifest.Attribute implementationTitleAttr = new Manifest.Attribute( "Implementation-Title", project.getArtifactId() );
Manifest.Attribute implementationTitleAttr = new Manifest.Attribute( "Implementation-Title",
project.getArtifactId() );
m.addConfiguredAttribute( implementationTitleAttr );
Manifest.Attribute implementationVersionAttr = new Manifest.Attribute( "Implementation-Version", project.getVersion() );
Manifest.Attribute implementationVersionAttr = new Manifest.Attribute( "Implementation-Version",
project.getVersion() );
m.addConfiguredAttribute( implementationVersionAttr );
if ( mainClass != null && ! "".equals( mainClass ) )
if ( mainClass != null && !"".equals( mainClass ) )
{
Manifest.Attribute mainClassAttr = new Manifest.Attribute( "Main-Class", mainClass );
m.addConfiguredAttribute( mainClassAttr );
@ -132,7 +140,7 @@ public Manifest getManifest( PluginExecutionRequest request )
Artifact artifact = (Artifact) iter.next();
if ( "jar".equals( artifact.getType() ) )
{
if (extensionsList.length() > 0 )
if ( extensionsList.length() > 0 )
{
extensionsList.append( " " );
}
@ -140,9 +148,10 @@ public Manifest getManifest( PluginExecutionRequest request )
}
}
if (extensionsList.length() > 0 )
if ( extensionsList.length() > 0 )
{
Manifest.Attribute extensionsListAttr = new Manifest.Attribute( "Extension-List", extensionsList.toString() );
Manifest.Attribute extensionsListAttr = new Manifest.Attribute( "Extension-List",
extensionsList.toString() );
m.addConfiguredAttribute( extensionsListAttr );
}
@ -151,14 +160,17 @@ public Manifest getManifest( PluginExecutionRequest request )
Artifact artifact = (Artifact) iter.next();
if ( "jar".equals( artifact.getType() ) )
{
Manifest.Attribute archExtNameAttr = new Manifest.Attribute( artifact.getArtifactId()
+ "-Extension-Name", artifact.getArtifactId() );
Manifest.Attribute archExtNameAttr = new Manifest.Attribute( artifact.getArtifactId() +
"-Extension-Name",
artifact.getArtifactId() );
m.addConfiguredAttribute( archExtNameAttr );
Manifest.Attribute archImplVersionAttr = new Manifest.Attribute( artifact.getArtifactId()
+ "-Implementation-Version", artifact.getVersion() );
Manifest.Attribute archImplVersionAttr = new Manifest.Attribute( artifact.getArtifactId() +
"-Implementation-Version",
artifact.getVersion() );
m.addConfiguredAttribute( archImplVersionAttr );
Manifest.Attribute archImplUrlAttr = new Manifest.Attribute( artifact.getArtifactId()
+ "-Implementation-URL", "http://www.ibiblio.org/maven/" + artifact.toString() );
Manifest.Attribute archImplUrlAttr = new Manifest.Attribute( artifact.getArtifactId() +
"-Implementation-URL", "http://www.ibiblio.org/maven/" +
artifact.toString() );
m.addConfiguredAttribute( archImplUrlAttr );
}
}
@ -189,7 +201,7 @@ public void createArchive( PluginExecutionRequest request )
//
// ----------------------------------------------------------------------
MavenProject project = (MavenProject)request.getParameter("project");
MavenProject project = (MavenProject) request.getParameter( "project" );
String manifest = (String) request.getParameter( "manifest" );
@ -203,7 +215,7 @@ public void createArchive( PluginExecutionRequest request )
archiver.addFile( project.getFile(), "META-INF/maven/pom.xml" );
if (manifest != null && ! "".equals( manifest ) )
if ( manifest != null && !"".equals( manifest ) )
{
File manifestFile = new File( manifest );
archiver.setManifest( manifestFile );

View File

@ -1,34 +1,37 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-component</artifactId>
<groupId>maven</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-artifact</artifactId>
<packaging>jar</packaging>
<name>Maven</name>
<version>2.0-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<inceptionYear>2001</inceptionYear>
<package>org.apache.maven</package>
<logo>/images/maven.gif</logo>
<dependencies>
<dependency>
<groupId>maven</groupId>
<artifactId>wagon-provider-api</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>wagon-file</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>wagon-http-lightweight</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,95 +1,116 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core</artifactId>
<packaging>jar</packaging>
<name>Maven</name>
<version>2.0-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<inceptionYear>2001</inceptionYear>
<package>org.apache.maven</package>
<logo>/images/maven.gif</logo>
<dependencies>
<!-- maven component -->
<dependency>
<groupId>maven</groupId>
<artifactId>maven-model</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- -->
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.0-beta-2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-i18n</artifactId>
<version>1.0-beta-2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>2.5.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- Used to support maven.xml script and goal decorating in general. -->
<dependency>
<groupId>marmalade</groupId>
<artifactId>marmalade-core</artifactId>
<version>0.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>marmalade</groupId>
<artifactId>marmalade-el-ognl</artifactId>
<version>0.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- This will eventually be removed -->
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>1.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-compiler-javac</artifactId>
<version>1.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>surefire</groupId>
<artifactId>surefire-booter</artifactId>
<version>1.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- Wagon -->
<dependency>
<groupId>maven</groupId>
<artifactId>wagon-api</artifactId>
<version>0.9-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>wagon-http-lightweight</artifactId>
<version>0.9-SNAPSHOT</version>
</dependency>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>wagon-ssh</artifactId>
<version>0.9-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jsch</groupId>
<artifactId>jsch</artifactId>
<version>0.1.14</version>
<version>0.1.14</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- plugin plugin -->
<dependency>
<groupId>qdox</groupId>
<artifactId>qdox</artifactId>
<version>1.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,17 +1,14 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-plugin-parent</artifactId>
<groupId>maven</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it-plugin</artifactId>
<type>plugin</type>
<packaging>plugin</packaging>
<name>Maven Core Integration Test Plugin</name>
<version>1.0-SNAPSHOT</version>
<inceptionYear>2001</inceptionYear>
<package>org.apache.maven.plugin.coreit</package>
</project>
</model>

View File

@ -1,6 +1,7 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-it-support</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
</project>
</model>

View File

@ -1,6 +1,7 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it-verifier</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
</project>
</model>

View File

@ -1,14 +1,16 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it0000</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>
</dependencies>
</model>

View File

@ -1,14 +1,16 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it0001</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>
</dependencies>
</model>

View File

@ -1,19 +1,23 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it0002</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-it-support</artifactId>
<version>1.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</dependencies>
</model>

View File

@ -1,14 +1,16 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it0003</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>
</dependencies>
</model>

View File

@ -1,6 +1,7 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it0004</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
</project>
</model>

View File

@ -1,6 +1,7 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it0005</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
</project>
</model>

View File

@ -1,19 +1,21 @@
<project>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-it-support-parent</artifactId>
<groupId>maven</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it0007</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>
</dependencies>
</model>

View File

@ -1,21 +1,24 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it0008</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
<plugins>
<plugin>
<id>core-it</id>
</plugin>
</plugins>
</project>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>maven</groupId>
<artifactId>maven-core-it-plugin</artifactId>
</plugin>
</plugins>
</build>
</model>

View File

@ -1,20 +1,23 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it0010</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<groupId>maven</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>
</dependencies>
</model>

View File

@ -1,16 +1,21 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it0011</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-plugin</artifactId>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
<dependencyManagement>
@ -19,13 +24,16 @@
<groupId>maven</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
</model>

View File

@ -1,19 +1,23 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it0012</artifactId>
<packaging>jar</packaging>
<version>3.8.1</version>
<dependencies>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version}</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,20 +1,23 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-it0013-plugin</artifactId>
<packaging>plugin</packaging>
<version>1.0-SNAPSHOT</version>
<type>plugin</type>
<dependencies>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,33 +1,41 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-it0015-plugin</artifactId>
<packaging>plugin</packaging>
<version>1.0-SNAPSHOT</version>
<type>plugin</type>
<dependencies>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-script-marmalade</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>marmalade</groupId>
<artifactId>marmalade-core</artifactId>
<version>1.0-alpha2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource><directory>src/main/resources</directory></resource>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/scripts</directory>
<includes><include>**/*.mmld</include></includes>
<includes>**/*.mmld</includes>
</resource>
</resources>
</build>
</project>
</model>

View File

@ -1,20 +1,7 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it0016</artifactId>
<type>war</type>
<packaging>war</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>servletapi</groupId>
<artifactId>servletapi</artifactId>
<version>2.3</version>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,5 +1,6 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-core-it1001</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
</project>
</model>

View File

@ -1,6 +1,7 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it1002</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
</project>
</model>

View File

@ -1,14 +1,16 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core-it1003</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>
</dependencies>
</model>

View File

@ -1,106 +1,132 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-component</artifactId>
<groupId>maven</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core</artifactId>
<packaging>jar</packaging>
<name>Maven</name>
<version>2.0-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<inceptionYear>2001</inceptionYear>
<package>org.apache.maven</package>
<logo>/images/maven.gif</logo>
<dependencies>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-container-artifact</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- maven component -->
<dependency>
<groupId>maven</groupId>
<artifactId>maven-monitor</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-model</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-user-model</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- -->
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.0-beta-2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-i18n</artifactId>
<version>1.0-beta-3</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>wagon-provider-api</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
</dependency>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>wagon-http-lightweight</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
</dependency>
<!-- Added to support marmalade-mojos.
| Currently plexus container cannot accommodate multiple plexus.xml files,
| so we have to include marmalade support here. Will remove when plexus
| container is fixed (post-alpha-1 m2 release). -->
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-marmalade-factory</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-script-marmalade</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>marmalade</groupId>
<artifactId>marmalade-core</artifactId>
<version>1.0-alpha2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
<version>1.1.3.3</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- End marmalade support deps. -->
</dependencies>
<reports>
<plugins>
<plugin>
<groupId>maven</groupId>
<artifactId>mail-lists</artifactId>
</plugin>
<plugin>
<groupId>maven</groupId>
<artifactId>dependencies</artifactId>
</plugin>
</plugins>
</reports>
<distributionManagement>
<site>
<id>website</id>
<url>scp://www.apache.org//www/maven.apache.org/m2</url>
</site>
</distributionManagement>
<reports>
<report>mail-lists</report>
<report>dependencies</report>
</reports>
</project>
</model>

View File

@ -1,20 +1,19 @@
package org.apache.maven.lifecycle;
/* ====================================================================
* Copyright 2001-2004 The Apache Software Foundation.
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.maven.artifact.handler.ArtifactHandler;
@ -70,7 +69,7 @@ public class DefaultLifecycleExecutor
/**
* Execute a list of tasks. Each task may be a phase in the lifecycle or the
* execution of a mojo.
*
*
* @param tasks
* @param session
*/
@ -84,7 +83,7 @@ public MavenExecutionResponse execute( List tasks, MavenSession session )
{
// TODO: should enrich this with the type handler, but for now just
// use "type" as is
ArtifactHandler handler = artifactHandlerManager.getArtifactHandler( session.getProject().getType() );
ArtifactHandler handler = artifactHandlerManager.getArtifactHandler( session.getProject().getPackaging() );
if ( handler != null )
{
@ -97,7 +96,7 @@ public MavenExecutionResponse execute( List tasks, MavenSession session )
}
if ( handler.additionalPlugin() != null )
{
processPluginPhases( handler.additionalPlugin(), session );
processPluginPhases( "maven", handler.additionalPlugin(), session );
}
}
@ -141,27 +140,27 @@ public MavenExecutionResponse execute( List tasks, MavenSession session )
}
// TODO: don't throw Exception
private void processPluginConfiguration( MavenProject project, MavenSession mavenSession ) throws Exception
private void processPluginConfiguration( MavenProject project, MavenSession mavenSession )
throws Exception
{
for ( Iterator i = project.getPlugins().iterator(); i.hasNext(); )
{
Plugin plugin = (Plugin) i.next();
// TODO: should this flag be used in verifyPlugin, completely
// disabling the plugin?
// TODO: should this flag be used in verifyPlugin, completely disabling the plugin?
if ( Boolean.TRUE != plugin.isDisabled() )
{
String pluginId = plugin.getId();
processPluginPhases( pluginId, mavenSession );
processPluginPhases( plugin.getGroupId(), plugin.getArtifactId(), mavenSession );
}
}
}
// TODO: don't throw Exception
private void processPluginPhases( String pluginId, MavenSession mavenSession ) throws Exception
private void processPluginPhases( String groupId, String artifactId, MavenSession mavenSession )
throws Exception
{
pluginManager.verifyPlugin( pluginId, mavenSession );
PluginDescriptor pluginDescriptor = pluginManager.getPluginDescriptor( pluginId );
pluginManager.verifyPlugin( groupId, artifactId, mavenSession );
PluginDescriptor pluginDescriptor = pluginManager.getPluginDescriptor( groupId, artifactId );
for ( Iterator j = pluginDescriptor.getMojos().iterator(); j.hasNext(); )
{
MojoDescriptor mojoDescriptor = (MojoDescriptor) j.next();
@ -177,7 +176,8 @@ private void processPluginPhases( String pluginId, MavenSession mavenSession ) t
}
private void processGoalChain( String task, MavenSession session ) throws Exception
private void processGoalChain( String task, MavenSession session )
throws Exception
{
if ( phaseMap.containsKey( task ) )
{
@ -205,7 +205,8 @@ private void processGoalChain( String task, MavenSession session ) throws Except
}
}
private void verifyMojoPhase( String task, MavenSession session ) throws Exception
private void verifyMojoPhase( String task, MavenSession session )
throws Exception
{
MojoDescriptor mojoDescriptor = pluginManager.getMojoDescriptor( task );
if ( mojoDescriptor == null )
@ -272,7 +273,8 @@ private void executePhase( String phase, MavenSession session, MavenExecutionRes
}
}
protected PluginExecutionResponse executeMojo( String id, MavenSession session ) throws LifecycleExecutionException
protected PluginExecutionResponse executeMojo( String id, MavenSession session )
throws LifecycleExecutionException
{
// ----------------------------------------------------------------------
// We have something of the form <pluginId>:<mojoId>, so this might be
@ -311,7 +313,8 @@ public Phase getPhase( String id )
// Lifecylce Management
// ----------------------------------------------------------------------
public void initialize() throws Exception
public void initialize()
throws Exception
{
phaseMap = new HashMap();

View File

@ -68,8 +68,6 @@ public class DefaultPluginManager
protected Map pluginDescriptors;
// protected ArtifactHandlerManager artifactHandlerManager;
protected PlexusContainer container;
protected PluginDescriptorBuilder pluginDescriptorBuilder;
@ -109,9 +107,14 @@ public MojoDescriptor getMojoDescriptor( String name )
return (MojoDescriptor) mojoDescriptors.get( name );
}
public PluginDescriptor getPluginDescriptor( String pluginId )
public PluginDescriptor getPluginDescriptor( String groupId, String artifactId )
{
return (PluginDescriptor) pluginDescriptors.get( pluginId );
return (PluginDescriptor) pluginDescriptors.get( constructPluginKey( groupId, artifactId ) );
}
private static String constructPluginKey( String groupId, String artifactId )
{
return groupId + ":" + artifactId;
}
// ----------------------------------------------------------------------
@ -140,7 +143,8 @@ public void processPluginDescriptor( MavenPluginDescriptor mavenPluginDescriptor
mojoDescriptors.put( mojoDescriptor.getId(), mojoDescriptor );
pluginDescriptors.put( pluginDescriptor.getId(), pluginDescriptor );
String key = constructPluginKey( pluginDescriptor.getGroupId(), pluginDescriptor.getArtifactId() );
pluginDescriptors.put( key, pluginDescriptor );
}
}
@ -173,9 +177,9 @@ public void componentDiscovered( ComponentDiscoveryEvent event )
//
// ----------------------------------------------------------------------
public boolean isPluginInstalled( String pluginId )
public boolean isPluginInstalled( String groupId, String artifactId )
{
return pluginDescriptors.containsKey( pluginId );
return pluginDescriptors.containsKey( constructPluginKey( groupId, artifactId ) );
}
private String getPluginId( String goalName )
@ -194,21 +198,20 @@ public void verifyPluginForGoal( String goalName, MavenSession session )
{
String pluginId = getPluginId( goalName );
verifyPlugin( pluginId, session );
// TODO: hardcoding of group ID/artifact ID
verifyPlugin( "maven", "maven-" + pluginId + "-plugin", session );
}
// TODO: don't throw Exception
public void verifyPlugin( String pluginId, MavenSession session )
public void verifyPlugin( String groupId, String artifactId, MavenSession session )
throws Exception
{
if ( !isPluginInstalled( pluginId ) )
if ( !isPluginInstalled( groupId, artifactId ) )
{
//!! This is entirely crappy. We need a better naming for plugin
// artifact ids and
// we definitely need better version extraction support.
String artifactId = "maven-" + pluginId + "-plugin";
String version = "1.0-SNAPSHOT";
ArtifactFactory artifactFactory = null;
@ -396,7 +399,7 @@ private void releaseComponents( MojoDescriptor goal, PluginExecutionRequest requ
String expression = parameter.getExpression();
if ( expression != null & expression.startsWith( "#component" ) )
if ( expression != null && expression.startsWith( "#component" ) )
{
Object component = request.getParameter( key );
@ -490,7 +493,8 @@ public static Map mergeProjectDefinedPluginConfiguration( MavenProject project,
{
org.apache.maven.model.Plugin plugin = (org.apache.maven.model.Plugin) iterator.next();
if ( pluginId.equals( plugin.getId() ) )
// TODO: groupID not handled
if ( pluginId.equals( plugin.getArtifactId() ) )
{
return CollectionUtils.mergeMaps( plugin.getConfiguration(), map );
}

View File

@ -40,7 +40,8 @@ public MavenPluginDescriptor( PluginDescriptor pluginDescriptor )
public String getPluginId()
{
return pluginDescriptor.getId();
// TODO: groupID
return pluginDescriptor.getArtifactId();
}
// ----------------------------------------------------------------------

View File

@ -76,7 +76,8 @@ public ComponentSetDescriptor createComponentDescriptors( Reader componentDescri
ComponentSetDescriptor componentSet = new MavenPluginDescriptor( pluginDescriptor );
componentSet.setId( pluginDescriptor.getId() );
// TODO: no group
componentSet.setId( pluginDescriptor.getArtifactId() );
// ----------------------------------------------------------------------
// If the ComponentSet states any dependencies then we want to collect

View File

@ -30,15 +30,18 @@ public interface PluginManager
{
String ROLE = PluginManager.class.getName();
PluginExecutionResponse executeMojo( MavenSession session, String goalName ) throws GoalExecutionException;
PluginExecutionResponse executeMojo( MavenSession session, String goalName )
throws GoalExecutionException;
MojoDescriptor getMojoDescriptor( String goalId );
// TODO: don't throw Exception
void verifyPluginForGoal( String goalName, MavenSession session ) throws Exception;
void verifyPluginForGoal( String goalName, MavenSession session )
throws Exception;
// TODO: don't throw Exception
void verifyPlugin( String pluginId, MavenSession session ) throws Exception;
void verifyPlugin( String groupId, String artifactId, MavenSession session )
throws Exception;
PluginDescriptor getPluginDescriptor( String pluginId );
PluginDescriptor getPluginDescriptor( String groupId, String artifactId );
}

View File

@ -104,9 +104,7 @@ public MavenProject build( File projectDescriptor, ArtifactRepository localRepos
LinkedList lineage = new LinkedList();
List aggregatedRemoteWagonRepositories = buildArtifactRepositories( superModel.getRepositories() );
MavenProject project = assembleLineage( projectDescriptor,
localRepository,
lineage,
MavenProject project = assembleLineage( projectDescriptor, localRepository, lineage,
aggregatedRemoteWagonRepositories );
Model previous = superModel;
@ -168,7 +166,8 @@ public MavenProject build( File projectDescriptor, ArtifactRepository localRepos
pathTranslator.alignToBaseDirectory( project.getModel(), projectDescriptor );
project.addCompileSourceRoot( project.getBuild().getSourceDirectory() );
project.addTestCompileSourceRoot( project.getBuild().getUnitTestSourceDirectory() );
project.addScriptSourceRoot( project.getBuild().getScriptSourceDirectory() );
project.addTestCompileSourceRoot( project.getBuild().getTestSourceDirectory() );
return project;
}
@ -246,7 +245,8 @@ private List buildArtifactRepositories( List repositories )
return repos;
}
private Model readModel( File file ) throws ProjectBuildingException
private Model readModel( File file )
throws ProjectBuildingException
{
try
{

View File

@ -29,6 +29,7 @@
import org.apache.maven.model.MailingList;
import org.apache.maven.model.Model;
import org.apache.maven.model.Organization;
import org.apache.maven.model.Reports;
import org.apache.maven.model.Scm;
import java.io.File;
@ -128,6 +129,8 @@ public DependencyManagement getDependencyManagement()
private List testCompileSourceRoots = new ArrayList();
private List scriptSourceRoots = new ArrayList();
public void addCompileSourceRoot( String path )
{
if ( path != null )
@ -143,6 +146,21 @@ public void addCompileSourceRoot( String path )
}
}
public void addScriptSourceRoot( String path )
{
if ( path != null )
{
path = path.trim();
if ( path.length() != 0 )
{
if ( !scriptSourceRoots.contains( path ) )
{
scriptSourceRoots.add( path );
}
}
}
}
public void addTestCompileSourceRoot( String path )
{
if ( path != null )
@ -163,6 +181,11 @@ public List getCompileSourceRoots()
return compileSourceRoots;
}
public List getScriptSourceRoots()
{
return scriptSourceRoots;
}
public List getTestCompileSourceRoots()
{
return testCompileSourceRoots;
@ -189,7 +212,7 @@ public List getTestClasspathElements()
{
List list = new ArrayList( getArtifacts().size() + 1 );
list.add( getBuild().getOutput() );
list.add( getBuild().getOutputDirectory() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
@ -212,7 +235,7 @@ public List getRuntimeClasspathElements()
{
List list = new ArrayList( getArtifacts().size() + 1 );
list.add( getBuild().getOutput() );
list.add( getBuild().getOutputDirectory() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
@ -302,14 +325,14 @@ public String getVersion()
return model.getVersion();
}
public String getType()
public String getPackaging()
{
return model.getType();
return model.getPackaging();
}
public void setType( String type )
public void setPackaging( String packaging )
{
model.setType( type );
model.setPackaging( packaging );
}
public void setInceptionYear( String inceptionYear )
@ -322,16 +345,6 @@ public String getInceptionYear()
return model.getInceptionYear();
}
public void setPackage( String packageName )
{
model.setPackage( packageName );
}
public String getPackage()
{
return model.getPackage();
}
public void setUrl( String url )
{
model.setUrl( url );
@ -342,16 +355,6 @@ public String getUrl()
return model.getUrl();
}
public void setLogo( String logo )
{
model.setLogo( logo );
}
public String getLogo()
{
return model.getLogo();
}
public void setIssueManagement( IssueManagement issueManagement )
{
model.setIssueManagement( issueManagement );
@ -382,16 +385,6 @@ public DistributionManagement getDistributionManagement()
return model.getDistributionManagement();
}
public void setShortDescription( String shortDescription )
{
model.setShortDescription( shortDescription );
}
public String getShortDescription()
{
return model.getShortDescription();
}
public void setDescription( String description )
{
model.setDescription( description );
@ -477,21 +470,16 @@ public Build getBuild()
return model.getBuild();
}
public void setReports( List reports )
public void setReports( Reports reports )
{
model.setReports( reports );
}
public List getReports()
public Reports getReports()
{
return model.getReports();
}
public void addReports( String report )
{
model.addReport( report );
}
public void setLicenses( List licenses )
{
model.setLicenses( licenses );
@ -528,7 +516,11 @@ public List getRepositories()
public List getPlugins()
{
return model.getPlugins();
if ( model.getBuild() == null )
{
return null;
}
return model.getBuild().getPlugins();
}
}

View File

@ -1,20 +1,19 @@
package org.apache.maven.project.inheritance;
/* ====================================================================
* Copyright 2001-2004 The Apache Software Foundation.
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.maven.model.Build;
@ -26,7 +25,6 @@
import org.apache.maven.model.PluginManagement;
import org.apache.maven.model.Repository;
import org.apache.maven.model.Scm;
import org.apache.maven.model.UnitTest;
import org.codehaus.plexus.util.StringUtils;
import java.util.Iterator;
@ -40,7 +38,7 @@
* @version $Id: DefaultModelInheritanceAssembler.java,v 1.4 2004/08/23 20:24:54
* jdcasey Exp $
* @todo generate this with modello to keep it in sync with changes in the
* model.
* model.
*/
public class DefaultModelInheritanceAssembler
implements ModelInheritanceAssembler
@ -83,12 +81,6 @@ public void assembleModelInheritance( Model child, Model parent )
child.setInceptionYear( parent.getInceptionYear() );
}
// Name
if ( child.getPackage() == null )
{
child.setPackage( parent.getPackage() );
}
// url
if ( child.getUrl() == null )
{
@ -110,13 +102,7 @@ public void assembleModelInheritance( Model child, Model parent )
child.setIssueManagement( parent.getIssueManagement() );
}
// Short description
if ( child.getShortDescription() == null )
{
child.setShortDescription( parent.getShortDescription() );
}
// Short description
// description
if ( child.getDescription() == null )
{
child.setDescription( parent.getDescription() );
@ -155,12 +141,6 @@ public void assembleModelInheritance( Model child, Model parent )
child.setMailingLists( parent.getMailingLists() );
}
// reports
if ( child.getReports().size() == 0 )
{
child.setReports( parent.getReports() );
}
// Build
assembleBuildInheritance( child, parent );
@ -191,17 +171,43 @@ public void assembleModelInheritance( Model child, Model parent )
}
// Plugins :: aggregate
List parentPlugins = parent.getPlugins();
List childPlugins = child.getPlugins();
for ( Iterator iterator = parentPlugins.iterator(); iterator.hasNext(); )
if ( parent.getBuild() != null && child.getBuild() != null )
{
Plugin plugin = (Plugin) iterator.next();
List parentPlugins = parent.getBuild().getPlugins();
if ( !childPlugins.contains( plugin ) )
List childPlugins = child.getBuild().getPlugins();
for ( Iterator iterator = parentPlugins.iterator(); iterator.hasNext(); )
{
child.addPlugin( plugin );
Plugin plugin = (Plugin) iterator.next();
if ( !childPlugins.contains( plugin ) )
{
child.getBuild().addPlugin( plugin );
}
}
}
// Reports :: aggregate
if ( child.getReports() != null && parent.getReports() != null )
{
if ( child.getReports().getOutputDirectory() == null )
{
child.getReports().setOutputDirectory( parent.getReports().getOutputDirectory() );
}
List parentReports = parent.getReports().getPlugins();
List childReports = child.getReports().getPlugins();
for ( Iterator iterator = parentReports.iterator(); iterator.hasNext(); )
{
Plugin plugin = (Plugin) iterator.next();
if ( !childReports.contains( plugin ) )
{
child.getReports().addPlugin( plugin );
}
}
}
@ -231,19 +237,19 @@ private void assemblePluginManagementInheritance( Model child, Model parent )
for ( Iterator it = childPlugins.iterator(); it.hasNext(); )
{
Plugin plugin = (Plugin) it.next();
mappedChildPlugins.put( plugin.getId(), plugin );
mappedChildPlugins.put( constructPluginKey( plugin ), plugin );
}
for ( Iterator it = parentPluginMgmt.getPlugins().iterator(); it.hasNext(); )
{
Plugin plugin = (Plugin) it.next();
if ( !mappedChildPlugins.containsKey( plugin.getId() ) )
if ( !mappedChildPlugins.containsKey( constructPluginKey( plugin ) ) )
{
childPluginMgmt.addPlugin( plugin );
}
else
{
Plugin childPlugin = (Plugin) mappedChildPlugins.get( plugin.getId() );
Plugin childPlugin = (Plugin) mappedChildPlugins.get( constructPluginKey( plugin ) );
Map mappedChildGoals = new TreeMap();
for ( Iterator itGoals = childPlugin.getGoals().iterator(); itGoals.hasNext(); )
@ -282,6 +288,11 @@ private void assemblePluginManagementInheritance( Model child, Model parent )
}
}
private String constructPluginKey( Plugin plugin )
{
return plugin.getGroupId() + ":" + plugin.getArtifactId();
}
private void assembleDependencyManagementInheritance( Model child, Model parent )
{
DependencyManagement parentDepMgmt = parent.getDependencyManagement();
@ -342,19 +353,24 @@ private void assembleBuildInheritance( Model child, Model parent )
childBuild.setSourceDirectory( parentBuild.getSourceDirectory() );
}
if ( childBuild.getUnitTestSourceDirectory() == null )
if ( childBuild.getScriptSourceDirectory() == null )
{
childBuild.setUnitTestSourceDirectory( parentBuild.getUnitTestSourceDirectory() );
childBuild.setScriptSourceDirectory( parentBuild.getScriptSourceDirectory() );
}
if ( childBuild.getOutput() == null )
if ( childBuild.getTestSourceDirectory() == null )
{
childBuild.setOutput( parentBuild.getOutput() );
childBuild.setTestSourceDirectory( parentBuild.getTestSourceDirectory() );
}
if ( childBuild.getTestOutput() == null )
if ( childBuild.getOutputDirectory() == null )
{
childBuild.setTestOutput( parentBuild.getTestOutput() );
childBuild.setOutputDirectory( parentBuild.getOutputDirectory() );
}
if ( childBuild.getTestOutputDirectory() == null )
{
childBuild.setTestOutputDirectory( parentBuild.getTestOutputDirectory() );
}
if ( childBuild.getFinalName() == null )
@ -368,30 +384,10 @@ private void assembleBuildInheritance( Model child, Model parent )
childBuild.setResources( parentBuild.getResources() );
}
UnitTest childUnitTest = childBuild.getUnitTest();
UnitTest parentUnitTest = parentBuild.getUnitTest();
if ( childUnitTest == null )
resources = childBuild.getTestResources();
if ( resources == null || resources.isEmpty() )
{
childBuild.setUnitTest( parentUnitTest );
}
else
{
if ( childUnitTest.getIncludes().size() == 0 )
{
childUnitTest.setIncludes( parentUnitTest.getIncludes() );
}
if ( childUnitTest.getExcludes().size() == 0 )
{
childUnitTest.setExcludes( parentUnitTest.getExcludes() );
}
List testResources = childUnitTest.getResources();
if ( testResources == null || testResources.isEmpty() )
{
childUnitTest.setResources( parentUnitTest.getResources() );
}
childBuild.setTestResources( parentBuild.getTestResources() );
}
}
}
@ -416,8 +412,8 @@ private void assembleScmInheritance( Model child, Model parent )
childScm.setConnection( parentScm.getConnection() + "/" + child.getArtifactId() );
}
if ( StringUtils.isEmpty( childScm.getDeveloperConnection() )
&& !StringUtils.isEmpty( parentScm.getDeveloperConnection() ) )
if ( StringUtils.isEmpty( childScm.getDeveloperConnection() ) &&
!StringUtils.isEmpty( parentScm.getDeveloperConnection() ) )
{
childScm.setDeveloperConnection( parentScm.getDeveloperConnection() + "/" + child.getArtifactId() );
}
@ -426,11 +422,6 @@ private void assembleScmInheritance( Model child, Model parent )
{
childScm.setUrl( parentScm.getUrl() );
}
if ( parentScm.getBranches() != null )
{
childScm.getBranches().addAll( parentScm.getBranches() );
}
}
}

View File

@ -40,7 +40,10 @@ public class DefaultModelDefaultsInjector
public void injectDefaults( Model model )
{
injectDependencyDefaults( model.getDependencies(), model.getDependencyManagement() );
injectPluginDefaults( model.getPlugins(), model.getPluginManagement() );
if ( model.getBuild() != null )
{
injectPluginDefaults( model.getBuild().getPlugins(), model.getPluginManagement() );
}
}
private void injectPluginDefaults( List plugins, PluginManagement pluginManagement )
@ -52,11 +55,13 @@ private void injectPluginDefaults( List plugins, PluginManagement pluginManageme
// in other words, the project's plugins will probably be a subset
// of
// those specified in defaults.
// TODO: share with inheritence assembler
Map pluginMap = new TreeMap();
for ( Iterator it = plugins.iterator(); it.hasNext(); )
{
Plugin plugin = (Plugin) it.next();
pluginMap.put( plugin.getId(), plugin );
pluginMap.put( constructPluginKey( plugin ), plugin );
}
List managedPlugins = pluginManagement.getPlugins();
@ -64,7 +69,7 @@ private void injectPluginDefaults( List plugins, PluginManagement pluginManageme
for ( Iterator it = managedPlugins.iterator(); it.hasNext(); )
{
Plugin def = (Plugin) it.next();
String key = def.getId();
String key = constructPluginKey( def );
Plugin plugin = (Plugin) pluginMap.get( key );
if ( plugin != null )
@ -75,6 +80,11 @@ private void injectPluginDefaults( List plugins, PluginManagement pluginManageme
}
}
private static String constructPluginKey( Plugin plugin )
{
return plugin.getGroupId() + ":" + plugin.getArtifactId();
}
private void mergePluginWithDefaults( Plugin plugin, Plugin def )
{
if ( plugin.getVersion() == null && def.getVersion() != null )
@ -175,10 +185,6 @@ private void mergeDependencyWithDefaults( Dependency dep, Dependency def )
{
dep.setVersion( def.getVersion() );
}
Properties props = new Properties( def.getProperties() );
props.putAll( dep.getProperties() );
dep.setProperties( props );
}
}

View File

@ -1,24 +1,22 @@
package org.apache.maven.project.path;
/* ====================================================================
* Copyright 2001-2004 The Apache Software Foundation.
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.maven.model.Build;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Model;
import org.apache.maven.model.Resource;
@ -61,11 +59,11 @@ public void alignToBaseDirectory( Model model, File projectFile )
build.setSourceDirectory( new File( projectFile.getParentFile(), s ).getPath() );
}
s = stripBasedirToken( build.getUnitTestSourceDirectory() );
s = stripBasedirToken( build.getTestSourceDirectory() );
if ( requiresBaseDirectoryAlignment( s ) )
{
build.setUnitTestSourceDirectory( new File( projectFile.getParentFile(), s ).getPath() );
build.setTestSourceDirectory( new File( projectFile.getParentFile(), s ).getPath() );
}
List buildResources = build.getResources();
@ -82,7 +80,7 @@ public void alignToBaseDirectory( Model model, File projectFile )
}
}
List unitTestResources = build.getUnitTest().getResources();
List unitTestResources = build.getTestResources();
for ( Iterator i = unitTestResources.iterator(); i.hasNext(); )
{
@ -96,18 +94,18 @@ public void alignToBaseDirectory( Model model, File projectFile )
}
}
s = stripBasedirToken( build.getOutput() );
s = stripBasedirToken( build.getOutputDirectory() );
if ( requiresBaseDirectoryAlignment( s ) )
{
build.setOutput( new File( projectFile.getParentFile(), s ).getPath() );
build.setOutputDirectory( new File( projectFile.getParentFile(), s ).getPath() );
}
s = stripBasedirToken( build.getTestOutput() );
s = stripBasedirToken( build.getTestOutputDirectory() );
if ( requiresBaseDirectoryAlignment( s ) )
{
build.setTestOutput( new File( projectFile.getParentFile(), s ).getPath() );
build.setTestOutputDirectory( new File( projectFile.getParentFile(), s ).getPath() );
}
}
}
@ -146,5 +144,5 @@ private boolean requiresBaseDirectoryAlignment( String s )
return false;
}
}
}

View File

@ -40,7 +40,7 @@ public ModelValidationResult validate( Model model )
validateStringNotEmpty( "artifactId", result, model.getArtifactId() );
validateStringNotEmpty( "type", result, model.getType() );
validateStringNotEmpty( "packaging", result, model.getPackaging() );
validateStringNotEmpty( "version", result, model.getVersion() );
@ -65,19 +65,23 @@ public ModelValidationResult validate( Model model )
/**
* Asserts:
*
* <p/>
* <ul>
* <li><code>string.length != null</code>
* <li><code>string.length > 0</code>
* <li><code>string.length != null</code>
* <li><code>string.length > 0</code>
* </ul>
*/
private boolean validateStringNotEmpty( String fieldName, ModelValidationResult result, String string )
{
if ( !validateNotNull( fieldName, result, string ) )
{
return false;
}
if ( string.length() > 0 )
{
return true;
}
result.addMessage( "'" + fieldName + "' is empty." );
@ -86,15 +90,17 @@ private boolean validateStringNotEmpty( String fieldName, ModelValidationResult
/**
* Asserts:
*
* <p/>
* <ul>
* <li><code>string != null</code>
* <li><code>string != null</code>
* </ul>
*/
private boolean validateNotNull( String fieldName, ModelValidationResult result, Object object )
{
if ( object != null )
{
return true;
}
result.addMessage( "'" + fieldName + "' is missing." );

View File

@ -10,49 +10,25 @@
</repository>
</repositories>
<!--
<pluginRepositories>
<repository>
<id>pluginCentral</id>
<name>Maven Central Repository at ibiblio</name>
<url>http://www.ibiblio.org/maven</url>
</repository>
</pluginRepositories>
-->
<!-- Default plugins
<plugins>
<plugin>
<id></id>
</plugin>
</plugins>
-->
<build>
<!-- This all may just fold into plugin parameters -->
<directory>target</directory>
<output>target/classes</output>
<outputDirectory>target/classes</outputDirectory>
<finalName>${artifactId}-${version}</finalName>
<testOutput>target/test-classes</testOutput>
<testOutputDirectory>target/test-classes</testOutputDirectory>
<sourceDirectory>src/main/java</sourceDirectory>
<unitTestSourceDirectory>src/test/java</unitTestSourceDirectory>
<unitTest>
<includes>
<include>**/*Test.java</include>
</includes>
<excludes>
<exclude>**/*Abstract*.java</exclude>
</excludes>
<resources>
<resource>
<directory>src/test/resources</directory>
</resource>
</resources>
</unitTest>
<scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
<testSourceDirectory>src/test/java</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
</build>
</project>

View File

@ -2,11 +2,9 @@
import org.apache.maven.MavenTestCase;
import org.apache.maven.model.Build;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Resource;
import java.io.File;
import java.util.Iterator;
public class ProjectBaseDirectoryAlignmentTest
extends MavenTestCase
@ -25,7 +23,7 @@ public void testProjectDirectoryBaseDirectoryAlignment()
assertTrue( project.getBuild().getSourceDirectory().startsWith( getBasedir() ) );
assertTrue( project.getBuild().getUnitTestSourceDirectory().startsWith( getBasedir() ) );
assertTrue( project.getBuild().getTestSourceDirectory().startsWith( getBasedir() ) );
Build build = project.getBuild();

View File

@ -16,15 +16,15 @@
* limitations under the License.
*/
import java.io.File;
import java.util.List;
import java.util.Properties;
import org.apache.maven.MavenTestCase;
import org.apache.maven.model.Goal;
import org.apache.maven.model.Plugin;
import org.apache.maven.project.MavenProject;
import java.io.File;
import java.util.List;
import java.util.Properties;
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
@ -35,7 +35,7 @@ public class CanonicalProjectBuilderTest
public void testProjectBuilder()
throws Exception
{
File f = getTestFile( "src/test/resources/canonical-pom.xml" );
File f = getTestFile( "src/test/resources/canonical-pom.xml" );
MavenProject project = getProject( f );
@ -55,7 +55,9 @@ public void testProjectBuilder()
Plugin plugin = (Plugin) plugins.get( 0 );
assertEquals( "plexus", plugin.getId() );
assertEquals( "maven", plugin.getGroupId() );
assertEquals( "maven-plexus-plugin", plugin.getArtifactId() );
assertEquals( "1.0", plugin.getVersion() );

View File

@ -23,10 +23,10 @@
import org.apache.maven.model.Developer;
import org.apache.maven.model.DistributionManagement;
import org.apache.maven.model.MailingList;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.Repository;
import org.apache.maven.model.Resource;
import org.apache.maven.model.Site;
import org.apache.maven.model.UnitTest;
import org.apache.maven.project.MavenProject;
/**
@ -53,12 +53,8 @@ public static void testProjectFieldRetrieval( MavenProject project )
assertEquals( "2001", project.getInceptionYear() );
//assertEquals( "org.apache.maven", project.getPackage() );
assertEquals( "Description", project.getDescription() );
assertEquals( "shortDescription", project.getShortDescription() );
assertEquals( "http://maven.apache.org/", project.getUrl() );
// ----------------------------------------------------------------------
@ -67,15 +63,15 @@ public static void testProjectFieldRetrieval( MavenProject project )
DistributionManagement distributionManagement = project.getDistributionManagement();
assertNotNull( distributionManagement );
assertNotNull( distributionManagement );
Site site = distributionManagement.getSite();
assertNotNull( site );
assertNotNull( site );
Repository repository = distributionManagement.getRepository();
assertNotNull( repository );
assertNotNull( repository );
@ -87,8 +83,6 @@ public static void testProjectFieldRetrieval( MavenProject project )
assertEquals( "http://apache.org/", project.getOrganization().getUrl() );
assertEquals( "/images/jakarta-logo-blue.gif", project.getOrganization().getLogo() );
// ----------------------------------------------------------------------
// Repository
// ----------------------------------------------------------------------
@ -167,23 +161,17 @@ public static void testProjectFieldRetrieval( MavenProject project )
assertEquals( "/sourceDirectory", build.getSourceDirectory() );
assertEquals( "/unitTestSourceDirectory", build.getUnitTestSourceDirectory() );
assertEquals( "/unitTestSourceDirectory", build.getTestSourceDirectory() );
UnitTest unitTest = build.getUnitTest();
assertEquals( "**/*Test.java", (String) unitTest.getIncludes().get( 0 ) );
assertEquals( "**/RepositoryTest.java", (String) unitTest.getExcludes().get( 0 ) );
Resource resource0 = (Resource) unitTest.getResources().get( 0 );
Resource resource0 = (Resource) build.getTestResources().get( 0 );
//assertEquals( "${basedir}/src/test", resource0.getDirectory() );
assertEquals( "**/*.xml", (String) resource0.getIncludes().get( 0 ) );
assertEquals( "**/*.xml", resource0.getIncludes() );
Resource resource1 = (Resource) build.getResources().get( 0 );
assertEquals( "/src/conf", resource1.getDirectory() );
assertEquals( "*.xsd", (String) resource1.getIncludes().get( 0 ) );
assertEquals( "*.xsd", resource1.getIncludes() );
Resource resource2 = (Resource) build.getResources().get( 1 );
@ -191,14 +179,15 @@ public static void testProjectFieldRetrieval( MavenProject project )
assertEquals( "org/apache/maven/messages", resource2.getTargetPath() );
assertEquals( "messages*.properties", (String) resource2.getIncludes().get( 0 ) );
assertEquals( "messages*.properties", resource2.getIncludes() );
// ----------------------------------------------------------------------
// Reports
// ----------------------------------------------------------------------
assertEquals( "maven-jdepend-plugin", project.getReports().get( 0 ) );
assertEquals( "maven-jdepend-plugin", ( (Plugin) project.getReports().getPlugins().get( 0 ) ).getArtifactId() );
assertEquals( "maven-checkstyle-plugin", project.getReports().get( 1 ) );
assertEquals( "maven-checkstyle-plugin",
( (Plugin) project.getReports().getPlugins().get( 1 ) ).getArtifactId() );
}
}

View File

@ -1,7 +1,7 @@
package org.apache.maven.project.inheritance;
/*
* Copyright 2001-2004 The Apache Software Foundation.
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -21,9 +21,7 @@
import org.apache.maven.model.Model;
import org.apache.maven.model.Resource;
import org.apache.maven.model.Scm;
import org.apache.maven.model.UnitTest;
import java.util.Arrays;
import java.util.List;
/**
@ -45,7 +43,7 @@ public void testShouldOverrideUnitTestExcludesOnly()
Build parentBuild = new Build();
parentBuild.setSourceDirectory( "src/main/java" );
parentBuild.setUnitTestSourceDirectory( "src/test/java" );
parentBuild.setTestSourceDirectory( "src/test/java" );
Resource parentResource = new Resource();
@ -53,63 +51,54 @@ public void testShouldOverrideUnitTestExcludesOnly()
parentBuild.addResource( parentResource );
UnitTest parentUT = new UnitTest();
parentUT.setIncludes( Arrays.asList( new String[] { "**/*Test.java" } ) );
parentUT.setExcludes( Arrays.asList( new String[] { "**/*Abstract*.java" } ) );
Resource parentUTResource = new Resource();
parentUTResource.setDirectory( "src/test/resources" );
parentUT.addResource( parentUTResource );
parentBuild.addTestResource( parentUTResource );
parentBuild.setUnitTest( parentUT );
parent.setBuild( parentBuild );
Model child = new Model();
child.setType( "plugin" );
child.setPackaging( "plugin" );
Build childBuild = new Build();
UnitTest childUT = new UnitTest();
parentUT.setExcludes( Arrays.asList( new String[] { "**/*Abstract*.java", "**/*AspectTest.java" } ) );
childBuild.setUnitTest( childUT );
child.setBuild( childBuild );
assembler.assembleModelInheritance( child, parent );
assertEquals( "source directory should be from parent", "src/main/java", child.getBuild().getSourceDirectory() );
assertEquals( "unit test source directory should be from parent", "src/test/java", child.getBuild()
.getUnitTestSourceDirectory() );
assertEquals( "unit test source directory should be from parent", "src/test/java",
child.getBuild().getTestSourceDirectory() );
List childExcludesTest = child.getBuild().getUnitTest().getExcludes();
assertTrue( "unit test excludes should have **/*AspectTest.java", childExcludesTest
.contains( "**/*AspectTest.java" ) );
assertTrue( "unit test excludes should have **/*Abstract*.java", childExcludesTest
.contains( "**/*Abstract*.java" ) );
// TODO: test inheritence/super pom?
// List childExcludesTest = child.getBuild().getUnitTest().getExcludes();
//
// assertTrue( "unit test excludes should have **/*AspectTest.java", childExcludesTest
// .contains( "**/*AspectTest.java" ) );
// assertTrue( "unit test excludes should have **/*Abstract*.java", childExcludesTest
// .contains( "**/*Abstract*.java" ) );
//
List resources = child.getBuild().getResources();
assertEquals( "build resources inherited from parent should be of size 1", 1, resources.size() );
assertEquals( "first resource should have dir == src/main/resources", "src/main/resources",
((Resource) resources.get( 0 )).getDirectory() );
( (Resource) resources.get( 0 ) ).getDirectory() );
List utResources = child.getBuild().getUnitTest().getResources();
List utResources = child.getBuild().getTestResources();
assertEquals( "UT resources inherited from parent should be of size 1", 1, utResources.size() );
assertEquals( "first UT resource should have dir == src/test/resources", "src/test/resources",
((Resource) utResources.get( 0 )).getDirectory() );
( (Resource) utResources.get( 0 ) ).getDirectory() );
assertEquals( "plugin", child.getType() );
assertEquals( "jar", parent.getType() );
assertEquals( "plugin", child.getPackaging() );
assertEquals( "jar", parent.getPackaging() );
}
/**
* <pre>
* root
* |--artifact1
* | |
@ -118,7 +107,7 @@ public void testShouldOverrideUnitTestExcludesOnly()
* |--artifact2 (in another directory called a2 so it has it's own scm section)
* |
* |--artifact2-1
*
* </pre>
*/
public void testScmInheritance()
throws Exception
@ -130,7 +119,8 @@ public void testScmInheritance()
Model artifact1_1 = makeScmModel( "artifact1-1" );
Model artifact2 = makeScmModel( "artifact2", "scm:foo:/scm-root/yay-artifact2", "scm:foo:/scm-dev-root/yay-artifact2", null );
Model artifact2 = makeScmModel( "artifact2", "scm:foo:/scm-root/yay-artifact2",
"scm:foo:/scm-dev-root/yay-artifact2", null );
Model artifact2_1 = makeScmModel( "artifact2-1" );
@ -145,13 +135,15 @@ public void testScmInheritance()
// --- -- -
assertConnection( "scm:foo:/scm-root/artifact1", "scm:foo:/scm-dev-root/artifact1", artifact1 );
assertConnection( "scm:foo:/scm-root/artifact1", "scm:foo:/scm-dev-root/artifact1", artifact1 );
assertConnection( "scm:foo:/scm-root/artifact1/artifact1-1", "scm:foo:/scm-dev-root/artifact1/artifact1-1", artifact1_1 );
assertConnection( "scm:foo:/scm-root/artifact1/artifact1-1", "scm:foo:/scm-dev-root/artifact1/artifact1-1",
artifact1_1 );
assertConnection( "scm:foo:/scm-root/yay-artifact2", "scm:foo:/scm-dev-root/yay-artifact2", artifact2 );
assertConnection( "scm:foo:/scm-root/yay-artifact2/artifact2-1", "scm:foo:/scm-dev-root/yay-artifact2/artifact2-1", artifact2_1 );
assertConnection( "scm:foo:/scm-root/yay-artifact2/artifact2-1",
"scm:foo:/scm-dev-root/yay-artifact2/artifact2-1", artifact2_1 );
}
public void testScmInheritanceWhereParentHasConnectionAndTheChildDoesnt()
@ -248,10 +240,6 @@ public void assertScm( String connection, String developerConnection, String url
assertEquals( developerConnection, scm.getDeveloperConnection() );
assertEquals( url, scm.getUrl() );
assertNotNull( scm.getBranches() );
assertEquals( 0, scm.getBranches().size() );
}
private Model makeScmModel( String artifactId )

View File

@ -22,7 +22,6 @@
import org.apache.maven.model.Model;
import java.util.List;
import java.util.Properties;
/**
* @author jdcasey
@ -142,11 +141,6 @@ public void testShouldMergeDefaultPropertiesWhenDependencyDoesntSupplyProperties
def.setGroupId( dep.getGroupId() );
def.setArtifactId( dep.getArtifactId() );
Properties props = new Properties();
props.setProperty( "test", "value" );
def.setProperties( props );
DependencyManagement depMgmt = new DependencyManagement();
depMgmt.addDependency( def );
@ -157,10 +151,6 @@ public void testShouldMergeDefaultPropertiesWhenDependencyDoesntSupplyProperties
List deps = model.getDependencies();
assertEquals( 1, deps.size() );
Dependency result = (Dependency) deps.get( 0 );
assertEquals( "value", result.getProperties().getProperty( "test" ) );
}
public void testShouldNotMergeDefaultPropertiesWhenDependencySuppliesProperties()
@ -172,22 +162,12 @@ public void testShouldNotMergeDefaultPropertiesWhenDependencySuppliesProperties(
dep.setArtifactId( "myArtifact" );
dep.setVersion( "1.0.1" );
Properties props = new Properties();
props.setProperty( "test", "value" );
dep.setProperties( props );
model.addDependency( dep );
Dependency def = new Dependency();
def.setGroupId( dep.getGroupId() );
def.setArtifactId( dep.getArtifactId() );
Properties props2 = new Properties();
props2.setProperty( "test", "value2" );
def.setProperties( props2 );
DependencyManagement depMgmt = new DependencyManagement();
depMgmt.addDependency( def );
@ -198,9 +178,6 @@ public void testShouldNotMergeDefaultPropertiesWhenDependencySuppliesProperties(
List deps = model.getDependencies();
assertEquals( 1, deps.size() );
Dependency result = (Dependency) deps.get( 0 );
assertEquals( "value", result.getProperties().getProperty( "test" ) );
}
public void testShouldMergeDefaultScopeWhenDependencyDoesntSupplyScope()

View File

@ -36,9 +36,9 @@ public void testMissingGroupId()
throws Exception
{
ModelValidationResult result = validate( "missing-groupId-pom.xml" );
assertEquals( 1, result.getMessageCount() );
assertEquals( "'groupId' is missing.", result.getMessage( 0 ) );
}
@ -46,17 +46,17 @@ public void testMissingType()
throws Exception
{
ModelValidationResult result = validate( "missing-type-pom.xml" );
assertEquals( 1, result.getMessageCount() );
assertEquals( "'type' is empty.", result.getMessage( 0 ) );
assertEquals( "'packaging' is empty.", result.getMessage( 0 ) );
}
public void testMissingVersion()
throws Exception
{
ModelValidationResult result = validate( "missing-version-pom.xml" );
assertEquals( 1, result.getMessageCount() );
assertEquals( "'version' is missing.", result.getMessage( 0 ) );
@ -66,7 +66,7 @@ public void testMissingAll()
throws Exception
{
ModelValidationResult result = validate( "missing-1-pom.xml" );
assertEquals( 3, result.getMessageCount() );
assertEquals( "'groupId' is missing.", result.getMessage( 0 ) );

View File

@ -1,28 +1,30 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core</artifactId>
<name>Maven</name>
<version>2.0-SNAPSHOT</version>
<plugins>
<plugin>
<id>plexus</id>
<version>1.0</version>
<configuration>
<plexusConfiguration>src/conf/plexus.conf</plexusConfiguration>
<plexusConfigurationPropertiesFile>src/conf/plexus.properties</plexusConfigurationPropertiesFile>
<plexusApplicationName>Continuum</plexusApplicationName>
</configuration>
<goals>
<goal>
<id>plexus:runtime</id>
<configuration>
<plexusApplicationName>ContinuumPro</plexusApplicationName>
</configuration>
</goal>
</goals>
</plugin>
</plugins>
</project>
<build>
<plugins>
<plugin>
<artifactId>maven-plexus-plugin</artifactId>
<version>1.0</version>
<configuration>
<plexusConfiguration>src/conf/plexus.conf</plexusConfiguration>
<plexusConfigurationPropertiesFile>src/conf/plexus.properties</plexusConfigurationPropertiesFile>
<plexusApplicationName>Continuum</plexusApplicationName>
</configuration>
<goals>
<goal>
<id>plexus:runtime</id>
<configuration>
<plexusApplicationName>ContinuumPro</plexusApplicationName>
</configuration>
</goal>
</goals>
</plugin>
</plugins>
</build>
</model>

View File

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>p0</artifactId>
<packaging>jar</packaging>
<name>p0</name>
<version>1.0</version>
<organization>
<name>Codehaus</name>
</organization>
</project>
</model>

View File

@ -1,17 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>p0</artifactId>
<groupId>maven</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>p1</artifactId>
<packaging>jar</packaging>
<name>p1</name>
<version>1.0</version>
<scm>
<url>scm-url</url>
</scm>
</project>
</model>

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>p1</artifactId>
<groupId>maven</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>p2</artifactId>
<packaging>jar</packaging>
<name>p2</name>
<version>1.0</version>
<mailingLists>
@ -15,5 +15,4 @@
<name>mailing-list</name>
</mailingList>
</mailingLists>
</project>
</model>

View File

@ -1,15 +1,14 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>p2</artifactId>
<groupId>maven</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>p3</artifactId>
<packaging>jar</packaging>
<name>p3</name>
<version>1.0</version>
<inceptionYear>2000</inceptionYear>
</project>
</model>

View File

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>p3</artifactId>
<groupId>maven</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>p4</artifactId>
<packaging>jar</packaging>
<name>p4</name>
<version>1.0</version>
</project>
</model>

View File

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>p0</artifactId>
<packaging>jar</packaging>
<name>p0</name>
<version>1.0</version>
<organization>
<name>p0-org</name>
</organization>
</project>
</model>

View File

@ -1,17 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>p0</artifactId>
<groupId>maven</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>p1</artifactId>
<packaging>jar</packaging>
<name>p1</name>
<version>1.0</version>
<organization>
<name>p1-org</name>
</organization>
</project>
</model>

View File

@ -1,17 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>p1</artifactId>
<groupId>maven</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>p2</artifactId>
<packaging>jar</packaging>
<name>p2</name>
<version>1.0</version>
<organization>
<name>p2-org</name>
</organization>
</project>
</model>

View File

@ -1,17 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>p2</artifactId>
<groupId>maven</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>p3</artifactId>
<packaging>jar</packaging>
<name>p3</name>
<version>1.0</version>
<organization>
<name>p3-org</name>
</organization>
</project>
</model>

View File

@ -1,17 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>p3</artifactId>
<groupId>maven</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>p4</artifactId>
<packaging>jar</packaging>
<name>p4</name>
<version>1.0</version>
<organization>
<name>p4-org</name>
</organization>
</project>
</model>

View File

@ -1,9 +1,9 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven-test</groupId>
<artifactId>maven-test-a</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<repositories>
<repository>
<id>central</id>
@ -11,12 +11,13 @@
<url>file://dummy</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>maven-test</groupId>
<artifactId>maven-test-b</artifactId>
<version>1.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,22 +1,23 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven-test</groupId>
<artifactId>maven-test-b</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>maven-test</groupId>
<artifactId>maven-test-c</artifactId>
<version>1.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven-test</groupId>
<artifactId>maven-test-d</artifactId>
<version>1.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,13 +1,16 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven-test</groupId>
<artifactId>maven-test-c</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>maven-test</groupId>
<artifactId>maven-test-d</artifactId>
<version>1.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,6 +1,7 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven-test</groupId>
<artifactId>maven-test-d</artifactId>
<packaging>jar</packaging>
<version>1.1</version>
</project>
</model>

View File

@ -1,6 +1,7 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven-test</groupId>
<artifactId>maven-test-d</artifactId>
<packaging>jar</packaging>
<version>1.1</version>
</project>
</model>

View File

@ -1,8 +1,7 @@
<project>
<model>
<groupId>snapshot-test</groupId>
<artifactId>maven-test-snapshot-resolving</artifactId>
<currentVersion>1.0</currentVersion>
<packaging>jar</packaging>
<repositories>
<repository>
<id>central</id>
@ -10,46 +9,41 @@
<url>file://dummy</url>
</repository>
</repositories>
<dependencies>
<!-- newer version of this snapshot is in remote repository -->
<dependency>
<groupId>snapshot-test</groupId>
<artifactId>maven-snapshot-a</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- newer version of this snapshot is in local repository -->
<dependency>
<groupId>snapshot-test</groupId>
<artifactId>maven-snapshot-b</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- this snapshot is missing in local repository but can be found in remote repository -->
<dependency>
<groupId>snapshot-test</groupId>
<artifactId>maven-snapshot-c</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- this snapshot is neither in local repository nor in any of remote repositories -->
<dependency>
<groupId>snapshot-test</groupId>
<artifactId>maven-snapshot-d</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- this snapshot is in the local repository but it was removed from all remote repositories -->
<dependency>
<groupId>snapshot-test</groupId>
<artifactId>maven-snapshot-e</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,27 +1,28 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-core</artifactId>
<packaging>jar</packaging>
<name>Maven</name>
<version>2.0-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<inceptionYear>2001</inceptionYear>
<package>org.apache.maven</package>
<logo>/images/maven.gif</logo>
<scm>
<connection>scm-connection</connection>
</scm>
<dependencies>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-model</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
<scm>
<connection>scm-connection</connection>
</scm>
</model>

View File

@ -1,4 +1,4 @@
<project>
<model>
<extend>project-which-needs-directory-alignment.xml</extend>
@ -11,4 +11,4 @@
<groupId>maven</groupId>
<artifactId>maven-foo</artifactId>
<version>1.0</version>
</project>
</model>

View File

@ -1,32 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>project-which-needs-directory-alignment</artifactId>
<name>Maven</name>
<version>1.0-beta-9</version>
<inceptionYear>2001</inceptionYear>
<package>org.apache.maven</package>
<description>Description</description>
<shortDescription>shortDescription</shortDescription>
<url>http://maven.apache.org/</url>
<issueTrackingUrl>issueTrackingUrl</issueTrackingUrl>
<siteAddress>maven.apache.org</siteAddress>
<siteDirectory>/www/maven.apache.org/</siteDirectory>
<distributionDirectory>/www/maven.apache.org/builds/</distributionDirectory>
<organization>
<name>Apache Software Foundation</name>
<url>http://apache.org/</url>
<logo>/images/jakarta-logo-blue.gif</logo>
</organization>
<repository>
<scm>
<connection>anon-connection</connection>
<developerConnection>developer-connection</developerConnection>
<url>repository-url</url>
</repository>
</scm>
<mailingLists>
<mailingList>
@ -63,14 +57,12 @@
<groupId>g1</groupId>
<artifactId>d1</artifactId>
<version>1.0</version>
<url>d1-url</url>
</dependency>
<dependency>
<groupId>g2</groupId>
<artifactId>d2</artifactId>
<version>2.0</version>
<url>d2-url</url>
</dependency>
<dependency>
@ -86,65 +78,42 @@
<groupId>g3</groupId>
<artifactId>d3</artifactId>
<version>3.0</version>
<url>d3-url</url>
</dependency>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<nagEmailAddress>jason@maven.org</nagEmailAddress>
<sourceDirectory>sourceDirectory</sourceDirectory>
<unitTestSourceDirectory>unitTestSourceDirectory</unitTestSourceDirectory>
<unitTest>
<includes>
<include>**/*Test.java</include>
</includes>
<excludes>
<exclude>**/RepositoryTest.java</exclude>
<exclude>**/JAXPTest.java</exclude>
</excludes>
<resources>
<resource>
<directory>src/test</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</unitTest>
<testSourceDirectory>unitTestSourceDirectory</testSourceDirectory>
<resources>
<resource>
<directory>src/conf</directory>
<includes>
<include>*.xsd</include>
<include>*.dtd</include>
<include>*.mod</include>
<include>log4j.properties</include>
<include>driver.jelly</include>
<include>driver.properties</include>
</includes>
</resource>
<resource>
<directory>src/messages</directory>
<targetPath>org/apache/maven/messages</targetPath>
<includes>
<include>messages*.properties</include>
</includes>
<directory>src/test</directory>
<includes>**/*.xml</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/conf</directory>
<includes>*.xsd,*.dtd,*.mod,log4j.properties,driver.jelly,driver.properties</includes>
</testResource>
<testResource>
<directory>src/messages</directory>
<targetPath>org/apache/maven/messages</targetPath>
<includes>messages*.properties</includes>
</testResource>
</testResources>
</build>
<reports>
<report>maven-jdepend-plugin</report>
<report>maven-checkstyle-plugin</report>
<report>maven-changelog-plugin</report>
<report>maven-file-activity-plugin</report>
<report>maven-developer-activity-plugin</report>
<report>maven-javadoc-plugin</report>
<report>maven-jxr-plugin</report>
<report>maven-junit-report-plugin</report>
<report>maven-tasklist-plugin</report>
<report>maven-jellydoc-plugin</report>
<plugins>
<plugin>
<artifactId>maven-jdepend-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
</plugins>
</reports>
</project>
</model>

View File

@ -1,4 +1,4 @@
<project>
<model>
<extend>../project-which-needs-directory-alignment.xml</extend>
@ -7,4 +7,4 @@
<artifactId>project-which-needs-directory-alignment</artifactId>
<version>1.0-beta-9</version>
</parent>
</project>
</model>

View File

@ -1,9 +1,9 @@
<project>
<model>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<name>Babar</name>
<version>4.5</version>
<!-- Build element should be inherited from the super model -->
</project>
</model>

View File

@ -1,4 +1,4 @@
<project>
<model>
<extend>${basedir}/bogus.xml</extend>
@ -7,4 +7,4 @@
<artifactId>bogus</artifactId>
<version>1.0-beta-9</version>
</parent>
</project>
</model>

View File

@ -1,4 +1,4 @@
<project>
<model>
<extend>project.xml</extend>
@ -11,4 +11,4 @@
<artifactId>child-artifact</artifactId>
<groupId>maven</groupId>
<version>1.0-beta-9</version>
</project>
</model>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<model>
<extend>project.xml</extend>
<parent>
<groupId>maven</groupId>
@ -28,7 +28,7 @@
<id>childSiteDistributionId</id>
<name>childSiteDistributionName</name>
<url>childSiteDistributionUrl</url>
</site>
</site>
</distributionManagement>
<organization>
@ -146,4 +146,4 @@
<report>maven-jellydoc-plugin</report>
</reports>
</project>
</model>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<model>
<modelVersion>3</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-project-test</artifactId>
@ -22,7 +22,7 @@
<id>siteDistributionId</id>
<name>siteDistributionName</name>
<url>siteDistributionUrl</url>
</site>
</site>
</distributionManagement>
<organization>
@ -140,4 +140,4 @@
<report>maven-jellydoc-plugin</report>
</reports>
</project>
</model>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<model>
<groupId>maven</groupId>
<artifactId>maven-project-test</artifactId>
<name>Maven</name>
@ -36,4 +36,4 @@
</dependencies>
</project>
</model>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<model>
<groupId>maven-test</groupId>
<artifactId>scope-compile</artifactId>
<version>1.0</version>
@ -35,4 +35,4 @@
</dependencies>
</project>
</model>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<model>
<groupId>maven-test</groupId>
<artifactId>scope-default</artifactId>
<version>1.0</version>
@ -35,4 +35,4 @@
</dependencies>
</project>
</model>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<model>
<groupId>maven-test</groupId>
<artifactId>scope-runtime</artifactId>
<version>1.0</version>
@ -35,4 +35,4 @@
</dependencies>
</project>
</model>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<model>
<groupId>maven-test</groupId>
<artifactId>scope-test</artifactId>
<version>1.0</version>
@ -35,4 +35,4 @@
</dependencies>
</project>
</model>

View File

@ -1,19 +1,21 @@
<project>
<model>
<groupId>maven-test</groupId>
<artifactId>maven-test-a</artifactId>
<currentVersion>1.0</currentVersion>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>maven-test</groupId>
<artifactId>maven-test-b</artifactId>
<version>1.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- pom for this dependency is missing -->
<dependency>
<groupId>maven-test</groupId>
<artifactId>maven-test-z</artifactId>
<version>1.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

View File

@ -1,2 +1,2 @@
<project>
</project>
<model>
</model>

View File

@ -1,6 +1,6 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>foo</groupId>
<version>99.44</version>
<type>bleh</type>
</project>
<packaging>bleh</packaging>
</model>

View File

@ -1,6 +1,6 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<artifactId>bar</artifactId>
<version>99.44</version>
<type>bleh</type>
</project>
<packaging>bleh</packaging>
</model>

View File

@ -1,6 +1,6 @@
<project>
<model>
<groupId>foo</groupId>
<artifactId>foo</artifactId>
<version>99.44</version>
<type>bleh</type>
</project>
<packaging>bleh</packaging>
</model>

View File

@ -1,7 +1,7 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>99.44</version>
<type></type>
</project>
<packaging></packaging>
</model>

View File

@ -1,6 +1,6 @@
<project>
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<type>bleh</type>
</project>
<packaging>bleh</packaging>
</model>

View File

@ -1,16 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-component</artifactId>
<groupId>maven</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<name>Maven MBoot</name>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-mboot</artifactId>
<packaging>jar</packaging>
<name>Maven MBoot</name>
<version>2.0-SNAPSHOT</version>
<description>Tool used to bootstrap m2.</description>
<shortDescription>Tool used to bootstrap m2.</shortDescription>
</project>
</model>

View File

@ -1,25 +1,21 @@
import compile.CompilerConfiguration;
import compile.JavacCompiler;
import download.ArtifactDownloader;
import jar.JarMojo;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
import test.SurefirePlugin;
import util.Commandline;
import util.FileUtils;
import util.IsolatedClassLoader;
import util.Os;
import compile.CompilerConfiguration;
import compile.JavacCompiler;
import download.ArtifactDownloader;
import jar.JarMojo;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@ -41,91 +37,71 @@ public class MBoot
// These are the bootstrap processes' dependencies
// ----------------------------------------------------------------------
String[] bootstrapDeps = new String[] {
"junit/jars/junit-3.8.1.jar",
"modello/jars/modello-core-1.0-SNAPSHOT.jar",
"modello/jars/modello-xdoc-plugin-1.0-SNAPSHOT.jar",
"modello/jars/modello-xml-plugin-1.0-SNAPSHOT.jar",
"modello/jars/modello-xpp3-plugin-1.0-SNAPSHOT.jar",
"plexus/jars/plexus-utils-1.0-alpha-2-SNAPSHOT.jar",
"surefire/jars/surefire-booter-1.2-SNAPSHOT.jar",
"surefire/jars/surefire-1.2-SNAPSHOT.jar",
"qdox/jars/qdox-1.2.jar" };
String[] bootstrapDeps = new String[]{"junit/jars/junit-3.8.1.jar", "modello/jars/modello-core-1.0-SNAPSHOT.jar",
"modello/jars/modello-xdoc-plugin-1.0-SNAPSHOT.jar",
"modello/jars/modello-xml-plugin-1.0-SNAPSHOT.jar",
"modello/jars/modello-xpp3-plugin-1.0-SNAPSHOT.jar",
"plexus/jars/plexus-utils-1.0-alpha-2-SNAPSHOT.jar",
"surefire/jars/surefire-booter-1.2-SNAPSHOT.jar",
"surefire/jars/surefire-1.2-SNAPSHOT.jar", "qdox/jars/qdox-1.2.jar"};
// ----------------------------------------------------------------------
// These are plexus' runtime dependencies
// ----------------------------------------------------------------------
String[] plexusDeps = new String[] {
"classworlds/jars/classworlds-1.1-alpha-1.jar",
"plexus/jars/plexus-container-default-1.0-alpha-2-SNAPSHOT.jar" };
String[] plexusDeps = new String[]{"classworlds/jars/classworlds-1.1-alpha-1.jar",
"plexus/jars/plexus-container-default-1.0-alpha-2-SNAPSHOT.jar"};
String[] pluginGeneratorDeps = new String[] {
"plexus/jars/plexus-container-default-1.0-alpha-2-SNAPSHOT.jar",
"maven/jars/maven-core-2.0-SNAPSHOT.jar",
"maven/jars/maven-model-2.0-SNAPSHOT.jar",
"maven/jars/maven-plugin-2.0-SNAPSHOT.jar",
"maven/jars/maven-plugin-tools-api-2.0-SNAPSHOT.jar",
"maven/jars/maven-plugin-tools-java-2.0-SNAPSHOT.jar",
"maven/jars/maven-plugin-tools-pluggy-2.0-SNAPSHOT.jar" };
String[] pluginGeneratorDeps = new String[]{"plexus/jars/plexus-container-default-1.0-alpha-2-SNAPSHOT.jar",
"maven/jars/maven-core-2.0-SNAPSHOT.jar",
"maven/jars/maven-model-2.0-SNAPSHOT.jar",
"maven/jars/maven-plugin-2.0-SNAPSHOT.jar",
"maven/jars/maven-plugin-tools-api-2.0-SNAPSHOT.jar",
"maven/jars/maven-plugin-tools-java-2.0-SNAPSHOT.jar",
"maven/jars/maven-plugin-tools-pluggy-2.0-SNAPSHOT.jar"};
// ----------------------------------------------------------------------
// These are modello's runtime dependencies
// ----------------------------------------------------------------------
String[] modelloDeps = new String[] {
"classworlds/jars/classworlds-1.1-alpha-1.jar",
//"plexus/jars/plexus-container-api-1.0-alpha-1-SNAPSHOT.jar",
"plexus/jars/plexus-container-default-1.0-alpha-2-SNAPSHOT.jar",
//"plexus/jars/plexus-utils-1.0-alpha-1-SNAPSHOT.jar",
"modello/jars/modello-core-1.0-SNAPSHOT.jar",
"modello/jars/modello-xdoc-plugin-1.0-SNAPSHOT.jar",
"modello/jars/modello-xml-plugin-1.0-SNAPSHOT.jar",
"modello/jars/modello-xpp3-plugin-1.0-SNAPSHOT.jar" };
String[] modelloDeps = new String[]{"classworlds/jars/classworlds-1.1-alpha-1.jar",
//"plexus/jars/plexus-container-api-1.0-alpha-1-SNAPSHOT.jar",
"plexus/jars/plexus-container-default-1.0-alpha-2-SNAPSHOT.jar",
//"plexus/jars/plexus-utils-1.0-alpha-1-SNAPSHOT.jar",
"modello/jars/modello-core-1.0-SNAPSHOT.jar",
"modello/jars/modello-xdoc-plugin-1.0-SNAPSHOT.jar",
"modello/jars/modello-xml-plugin-1.0-SNAPSHOT.jar",
"modello/jars/modello-xpp3-plugin-1.0-SNAPSHOT.jar"};
String[] builds = new String[] {
"maven-model",
"maven-user-model",
"maven-monitor",
"maven-plugin",
"maven-artifact",
"maven-script/maven-script-marmalade",
"maven-core",
"maven-archiver",
"maven-plugin-tools/maven-plugin-tools-api",
"maven-plugin-tools/maven-plugin-tools-java",
"maven-plugin-tools/maven-plugin-tools-pluggy",
"maven-plugin-tools/maven-plugin-tools-marmalade",
"maven-core-it-verifier" };
String[] builds = new String[]{"maven-model", "maven-user-model", "maven-monitor", "maven-plugin",
"maven-artifact", "maven-script/maven-script-marmalade", "maven-core",
"maven-archiver", "maven-plugin-tools/maven-plugin-tools-api",
"maven-plugin-tools/maven-plugin-tools-java",
"maven-plugin-tools/maven-plugin-tools-pluggy",
"maven-plugin-tools/maven-plugin-tools-marmalade", "maven-core-it-verifier"};
String[] pluginBuilds = new String[]{"maven-plugins/maven-clean-plugin", "maven-plugins/maven-compiler-plugin",
"maven-plugins/maven-deploy-plugin", "maven-plugins/maven-install-plugin",
"maven-plugins/maven-jar-plugin", "maven-plugins/maven-plugin-plugin",
"maven-plugins/maven-pom-plugin", "maven-plugins/maven-resources-plugin",
"maven-plugins/maven-surefire-plugin", "maven-plugins/maven-war-plugin"};
String[] pluginBuilds = new String[] {
"maven-plugins/maven-clean-plugin",
"maven-plugins/maven-compiler-plugin",
"maven-plugins/maven-deploy-plugin",
"maven-plugins/maven-install-plugin",
"maven-plugins/maven-jar-plugin",
"maven-plugins/maven-plugin-plugin",
"maven-plugins/maven-pom-plugin",
"maven-plugins/maven-resources-plugin",
"maven-plugins/maven-surefire-plugin",
"maven-plugins/maven-war-plugin" };
private static final Map MODELLO_TARGET_VERSIONS;
private static final Map MODELLO_MODEL_FILES;
static
{
Map targetVersions = new TreeMap();
targetVersions.put( "maven-model", "4.0.0" );
targetVersions.put( "maven-user-model", "1.0.0" );
MODELLO_TARGET_VERSIONS = Collections.unmodifiableMap( targetVersions );
Map modelFiles = new TreeMap();
modelFiles.put( "maven-model", "maven.mdo" );
modelFiles.put( "maven-user-model", "maven-user.mdo" );
MODELLO_MODEL_FILES = Collections.unmodifiableMap( modelFiles );
}
@ -158,7 +134,7 @@ public class MBoot
private ArtifactDownloader downloader;
private ModelReader reader;
private String repoLocal;
private List mbootDependencies;
@ -171,7 +147,8 @@ public class MBoot
//
// ----------------------------------------------------------------------
public static void main( String[] args ) throws Exception
public static void main( String[] args )
throws Exception
{
try
{
@ -198,7 +175,8 @@ else if ( target instanceof Exception )
}
}
public void run( String[] args ) throws Exception
public void run( String[] args )
throws Exception
{
reader = new ModelReader();
@ -213,7 +191,7 @@ public void run( String[] args ) throws Exception
String userHome = System.getProperty( "user.home" );
userModelReader.parse( new File( userHome, ".m2/user.xml" ) );
MavenProfile activeProfile = userModelReader.getActiveMavenProfile();
mavenRepoLocal = new File( activeProfile.getLocalRepo() ).getAbsolutePath();
@ -226,21 +204,20 @@ public void run( String[] args ) throws Exception
if ( mavenRepoLocal == null )
{
System.out.println( "You must have a ~/.m2/user.xml file and must contain at least the following information:\n" );
System.out.println(
"You must have a ~/.m2/user.xml file and must contain at least the following information:\n" );
System.out.println( "<userModel>\n " +
"<mavenProfiles>\n " +
"<mavenProfile>\n " +
"<id>someId</id>\n " +
"<localRepository>/path/to/your/repository</localRepository>\n " +
"</mavenProfile>\n " +
"</mavenProfiles>\n " +
"<defaultProfiles>\n " +
"<mavenProfileId>someId</mavenProfileId>\n " +
"</defaultProfiles>\n" +
"</userModel>\n" );
System.out.println("where \'someId\' is just an id for matching within the file.");
System.out.println(
"<userModel>\n " + "<mavenProfiles>\n " + "<mavenProfile>\n " + "<id>someId</id>\n " +
"<localRepository>/path/to/your/repository</localRepository>\n " +
"</mavenProfile>\n " +
"</mavenProfiles>\n " +
"<defaultProfiles>\n " +
"<mavenProfileId>someId</mavenProfileId>\n " +
"</defaultProfiles>\n" +
"</userModel>\n" );
System.out.println( "where \'someId\' is just an id for matching within the file." );
System.out.println();
@ -415,10 +392,8 @@ public void run( String[] args ) throws Exception
{
Dependency d = (Dependency) i.next();
if ( d.getArtifactId().equals( "classworlds" ) ||
//d.artifactId.equals( "plexus-container-api" ) ||
d.artifactId.equals( "plexus-container-default" ) ||
//d.artifactId.equals( "plexus-utils" ) ||
if ( d.getArtifactId().equals( "classworlds" ) || //d.artifactId.equals( "plexus-container-api" ) ||
d.artifactId.equals( "plexus-container-default" ) || //d.artifactId.equals( "plexus-utils" ) ||
d.artifactId.equals( "junit" ) )
{
continue;
@ -470,7 +445,8 @@ private void stats( Date fullStart, Date fullStop )
System.out.println( "Finished at: " + fullStop );
}
public void buildProject( String basedir, String projectId ) throws Exception
public void buildProject( String basedir, String projectId )
throws Exception
{
System.out.println( "Building project in " + basedir );
@ -520,26 +496,26 @@ public void buildProject( String basedir, String projectId ) throws Exception
// ----------------------------------------------------------------------
File base = new File( basedir );
String modelFileName = (String)MODELLO_MODEL_FILES.get( projectId );
String modelFileName = (String) MODELLO_MODEL_FILES.get( projectId );
File model = null;
if(modelFileName != null && modelFileName.trim().length() > 0)
if ( modelFileName != null && modelFileName.trim().length() > 0 )
{
model = new File(base, modelFileName);
model = new File( base, modelFileName );
}
if ( model != null && model.exists() )
{
System.out.println( "Model exists!" );
String modelVersion = (String)MODELLO_TARGET_VERSIONS.get( projectId );
if(modelVersion == null || modelVersion.trim().length() < 1)
String modelVersion = (String) MODELLO_TARGET_VERSIONS.get( projectId );
if ( modelVersion == null || modelVersion.trim().length() < 1 )
{
System.out.println("No model version configured. Using \'1.0.0\'...");
System.out.println( "No model version configured. Using \'1.0.0\'..." );
modelVersion = "1.0.0";
}
File generatedSourcesDirectory = new File( basedir, GENERATED_SOURCES );
if ( !generatedSourcesDirectory.exists() )
@ -553,9 +529,10 @@ public void buildProject( String basedir, String projectId ) throws Exception
{
generatedDocsDirectory.mkdirs();
}
System.out.println("Generating model bindings for version \'" + modelVersion + "\' in project: " + projectId);
System.out.println(
"Generating model bindings for version \'" + modelVersion + "\' in project: " + projectId );
generateSources( model.getAbsolutePath(), "java", generatedSources, modelVersion, "false" );
//generateSources( model.getAbsolutePath(), "java",
@ -666,7 +643,8 @@ public void buildProject( String basedir, String projectId ) throws Exception
IsolatedClassLoader cl;
private void createToolsClassLoader() throws Exception
private void createToolsClassLoader()
throws Exception
{
cl = new IsolatedClassLoader();
@ -677,15 +655,18 @@ private void createToolsClassLoader() throws Exception
File f = new File( repoLocal, dependency );
if ( !f.exists() )
{
throw new FileNotFoundException( "Missing dependency: " + dependency
+ ( !online ? "; run again online" : "; there was a problem downloading it earlier" ) );
throw new FileNotFoundException( "Missing dependency: " + dependency +
( !online
? "; run again online"
: "; there was a problem downloading it earlier" ) );
}
cl.addURL( f.toURL() );
}
}
private void addPluginGeneratorDependencies() throws Exception
private void addPluginGeneratorDependencies()
throws Exception
{
for ( int i = 0; i < pluginGeneratorDeps.length; i++ )
{
@ -694,8 +675,10 @@ private void addPluginGeneratorDependencies() throws Exception
File f = new File( repoLocal, dependency );
if ( !f.exists() )
{
throw new FileNotFoundException( "Missing dependency: " + dependency
+ ( !online ? "; run again online" : "; there was a problem downloading it earlier" ) );
throw new FileNotFoundException( "Missing dependency: " + dependency +
( !online
? "; run again online"
: "; there was a problem downloading it earlier" ) );
}
cl.addURL( f.toURL() );
@ -707,14 +690,15 @@ private void generatePluginDescriptor( String sourceDirectory, String outputDire
{
Class cls = cl.loadClass( "org.apache.maven.tools.plugin.pluggy.Main" );
Method m = cls.getMethod( "main", new Class[] { String[].class } );
Method m = cls.getMethod( "main", new Class[]{String[].class} );
String[] args = { "descriptor", sourceDirectory, outputDirectory, pom, repoLocal };
String[] args = {"descriptor", sourceDirectory, outputDirectory, pom, repoLocal};
m.invoke( null, new Object[] { args } );
m.invoke( null, new Object[]{args} );
}
private void generateSources( String model, String mode, String dir, String modelVersion, String packageWithVersion )
private void generateSources( String model, String mode, String dir, String modelVersion,
String packageWithVersion )
throws Exception
{
IsolatedClassLoader modelloClassLoader = new IsolatedClassLoader();
@ -726,8 +710,10 @@ private void generateSources( String model, String mode, String dir, String mode
File f = new File( repoLocal, dependency );
if ( !f.exists() )
{
throw new FileNotFoundException( "Missing dependency: " + dependency
+ ( !online ? "; run again online" : "; there was a problem downloading it earlier" ) );
throw new FileNotFoundException( "Missing dependency: " + dependency +
( !online
? "; run again online"
: "; there was a problem downloading it earlier" ) );
}
modelloClassLoader.addURL( f.toURL() );
@ -737,34 +723,37 @@ private void generateSources( String model, String mode, String dir, String mode
Object generator = c.newInstance();
Method m = c.getMethod( "main", new Class[] { String[].class } );
Method m = c.getMethod( "main", new Class[]{String[].class} );
String[] args = new String[] { model, mode, dir, modelVersion, packageWithVersion };
String[] args = new String[]{model, mode, dir, modelVersion, packageWithVersion};
ClassLoader old = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader( modelloClassLoader );
m.invoke( generator, new Object[] { args } );
m.invoke( generator, new Object[]{args} );
Thread.currentThread().setContextClassLoader( old );
}
private void checkMBootDeps() throws Exception
private void checkMBootDeps()
throws Exception
{
System.out.println( "Checking for MBoot's dependencies ..." );
downloader.downloadDependencies( mbootDependencies );
}
private void checkModelloDeps() throws Exception
private void checkModelloDeps()
throws Exception
{
System.out.println( "Checking for Modello's dependencies ..." );
downloader.downloadDependencies( Arrays.asList( modelloDeps ) );
}
private void createJar( String classes, String buildDir ) throws Exception
private void createJar( String classes, String buildDir )
throws Exception
{
JarMojo jarMojo = new JarMojo();
@ -775,7 +764,8 @@ private void createJar( String classes, String buildDir ) throws Exception
jarMojo.execute( new File( classes ), buildDir, artifactId + "-" + version );
}
private void installPomFile( String repoLocal, File pomIn ) throws Exception
private void installPomFile( String repoLocal, File pomIn )
throws Exception
{
if ( !reader.parse( pomIn ) )
{
@ -799,7 +789,8 @@ private void installPomFile( String repoLocal, File pomIn ) throws Exception
reader.reset();
}
private void installPom( String basedir, String repoLocal ) throws Exception
private void installPom( String basedir, String repoLocal )
throws Exception
{
String artifactId = reader.artifactId;
@ -814,7 +805,8 @@ private void installPom( String basedir, String repoLocal ) throws Exception
FileUtils.copyFile( new File( basedir, "pom.xml" ), pom );
}
private void installJar( String basedir, String repoLocal ) throws Exception
private void installJar( String basedir, String repoLocal )
throws Exception
{
String artifactId = reader.artifactId;
@ -829,7 +821,8 @@ private void installJar( String basedir, String repoLocal ) throws Exception
FileUtils.copyFile( new File( basedir, BUILD_DIR + "/" + artifactId + "-" + version + ".jar" ), jar );
}
private void installPlugin( String basedir, String repoLocal ) throws Exception
private void installPlugin( String basedir, String repoLocal )
throws Exception
{
String artifactId = reader.artifactId;
@ -844,7 +837,8 @@ private void installPlugin( String basedir, String repoLocal ) throws Exception
FileUtils.copyFile( new File( basedir, BUILD_DIR + "/" + artifactId + "-" + version + ".jar" ), jar );
}
private void runTests( String basedir, String classes, String testClasses ) throws Exception
private void runTests( String basedir, String classes, String testClasses )
throws Exception
{
SurefirePlugin testRunner = new SurefirePlugin();
@ -852,31 +846,13 @@ private void runTests( String basedir, String classes, String testClasses ) thro
List excludes;
if ( reader.getUnitTests() != null )
{
if ( reader.getUnitTests().getIncludes().size() != 0 )
{
includes = reader.getUnitTests().getIncludes();
}
else
{
includes = new ArrayList();
includes = new ArrayList();
includes.add( "**/*Test.java" );
}
includes.add( "**/*Test.java" );
excludes = reader.getUnitTests().getExcludes();
}
else
{
includes = new ArrayList();
excludes = new ArrayList();
includes.add( "**/*Test.java" );
excludes = new ArrayList();
excludes.add( "**/*Abstract*.java" );
}
excludes.add( "**/*Abstract*.java" );
boolean success = testRunner.execute( repoLocal, basedir, classes, testClasses, includes, excludes,
classpath( reader.getDependencies(), null ) );
@ -891,7 +867,8 @@ private void runTests( String basedir, String classes, String testClasses ) thro
// Download dependencies
// ----------------------------------------------------------------------
private void downloadDependencies( List dependencies ) throws Exception
private void downloadDependencies( List dependencies )
throws Exception
{
List list = new ArrayList();
@ -926,7 +903,8 @@ private String[] classpath( List dependencies, String extraClasspath )
}
private void compile( List dependencies, String sourceDirectory, String outputDirectory, String extraClasspath,
String generatedSources ) throws Exception
String generatedSources )
throws Exception
{
JavacCompiler compiler = new JavacCompiler();
@ -938,11 +916,11 @@ private void compile( List dependencies, String sourceDirectory, String outputDi
if ( new File( sourceDirectory ).exists() )
{
sourceDirectories = new String[] { sourceDirectory, generatedSources };
sourceDirectories = new String[]{sourceDirectory, generatedSources};
}
else
{
sourceDirectories = new String[] { generatedSources };
sourceDirectories = new String[]{generatedSources};
}
}
else
@ -950,7 +928,7 @@ private void compile( List dependencies, String sourceDirectory, String outputDi
if ( new File( sourceDirectory ).exists() )
{
sourceDirectories = new String[] { sourceDirectory };
sourceDirectories = new String[]{sourceDirectory};
}
}
@ -991,7 +969,8 @@ private void compile( List dependencies, String sourceDirectory, String outputDi
// Resource copying
// ----------------------------------------------------------------------
private void copyResources( String sourceDirectory, String destinationDirectory ) throws Exception
private void copyResources( String sourceDirectory, String destinationDirectory )
throws Exception
{
File sd = new File( sourceDirectory );
@ -1021,20 +1000,18 @@ private void copyResources( String sourceDirectory, String destinationDirectory
private String getArtifactPath( Dependency d, String pathSeparator )
{
return d.getArtifactDirectory() + pathSeparator + d.getType() + "s" + pathSeparator + d.getArtifact();
return d.getArtifactDirectory() + pathSeparator + d.getPackaging() + "s" + pathSeparator + d.getArtifact();
}
abstract class AbstractReader extends DefaultHandler
abstract class AbstractReader
extends DefaultHandler
{
private File file;
private SAXParserFactory saxFactory;
public abstract void reset();
public boolean parse( File file )
{
this.file = file;
try
{
saxFactory = SAXParserFactory.newInstance();
@ -1072,8 +1049,8 @@ public void fatalError( SAXParseException spe )
private final void printParseError( String type, SAXParseException spe )
{
System.err.println( type + " [line " + spe.getLineNumber() + ", row " + spe.getColumnNumber() + "]: "
+ spe.getMessage() );
System.err.println( type + " [line " + spe.getLineNumber() + ", row " + spe.getColumnNumber() + "]: " +
spe.getMessage() );
}
}
@ -1100,10 +1077,10 @@ class ModelReader
private List remoteRepositories = new ArrayList();
private UnitTests unitTests;
private List resources = new ArrayList();
private List testResources = new ArrayList();
private Dependency currentDependency;
private Resource currentResource;
@ -1112,8 +1089,6 @@ class ModelReader
private boolean insideDependency = false;
private boolean insideUnitTest = false;
private boolean insideResource = false;
private boolean insideRepository = false;
@ -1135,11 +1110,6 @@ public List getDependencies()
return dependencies;
}
public UnitTests getUnitTests()
{
return unitTests;
}
public List getResources()
{
return resources;
@ -1155,12 +1125,6 @@ else if ( rawName.equals( "repository" ) )
{
insideRepository = true;
}
else if ( rawName.equals( "unitTest" ) )
{
unitTests = new UnitTests();
insideUnitTest = true;
}
else if ( rawName.equals( "dependency" ) )
{
currentDependency = new Dependency();
@ -1173,6 +1137,12 @@ else if ( rawName.equals( "resource" ) )
insideResource = true;
}
else if ( rawName.equals( "testResource" ) )
{
currentResource = new Resource();
insideResource = true;
}
depth++;
}
@ -1186,7 +1156,8 @@ private String getBodyText()
return bodyText.toString().trim();
}
public void endElement( String uri, String localName, String rawName ) throws SAXException
public void endElement( String uri, String localName, String rawName )
throws SAXException
{
// support both v3 <extend> and v4 <parent>
if ( rawName.equals( "parent" ) )
@ -1208,8 +1179,8 @@ public void endElement( String uri, String localName, String rawName ) throws SA
throw new SAXException( "Missing required element in <parent>: version." );
}
f = new File( downloader.getMavenRepoLocal(), parentGroupId + "/poms/" + parentArtifactId + "-"
+ parentVersion + ".pom" );
f = new File( downloader.getMavenRepoLocal(), parentGroupId + "/poms/" + parentArtifactId + "-" +
parentVersion + ".pom" );
ModelReader p = new ModelReader();
@ -1220,16 +1191,10 @@ public void endElement( String uri, String localName, String rawName ) throws SA
dependencies.addAll( p.getDependencies() );
unitTests = p.getUnitTests();
resources.addAll( p.getResources() );
insideParent = false;
}
else if ( rawName.equals( "unitTest" ) )
{
insideUnitTest = false;
}
else if ( rawName.equals( "dependency" ) )
{
dependencies.add( currentDependency );
@ -1238,14 +1203,13 @@ else if ( rawName.equals( "dependency" ) )
}
else if ( rawName.equals( "resource" ) )
{
if ( insideUnitTest )
{
unitTests.addResource( currentResource );
}
else
{
resources.add( currentResource );
}
resources.add( currentResource );
insideResource = false;
}
else if ( rawName.equals( "testResource" ) )
{
testResources.add( currentResource );
insideResource = false;
}
@ -1278,9 +1242,9 @@ else if ( rawName.equals( "jar" ) )
{
currentDependency.setJar( getBodyText() );
}
else if ( rawName.equals( "type" ) )
else if ( rawName.equals( "packaging" ) )
{
currentDependency.setType( getBodyText() );
currentDependency.setPackaging( getBodyText() );
}
else if ( rawName.equals( "groupId" ) )
{
@ -1297,10 +1261,6 @@ else if ( insideResource )
{
currentResource.setDirectory( getBodyText() );
}
else if ( rawName.equals( "targetPath" ) )
{
currentResource.setTargetPath( getBodyText() );
}
else if ( rawName.equals( "include" ) )
{
currentResource.addInclude( getBodyText() );
@ -1310,17 +1270,6 @@ else if ( rawName.equals( "exclude" ) )
currentResource.addExclude( getBodyText() );
}
}
else if ( !insideResource && insideUnitTest )
{
if ( rawName.equals( "include" ) )
{
unitTests.addInclude( getBodyText() );
}
else if ( rawName.equals( "exclude" ) )
{
unitTests.addExclude( getBodyText() );
}
}
else if ( depth == 2 )
{
if ( rawName.equals( "artifactId" ) )
@ -1335,7 +1284,7 @@ else if ( rawName.equals( "groupId" ) )
{
groupId = getBodyText();
}
else if ( rawName.equals( "type" ) )
else if ( rawName.equals( "packaging" ) )
{
type = getBodyText();
}
@ -1377,12 +1326,14 @@ public MavenProfile getActiveMavenProfile()
return activeMavenProfile;
}
public void characters( char[] ch, int start, int length ) throws SAXException
public void characters( char[] ch, int start, int length )
throws SAXException
{
currentBody.append( ch, start, length );
}
public void endElement( String uri, String localName, String rawName ) throws SAXException
public void endElement( String uri, String localName, String rawName )
throws SAXException
{
if ( "mavenProfile".equals( rawName ) )
{
@ -1393,8 +1344,8 @@ public void endElement( String uri, String localName, String rawName ) throws SA
}
else
{
throw new SAXException( "Invalid mavenProfile entry. Missing one or more "
+ "fields: {id,localRepository}." );
throw new SAXException( "Invalid mavenProfile entry. Missing one or more " +
"fields: {id,localRepository}." );
}
}
else if ( currentProfile != null )
@ -1420,7 +1371,7 @@ else if ( "mavenProfileId".equals( rawName ) )
{
this.activeProfileId = currentBody.toString().trim();
}
currentBody = new StringBuffer();
}
@ -1491,7 +1442,7 @@ public static class Dependency
private String groupId;
private String type = "jar";
private String packaging = "jar";
public Dependency()
{
@ -1562,13 +1513,13 @@ public String getArtifact()
artifact = getId() + "-" + getVersion() + ".";
}
if ( "jar".equals( getType() ) || "plugin".equals( getType() ) )
if ( "jar".equals( getPackaging() ) || "plugin".equals( getPackaging() ) )
{
artifact += "jar";
}
else
{
artifact += getType();
artifact += getPackaging();
}
return artifact;
}
@ -1611,14 +1562,14 @@ public String getUrl()
return url;
}
public String getType()
public String getPackaging()
{
return type;
return packaging;
}
public void setType( String type )
public void setPackaging( String packaging )
{
this.type = type;
this.packaging = packaging;
}
private boolean isValid( String value )
@ -1632,71 +1583,15 @@ private boolean isValid( String value )
}
}
public static class UnitTests
implements Serializable
{
private String directory;
private List unitTestIncludes = new ArrayList();
private List unitTestExcludes = new ArrayList();
private List unitTestResources = new ArrayList();
public void addInclude( String pattern )
{
unitTestIncludes.add( pattern );
}
public void addExclude( String pattern )
{
unitTestExcludes.add( pattern );
}
public void addResource( Resource resource )
{
unitTestResources.add( resource );
}
public List getIncludes()
{
return unitTestIncludes;
}
public List getExcludes()
{
return unitTestExcludes;
}
public List getResources()
{
return unitTestResources;
}
public void setDirectory( String directory )
{
this.directory = directory;
}
public String getDirectory()
{
return this.directory;
}
}
public static class Resource
implements Serializable
{
private String directory;
private String targetPath;
private List includes = new ArrayList();
private List excludes = new ArrayList();
private boolean filtering;
public void addInclude( String pattern )
{
this.includes.add( pattern );
@ -1726,25 +1621,5 @@ public String getDirectory()
{
return this.directory;
}
public void setTargetPath( String targetPath )
{
this.targetPath = targetPath;
}
public String getTargetPath()
{
return targetPath;
}
public boolean getFiltering()
{
return filtering;
}
public void setFiltering( boolean filtering )
{
this.filtering = filtering;
}
}
}

View File

@ -1,15 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-component</artifactId>
<groupId>maven</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<name>Maven Meper</name>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-meeper</artifactId>
<packaging>jar</packaging>
<name>Maven Meper</name>
<version>0.1-SNAPSHOT</version>
<description></description>
</project>
</model>

View File

@ -32,7 +32,7 @@
</default>
</defaults>
<classes>
<class rootElement="true">
<class rootElement="true" xml.tagName="project">
<name>Model</name>
<version>3.0.0+</version>
<fields>
@ -92,7 +92,7 @@
<type>String</type>
</field>
<field>
<name>type</name>
<name>packaging</name>
<version>4.0.0</version>
<description><![CDATA[The type of artifact this project produces.]]></description>
<type>String</type>
@ -120,7 +120,7 @@
</field>
<field>
<name>shortDescription</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[An abbreviated description of the project.]]></description>
<type>String</type>
</field>
@ -145,7 +145,7 @@
</field>
<field>
<name>logo</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[The logo for the project.]]></description>
<type>String</type>
</field>
@ -229,15 +229,6 @@
</association>
<comment>This may be removed or relocated in the near future. It is undecided whether plugins really need a remote repository set of their own.</comment>
</field>
<field>
<name>plugins</name>
<version>4.0.0</version>
<description><![CDATA[Plugin declarations and configuration.]]></description>
<association>
<type>Plugin</type>
<multiplicity>*</multiplicity>
</association>
</field>
<field>
<name>mailingLists</name>
<version>3.0.0+</version>
@ -327,7 +318,7 @@
</field>
<field>
<name>packageGroups</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[Package groups required for complete javadocs.]]></description>
<association>
<type>PackageGroup</type>
@ -336,7 +327,7 @@
</field>
<field>
<name>reports</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[
This element includes the specification of reports to be
included in a Maven-generated site. These reports will be run
@ -350,6 +341,21 @@
<multiplicity>*</multiplicity>
</association>
</field>
<field>
<name>reports</name>
<version>4.0.0</version>
<description><![CDATA[
This element includes the specification of reports to be
included in a Maven-generated site. These reports will be run
when a user executes
<code>maven site</code>. All of the
reports will be included in the navigation bar for browsing in
the order they are specified.
]]></description>
<association>
<type>Reports</type>
</association>
</field>
<field>
<name>scm</name>
<version>4.0.0</version>
@ -418,11 +424,9 @@
<type>PluginManagement</type>
</association>
</field>
<!-- @todo long run 4.0.0 may not need properties, with the parameters being specified
for the plugin directly -->
<field>
<name>properties</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[
Properties about the project. This allows you to configure your project and the
plugins it uses.
@ -433,10 +437,9 @@
<multiplicity>*</multiplicity>
</association>
</field>
<!-- @todo is this for javadoc only? maybe make it a plugin property? -->
<field xml.tagName="package">
<name>packageName</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<type>String</type>
<description>The Java package that the code resides in.</description>
</field>
@ -454,12 +457,8 @@
{
return currentVersion;
}
</code>
</codeSegment>
<!-- We need this because we can't use package as a field name. -->
<codeSegment>
<version>3.0.0+</version>
<code>
// We need this because we can't use package as a field name.
public void setPackage(String packageName)
{
this.packageName = packageName;
@ -482,7 +481,7 @@
id.append( ":" );
id.append( getArtifactId() );
id.append( ":" );
id.append( getType() );
id.append( getPackaging() );
id.append( ":" );
id.append( getVersion() );
@ -547,9 +546,32 @@
]]></description>
<type>String</type>
</field>
<field>
<name>scriptSourceDirectory</name>
<version>4.0.0</version>
<required>true</required>
<description><![CDATA[
This element specifies a directory containing the script sources
of the project.
]]></description>
<type>String</type>
</field>
<field>
<name>unitTestSourceDirectory</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<required>true</required>
<description><![CDATA[
This element specifies a directory containing the unit test
source of the project. The generated build system will
compile these directories when the project is being tested.
The unit tests must use the JUnit test framework.
The path given is relative to the project descriptor.
]]></description>
<type>String</type>
</field>
<field>
<name>testSourceDirectory</name>
<version>4.0.0</version>
<required>true</required>
<description><![CDATA[
This element specifies a directory containing the unit test
@ -562,7 +584,7 @@
</field>
<field>
<name>sourceModifications</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<required>true</required>
<description><![CDATA[
This element describes all of the sourceModifications associated with a
@ -579,7 +601,7 @@
</field>
<field>
<name>unitTest</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<required>true</required>
<description><![CDATA[This element specifies unit tests associated with the project.]]></description>
<defaultValue>new UnitTest()</defaultValue>
@ -591,7 +613,22 @@
<name>resources</name>
<version>3.0.0+</version>
<description><![CDATA[
This element describes all of the resources associated with a project or unit tests.
This element describes all of the resources associated with a project.
Each resource is described by a resource element, which is then described by additional
elements (described
<a href="#resource">below</a>). These resources are used to
complete the jar file or to run unit test.
]]></description>
<association>
<type>Resource</type>
<multiplicity>*</multiplicity>
</association>
</field>
<field>
<name>testResources</name>
<version>4.0.0</version>
<description><![CDATA[
This element describes all of the resources associated with a project's unit tests.
Each resource is described by a resource element, which is then described by additional
elements (described
<a href="#resource">below</a>). These resources are used to
@ -611,7 +648,7 @@
<type>String</type>
</field>
<field>
<name>output</name>
<name>outputDirectory</name>
<version>4.0.0</version>
<description><![CDATA[
The directory where compiled application classes are placed.
@ -629,13 +666,22 @@
<type>String</type>
</field>
<field>
<name>testOutput</name>
<name>testOutputDirectory</name>
<version>4.0.0</version>
<description><![CDATA[
The directory where compiled test classes are placed.
]]></description>
<type>String</type>
</field>
<field>
<name>plugins</name>
<version>4.0.0</version>
<description><![CDATA[Plugin declarations and configuration.]]></description>
<association>
<type>Plugin</type>
<multiplicity>*</multiplicity>
</association>
</field>
</fields>
</class>
<class>
@ -655,10 +701,40 @@
<type>String</type>
</field>
<field>
<name>nagEmailAddress</name>
<name>notifiers</name>
<version>4.0.0</version>
<description><![CDATA[Email address for the party to be notified on unsuccessful builds.]]></description>
<description><![CDATA[Who to be notified on unsuccessful builds.]]></description>
<association>
<multiplicity>*</multiplicity>
<type>Notifier</type>
</association>
</field>
</fields>
</class>
<class>
<name>Notifier</name>
<version>4.0.0</version>
<fields>
<field>
<name>type</name>
<version>4.0.0</version>
<defaultValue>email</defaultValue>
<type>String</type>
<description>The type of notifier to use</description>
</field>
<field>
<name>address</name>
<version>4.0.0</version>
<type>String</type>
<description>Where to send the notification to - eg email address</description>
</field>
<field>
<name>configuration</name>
<type>Properties</type>
<association xml.mapStyle="inline">
<type>String</type>
<multiplicity>*</multiplicity>
</association>
</field>
</fields>
</class>
@ -787,7 +863,7 @@
</field>
<field>
<name>properties</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[
Properties about the dependency. Various plugins allow you to
<code>mark</code> dependencies with properties. For example the
@ -1089,7 +1165,7 @@
</field>
<field>
<name>logo</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[
The URL to the organization's logo image. This can be an URL relative
to the base directory of the generated web site,
@ -1105,17 +1181,17 @@
</class>
<class>
<name>PackageGroup</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<fields>
<field>
<name>title</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[the description]]></description>
<type>String</type>
</field>
<field>
<name>packages</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[the description]]></description>
<type>String</type>
</field>
@ -1127,7 +1203,7 @@
<fields>
<field>
<name>includes</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[the description]]></description>
<association>
<type>String</type>
@ -1136,13 +1212,25 @@
</field>
<field>
<name>excludes</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[the description]]></description>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
</association>
</field>
<field>
<name>includes</name>
<version>4.0.0</version>
<description><![CDATA[the description]]></description>
<type>String</type>
</field>
<field>
<name>excludes</name>
<version>4.0.0</version>
<description><![CDATA[the description]]></description>
<type>String</type>
</field>
</fields>
<codeSegments>
<codeSegment>
@ -1272,15 +1360,6 @@
<description><![CDATA[The URL to the project's browsable CVS repository.]]></description>
<type>String</type>
</field>
<field>
<name>branches</name>
<version>4.0.0</version>
<description><![CDATA[The SCM branches that are currently active for the project. These should only be those forked from the current branch or trunk that are intended to be used.]]></description>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
</association>
</field>
</fields>
</class>
<class>
@ -1318,7 +1397,7 @@
</field>
<field>
<name>filtering</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[Describe if resources are filtered or not.]]></description>
<type>boolean</type>
<defaultValue>false</defaultValue>
@ -1327,12 +1406,12 @@
</class>
<class>
<name>SourceModification</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<superClass>FileSet</superClass>
<fields>
<field>
<name>className</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[
If the class with this name can
<strong>not</strong> be
@ -1344,7 +1423,7 @@
</field>
<field>
<name>property</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[the description]]></description>
<type>String</type>
</field>
@ -1352,12 +1431,12 @@
</class>
<class>
<name>UnitTest</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<superClass>PatternSet</superClass>
<fields>
<field>
<name>resources</name>
<version>3.0.0+</version>
<version>3.0.0</version>
<description><![CDATA[the description]]></description>
<association>
<type>Resource</type>
@ -1455,34 +1534,6 @@
]]></description>
<type>String</type>
</field>
<!-- @todo this should be in the user configuration -->
<field>
<name>username</name>
<version>4.0.0</version>
<description>The username to connect to the repository with. If omitted, none is used.</description>
<type>String</type>
</field>
<!-- @todo this should be encrypted in some way or be a keystore lookup and m2 can provide a way to generate it -->
<field>
<name>password</name>
<version>4.0.0</version>
<description>The password to use when connecting to the repository. If omitted, none is used.</description>
<type>String</type>
</field>
<!-- @todo this should be in the user configuration -->
<field>
<name>privateKey</name>
<version>4.0.0</version>
<description>The private key to use when connecting to the repository (SSH only)</description>
<type>String</type>
</field>
<!-- @todo this should be in the user configuration -->
<field>
<name>passphrase</name>
<version>4.0.0</version>
<description>The passphrase for the private key to use when connecting to the repository (SSH only)</description>
<type>String</type>
</field>
</fields>
<codeSegments>
<codeSegment>
@ -1578,7 +1629,13 @@
<version>4.0.0</version>
<fields>
<field>
<name>id</name>
<name>groupId</name>
<version>4.0.0</version>
<type>String</type>
<defaultValue>maven</defaultValue>
</field>
<field>
<name>artifactId</name>
<version>4.0.0</version>
<type>String</type>
<required>true</required>
@ -1685,6 +1742,29 @@
</field>
</fields>
</class>
<class>
<name>Reports</name>
<version>4.0.0</version>
<description>Section for management of reports and configuration</description>
<fields>
<field>
<name>outputDirectory</name>
<version>4.0.0</version>
<type>String</type>
<description>Where to store all of the generated reports</description>
</field>
<field>
<name>plugins</name>
<version>4.0.0</version>
<description>The reporting plugins to use and their configuration</description>
<association>
<!-- TODO: goal stuff relevant or not? -->
<type>Plugin</type>
<multiplicity>*</multiplicity>
</association>
</field>
</fields>
</class>
</classes>
</model>

View File

@ -1,25 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-component</artifactId>
<groupId>maven</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<name>Maven Model</name>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-model</artifactId>
<packaging>jar</packaging>
<name>Maven Model</name>
<version>2.0-SNAPSHOT</version>
<description>Maven Model</description>
<shortDescription>Maven Model</shortDescription>
<plugins>
<plugin>
<id>modello</id>
<configuration>
<model>maven.mdo</model>
<version>4.0.0</version>
</configuration>
</plugin>
</plugins>
</project>
<build>
<plugins>
<plugin>
<groupId>maven</groupId>
<artifactId>maven-modello-plugin</artifactId>
<configuration>
<version>4.0.0</version>
<model>maven.mdo</model>
</configuration>
</plugin>
</plugins>
</build>
</model>

View File

@ -1,11 +1,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<artifactId>maven-component</artifactId>
<groupId>maven</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-monitor</artifactId>
<packaging>jar</packaging>
<version>2.0-SNAPSHOT</version>
</project>
</model>

View File

@ -1,18 +1,13 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<model>
<parent>
<groupId>maven</groupId>
<!--
| NOT inheriting from maven-plugin-tools, because that POM will have this
| as a dependency, for the convenience of implementation projects.
-->
<artifactId>maven-component</artifactId>
<groupId>maven</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>maven-plugin-tools-api</artifactId>
<packaging>jar</packaging>
<name>Maven Plugin Tools APIs</name>
<version>2.0-SNAPSHOT</version>
<dependencies>
@ -20,31 +15,43 @@
<groupId>modello</groupId>
<artifactId>modello</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-core</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-model</artifactId>
<version>2.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>maven</groupId>
<artifactId>wagon-provider-api</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</model>

Some files were not shown because too many files have changed in this diff Show More