From c8b842c976261716037ffa0859c2e5e0086c2f49 Mon Sep 17 00:00:00 2001 From: Britton Isbell Date: Thu, 24 Jul 2008 23:06:59 +0000 Subject: [PATCH] Merge of SI_MAVEN_2_1 branch. New builder code. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@679609 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/embedder/MavenEmbedderTest.java | 6 +- maven-project/pom.xml | 10 +- .../project/DefaultMavenProjectBuilder.java | 83 +- .../ArtifactModelContainerFactory.java | 186 ++ .../builder/IdModelContainerFactory.java | 113 ++ .../project/builder/PomArtifactResolver.java | 93 + .../builder/PomClassicDomainModel.java | 245 +++ .../builder/PomClassicTransformer.java | 418 +++++ .../maven/project/builder/ProjectBuilder.java | 56 + .../maven/project/builder/ProjectUri.java | 1666 +++++++++++++++++ .../builder/impl/DefaultProjectBuilder.java | 295 +++ .../resources/META-INF/plexus/components.xml | 13 + .../AbstractProjectInheritanceTestCase.java | 2 +- .../t12scm/ProjectInheritanceTest.java | 12 +- .../maven/project/ProjectClasspathTest.xml | 13 + .../canonical/CanonicalProjectBuilderTest.xml | 13 + pom.xml | 53 +- 17 files changed, 3210 insertions(+), 67 deletions(-) create mode 100644 maven-project/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java create mode 100644 maven-project/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java create mode 100644 maven-project/src/main/java/org/apache/maven/project/builder/PomArtifactResolver.java create mode 100644 maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java create mode 100644 maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java create mode 100644 maven-project/src/main/java/org/apache/maven/project/builder/ProjectBuilder.java create mode 100644 maven-project/src/main/java/org/apache/maven/project/builder/ProjectUri.java create mode 100644 maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java diff --git a/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java b/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java index 43c1c3f496..4c55ac3bee 100644 --- a/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java +++ b/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java @@ -334,9 +334,9 @@ public class MavenEmbedderTest MavenProject project = maven.readProject( pomFile ); - assertEquals( "http://host/viewer?path=/trunk/parent/modules/child1", project.getScm().getUrl() ); - assertEquals( "scm:svn:http://host/trunk/parent/modules/child1", project.getScm().getConnection() ); - assertEquals( "scm:svn:https://host/trunk/parent/modules/child1", project.getScm().getDeveloperConnection() ); + assertEquals( "http://host/viewer?path=/trunk/parent/child1", project.getScm().getUrl() ); + assertEquals( "scm:svn:http://host/trunk/parent/child1", project.getScm().getConnection() ); + assertEquals( "scm:svn:https://host/trunk/parent/child1", project.getScm().getDeveloperConnection() ); } public void testProjectReading_SkipMissingModuleSilently() diff --git a/maven-project/pom.xml b/maven-project/pom.xml index 82d85c0ce3..a88838de5d 100644 --- a/maven-project/pom.xml +++ b/maven-project/pom.xml @@ -68,7 +68,15 @@ under the License. org.apache.maven.wagon wagon-file test - + + + org.codehaus.woodstox + wstx-asl + + + org.apache.maven.shared + maven-shared-model + diff --git a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java index 4f87ff378a..37759c6bbc 100644 --- a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java +++ b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java @@ -46,6 +46,7 @@ import org.apache.maven.model.Extension; import org.apache.maven.model.Model; import org.apache.maven.model.Plugin; import org.apache.maven.model.PluginManagement; +import org.apache.maven.model.Parent; import org.apache.maven.model.ReportPlugin; import org.apache.maven.model.Repository; import org.apache.maven.model.Resource; @@ -69,6 +70,9 @@ import org.apache.maven.project.path.PathTranslator; import org.apache.maven.project.validation.ModelValidationResult; import org.apache.maven.project.validation.ModelValidator; import org.apache.maven.project.workspace.ProjectWorkspace; +import org.apache.maven.project.builder.PomArtifactResolver; +import org.apache.maven.project.builder.ProjectBuilder; +import org.apache.maven.project.builder.PomClassicDomainModel; import org.codehaus.plexus.logging.LogEnabled; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; @@ -77,24 +81,9 @@ import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; +import java.io.*; import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; +import java.util.*; /*:apt @@ -137,7 +126,7 @@ public class DefaultMavenProjectBuilder implements MavenProjectBuilder, Initializable, LogEnabled { - protected MavenProfilesBuilder profilesBuilder; + protected MavenProfilesBuilder profilesBuilder; protected ArtifactResolver artifactResolver; @@ -166,6 +155,8 @@ public class DefaultMavenProjectBuilder private ProjectWorkspace projectWorkspace; + private ProjectBuilder projectBuilder; + //DO NOT USE, it is here only for backward compatibility reasons. The existing // maven-assembly-plugin (2.2-beta-1) is accessing it via reflection. @@ -500,11 +491,9 @@ public class DefaultMavenProjectBuilder if ( project == null ) { -// getLogger().debug( "Allowing project-build to proceed for: " + projectDescriptor ); - - Model model = readModel( "unknown", projectDescriptor, STRICT_MODEL_PARSING ); - - project = buildInternal( model, + Model model = readModelFromLocalPath( "unknown", projectDescriptor, new PomArtifactResolver(config.getLocalRepository(), + buildArtifactRepositories( getSuperModel() ), artifactResolver) ); + project = buildInternal(model, config, buildArtifactRepositories( getSuperModel() ), projectDescriptor, @@ -512,11 +501,6 @@ public class DefaultMavenProjectBuilder true, true ); } -// else -// { -// getLogger().debug( "Returning cached project: " + project ); -// } - return project; } @@ -525,8 +509,8 @@ public class DefaultMavenProjectBuilder ArtifactRepository localRepository ) throws ProjectBuildingException { - String projectId = safeVersionlessKey( artifact.getGroupId(), artifact.getArtifactId() ); + String projectId = safeVersionlessKey( artifact.getGroupId(), artifact.getArtifactId() ); remoteArtifactRepositories = normalizeToArtifactRepositories( remoteArtifactRepositories, projectId ); Artifact projectArtifact; @@ -548,21 +532,20 @@ public class DefaultMavenProjectBuilder artifact.getScope() ); } - Model model; - + Model legacy_model; try { artifactResolver.resolve( projectArtifact, remoteArtifactRepositories, localRepository ); File file = projectArtifact.getFile(); - model = readModel( projectId, file, STRICT_MODEL_PARSING ); + legacy_model = readModelLegacy( projectId, file, STRICT_MODEL_PARSING ); String downloadUrl = null; ArtifactStatus status = ArtifactStatus.NONE; - DistributionManagement distributionManagement = model.getDistributionManagement(); + DistributionManagement distributionManagement = legacy_model.getDistributionManagement(); if ( distributionManagement != null ) { @@ -581,7 +564,7 @@ public class DefaultMavenProjectBuilder } else { - projectArtifact.setDownloadUrl( model.getUrl() ); + projectArtifact.setDownloadUrl( legacy_model.getUrl() ); } } catch ( ArtifactResolutionException e ) @@ -593,7 +576,7 @@ public class DefaultMavenProjectBuilder throw new ProjectBuildingException( projectId, "POM '" + projectId + "' not found in repository: " + e.getMessage(), e ); } - return model; + return legacy_model; } private List normalizeToArtifactRepositories( List remoteArtifactRepositories, @@ -841,6 +824,7 @@ public class DefaultMavenProjectBuilder // getLogger().debug( "Caching project: " + project.getId() + " (also keyed by file: " + project.getFile() + ")" ); + projectWorkspace.storeProjectByCoordinate( project ); projectWorkspace.storeProjectByFile( project ); @@ -1791,7 +1775,7 @@ public class DefaultMavenProjectBuilder } } - private Model readModel( String projectId, + private Model readModelLegacy( String projectId, File file, boolean strict ) throws ProjectBuildingException @@ -2085,4 +2069,31 @@ public class DefaultMavenProjectBuilder { this.logger = logger; } + + private Model readModelFromLocalPath( String projectId, + File projectDescriptor, + PomArtifactResolver resolver ) + throws ProjectBuildingException + { + if(projectDescriptor == null) { + throw new IllegalArgumentException("projectDescriptor: null, Project Id =" + projectId); + } + + if(projectBuilder == null) { + throw new IllegalArgumentException("projectBuilder: not initialized"); + } + + MavenProject mavenProject; + try { + mavenProject = projectBuilder.buildFromLocalPath(new FileInputStream(projectDescriptor), + null, null, resolver, + projectDescriptor.getParentFile()); + } catch (IOException e) { + e.printStackTrace(); + throw new ProjectBuildingException(projectId, "File = " + projectDescriptor.getAbsolutePath() , e); + } + + return mavenProject.getModel(); + + } } diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java b/maven-project/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java new file mode 100644 index 0000000000..1f56ea5a0a --- /dev/null +++ b/maven-project/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java @@ -0,0 +1,186 @@ +package org.apache.maven.project.builder; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * 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.shared.model.ModelContainer; +import org.apache.maven.shared.model.ModelContainerAction; +import org.apache.maven.shared.model.ModelContainerFactory; +import org.apache.maven.shared.model.ModelProperty; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +public final class ArtifactModelContainerFactory + implements ModelContainerFactory +{ + + private static final Collection uris = Collections.unmodifiableList( Arrays.asList( + + ProjectUri.DependencyManagement.Dependencies.Dependency.xUri, ProjectUri.Dependencies.Dependency.xUri, + + ProjectUri.Build.PluginManagement.Plugins.Plugin.xUri, + ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.Dependency.xUri, + + ProjectUri.Build.Plugins.Plugin.xUri, ProjectUri.Build.Plugins.Plugin.Dependencies.Dependency.xUri, + ProjectUri.Build.Plugins.Plugin.Dependencies.Dependency.Exclusions.Exclusion.xUri ) ); + + public Collection getUris() + { + return uris; + } + + public ModelContainer create( List modelProperties ) + { + if ( modelProperties == null || modelProperties.size() == 0 ) + { + throw new IllegalArgumentException( "modelProperties: null or empty" ); + } + return new ArtifactModelContainer( modelProperties ); + } + + private static class ArtifactModelContainer + implements ModelContainer + { + + private String groupId; + + private String artifactId; + + private String version; + + private String type; + + private List properties; + + private ArtifactModelContainer( List properties ) + { + this.properties = new ArrayList( properties ); + this.properties = Collections.unmodifiableList( this.properties ); + + for ( ModelProperty mp : properties ) + { + if ( mp.getUri().endsWith( "version" ) ) + { + this.version = mp.getValue(); + } + else if ( mp.getUri().endsWith( "artifactId" ) ) + { + this.artifactId = mp.getValue(); + } + else if ( mp.getUri().endsWith( "groupId" ) ) + { + this.groupId = mp.getValue(); + } + else if ( mp.getUri().equals( ProjectUri.Dependencies.Dependency.type ) ) + { + this.type = mp.getValue(); + } + } + if ( groupId == null ) + { + groupId = "org.apache.maven.plugins"; + // throw new IllegalArgumentException("properties does not contain group id. Artifact ID = " + // + artifactId + ", Version = " + version); + } + + if ( artifactId == null ) + { + throw new IllegalArgumentException( + "Properties does not contain artifact id. Group ID = " + groupId + ", Version = " + version ); + } + + if ( type == null ) + { + type = ""; + } + } + + public ModelContainerAction containerAction( ModelContainer modelContainer ) + { + if ( modelContainer == null ) + { + throw new IllegalArgumentException( "modelContainer: null" ); + } + + if ( !( modelContainer instanceof ArtifactModelContainer ) ) + { + throw new IllegalArgumentException( "modelContainer: wrong type" ); + } + + ArtifactModelContainer c = (ArtifactModelContainer) modelContainer; + if ( c.groupId.equals( groupId ) && c.artifactId.equals( artifactId ) ) + { + if ( c.version == null ) + { + if ( version == null ) + { + return ModelContainerAction.JOIN; + } + return ModelContainerAction.DELETE;//TODO Verify - PluginManagement Section may make versions equal + } + + if ( c.version.equals( version ) ) + { + if ( c.type.equals( type ) ) + { + return ModelContainerAction.JOIN; + } + else + { + return ModelContainerAction.NOP; + } + } + else + { + return ModelContainerAction.DELETE; + } + } + else + { + return ModelContainerAction.NOP; + } + } + + public ModelContainer createNewInstance( List modelProperties ) + { + return new ArtifactModelContainer( modelProperties ); + } + + public List getProperties() + { + return properties; + } + + public String toString() + { + StringBuffer sb = new StringBuffer(); + sb.append( "Group ID = " ).append( groupId ).append( ", Artifact ID = " ).append( artifactId ) + .append( ", Version" ).append( version ).append( "\r\n" ); + for ( ModelProperty mp : properties ) + { + sb.append( mp ).append( "\r\n" ); + } + return sb.toString(); + } + } +} diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java b/maven-project/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java new file mode 100644 index 0000000000..2cc0fd2d73 --- /dev/null +++ b/maven-project/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java @@ -0,0 +1,113 @@ +package org.apache.maven.project.builder; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * 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.shared.model.ModelContainer; +import org.apache.maven.shared.model.ModelContainerAction; +import org.apache.maven.shared.model.ModelContainerFactory; +import org.apache.maven.shared.model.ModelProperty; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +public class IdModelContainerFactory + implements ModelContainerFactory +{ + + private static final Collection uris = Collections.unmodifiableList( Arrays.asList( + ProjectUri.PluginRepositories.PluginRepository.xUri, ProjectUri.Repositories.Repository.xUri, + ProjectUri.Reporting.Plugins.Plugin.ReportSets.ReportSet.xUri, ProjectUri.Profiles.Profile.xUri, + ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri ) ); + + public Collection getUris() + { + return uris; + } + + public ModelContainer create( List modelProperties ) + { + if ( modelProperties == null || modelProperties.size() == 0 ) + { + throw new IllegalArgumentException( "modelProperties: null or empty" ); + } + return new IdModelContainer( modelProperties ); + } + + private static class IdModelContainer + implements ModelContainer + { + + private String id; + + private List properties; + + private IdModelContainer( List properties ) + { + this.properties = new ArrayList( properties ); + this.properties = Collections.unmodifiableList( this.properties ); + + for ( ModelProperty mp : properties ) + { + if ( mp.getUri().endsWith( "/id" ) ) + { + this.id = mp.getValue(); + } + } + } + + public ModelContainerAction containerAction( ModelContainer modelContainer ) + { + if ( modelContainer == null ) + { + throw new IllegalArgumentException( "modelContainer: null" ); + } + + if ( !( modelContainer instanceof IdModelContainer ) ) + { + throw new IllegalArgumentException( "modelContainer: wrong type" ); + } + + IdModelContainer c = (IdModelContainer) modelContainer; + if ( c.id == null || id == null ) + { + return ModelContainerAction.NOP; + } + return ( c.id.equals( id ) ) ? ModelContainerAction.JOIN : ModelContainerAction.NOP; + } + + public ModelContainer createNewInstance( List modelProperties ) + { + return new IdModelContainer( modelProperties ); + } + + public List getProperties() + { + return properties; + } + + public String toString() + { + return "ID = " + id; + } + } +} diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/PomArtifactResolver.java b/maven-project/src/main/java/org/apache/maven/project/builder/PomArtifactResolver.java new file mode 100644 index 0000000000..3b848b7a91 --- /dev/null +++ b/maven-project/src/main/java/org/apache/maven/project/builder/PomArtifactResolver.java @@ -0,0 +1,93 @@ +package org.apache.maven.project.builder; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * 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.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.ArtifactNotFoundException; +import org.apache.maven.artifact.resolver.ArtifactResolutionException; +import org.apache.maven.artifact.resolver.ArtifactResolver; + +import java.io.File; +import java.io.IOException; +import java.util.List; + +/** + * Provides methods for resolving of artifacts. + */ +public class PomArtifactResolver +{ + + /** + * Local repository used in resolving artifacts + */ + private ArtifactRepository localRepository; + + /** + * Remote repositories used in resolving artifacts + */ + private List remoteRepositories; + + /** + * Artifact resolver used to resolve artifacts + */ + private ArtifactResolver resolver; + + /** + * Constructor + * + * @param localRepository local repository used in resolving artifacts + * @param remoteRepositories remote repositories used in resolving artifacts + * @param resolver artifact resolver used to resolve artifacts + */ + public PomArtifactResolver( ArtifactRepository localRepository, List remoteRepositories, + ArtifactResolver resolver ) + { + this.localRepository = localRepository; + this.remoteRepositories = remoteRepositories; + this.resolver = resolver; + } + + /** + * Resolves the specified artifact + * + * @param artifact the artifact to resolve + * @throws IOException if there is a problem resolving the artifact + */ + public void resolve( Artifact artifact ) + throws IOException + { + File artifactFile = new File( localRepository.getBasedir(), localRepository.pathOf( artifact ) ); + artifact.setFile( artifactFile ); + + try + { + resolver.resolve( artifact, remoteRepositories, localRepository ); + } + catch ( ArtifactResolutionException e ) + { + throw new IOException( e.getMessage() ); + } + catch ( ArtifactNotFoundException e ) + { + throw new IOException( e.getMessage() ); + } + } +} diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java b/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java new file mode 100644 index 0000000000..3b00b80390 --- /dev/null +++ b/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java @@ -0,0 +1,245 @@ +package org.apache.maven.project.builder; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * 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.Model; +import org.apache.maven.model.Parent; +import org.apache.maven.model.io.xpp3.MavenXpp3Reader; +import org.apache.maven.model.io.xpp3.MavenXpp3Writer; +import org.apache.maven.shared.model.InputStreamDomainModel; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.ReaderFactory; +import org.codehaus.plexus.util.WriterFactory; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.Writer; + +/** + * Provides a wrapper for the maven model. + */ +public final class PomClassicDomainModel + implements InputStreamDomainModel +{ + + /** + * Bytes containing the underlying model + */ + private byte[] inputBytes; + + /** + * History of joins and deletes of model properties + */ + private String eventHistory; + + /** + * Maven model + */ + private Model model; + + private String id; + + /** + * Constructor + * + * @param model maven model + * @throws IOException if there is a problem constructing the model + */ + public PomClassicDomainModel( Model model ) + throws IOException + { + if ( model == null ) + { + throw new IllegalArgumentException( "model: null" ); + } + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + Writer out = WriterFactory.newXmlWriter( baos ); + MavenXpp3Writer writer = new MavenXpp3Writer(); + writer.write( out, model ); + out.close(); + inputBytes = baos.toByteArray(); + } + + /** + * Constructor + * + * @param inputStream input stream of the maven model + * @throws IOException if there is a problem constructing the model + */ + public PomClassicDomainModel( InputStream inputStream ) + throws IOException + { + if ( inputStream == null ) + { + throw new IllegalArgumentException( "inputStream: null" ); + } + this.inputBytes = IOUtil.toByteArray( inputStream ); + } + + + /** + * Returns true if groupId.equals(a.groupId) && artifactId.equals(a.artifactId) && version.equals(a.version), + * otherwise returns false. + * + * @param a model to compare + * @return true if groupId.equals(a.groupId) && artifactId.equals(a.artifactId) && version.equals(a.version), + * otherwise returns false. + */ + public boolean matchesModel( Model a ) + { + if ( a == null ) + { + throw new IllegalArgumentException( "a: null" ); + } + if ( model == null ) + { + try + { + model = getModel(); + } + catch ( IOException e ) + { + return false; + } + } + return a.getId().equals( this.getId() ); + } + + public String getId() + { + if ( id == null ) + { + if ( model == null ) + { + try + { + model = getModel(); + } + catch ( IOException e ) + { + return ""; + } + } + String groupId = ( model.getGroupId() == null ) ? model.getParent().getGroupId() : model.getGroupId(); + String artifactId = + ( model.getArtifactId() == null ) ? model.getParent().getArtifactId() : model.getArtifactId(); + String version = ( model.getVersion() == null ) ? model.getParent().getVersion() : model.getVersion(); + + id = groupId + ":" + artifactId + ":" + version; + } + return id; + } + + + public boolean matchesParent( Parent parent ) + { + if ( parent == null ) + { + throw new IllegalArgumentException( "parent: null" ); + } + return getId().equals( parent.getGroupId() + ":" + parent.getArtifactId() + ":" + parent.getVersion() ); + } + + /** + * Returns XML model as string + * + * @return XML model as string + */ + public String asString() + { + try + { + return IOUtil.toString( ReaderFactory.newXmlReader( new ByteArrayInputStream( inputBytes ) ) ); + } + catch ( IOException ioe ) + { + // should not occur: everything is in-memory + return ""; + } + } + + /** + * Returns maven model + * + * @return maven model + */ + public Model getModel() + throws IOException + { + if ( model != null ) + { + return model; + } + try + { + return new MavenXpp3Reader().read( ReaderFactory.newXmlReader( new ByteArrayInputStream( inputBytes ) ) ); + } + catch ( XmlPullParserException e ) + { + e.printStackTrace(); + throw new IOException( e.getMessage() ); + } + } + + /** + * @see org.apache.maven.shared.model.InputStreamDomainModel#getInputStream() + */ + public InputStream getInputStream() + { + byte[] copy = new byte[inputBytes.length]; + System.arraycopy( inputBytes, 0, copy, 0, inputBytes.length ); + return new ByteArrayInputStream( copy ); + } + + /** + * @see org.apache.maven.shared.model.DomainModel#getEventHistory() + */ + public String getEventHistory() + { + return eventHistory; + } + + /** + * @see org.apache.maven.shared.model.DomainModel#setEventHistory(String) + */ + public void setEventHistory( String eventHistory ) + { + if ( eventHistory == null ) + { + throw new IllegalArgumentException( "eventHistory: null" ); + } + this.eventHistory = eventHistory; + } + + /** + * Returns true if this.asString.equals(o.asString()), otherwise false. + * + * @param o domain model + * @return true if this.asString.equals(o.asString()), otherwise false. + */ + public boolean equals( Object o ) + { + return o instanceof PomClassicDomainModel && getId().equals( ( (PomClassicDomainModel) o ).getId() ); + } + +} diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java b/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java new file mode 100644 index 0000000000..da31261a1d --- /dev/null +++ b/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java @@ -0,0 +1,418 @@ +package org.apache.maven.project.builder; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * 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.io.xpp3.MavenXpp3Reader; +import org.apache.maven.shared.model.DomainModel; +import org.apache.maven.shared.model.ModelContainer; +import org.apache.maven.shared.model.ModelDataSource; +import org.apache.maven.shared.model.ModelMarshaller; +import org.apache.maven.shared.model.ModelProperty; +import org.apache.maven.shared.model.ModelTransformer; +import org.apache.maven.shared.model.impl.DefaultModelDataSource; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.Map; +import java.util.HashMap; + +/** + * Provides methods for transforming model properties into a domain model for the pom classic format and vice versa. + */ +public final class PomClassicTransformer + implements ModelTransformer +{ + + /** + * The URIs this tranformer supports + */ + private final Set uris; + + private static Map> cache = new HashMap>(); + + //private static List cache = new ArrayList(); + + /** + * Default constructor + */ + public PomClassicTransformer() + { + this.uris = new HashSet( Arrays.asList( ProjectUri.Build.Extensions.xUri, + ProjectUri.Build.PluginManagement.Plugins.xUri, + ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.xUri, + ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.Dependency.Exclusions.xUri, + ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.xUri, + ProjectUri.Build.Plugins.xUri, + ProjectUri.Build.Plugins.Plugin.configuration, + ProjectUri.Build.Plugins.Plugin.Dependencies.xUri, + ProjectUri.Build.Plugins.Plugin.Executions.xUri, + ProjectUri.Build.Resources.xUri, + ProjectUri.Build.Resources.Resource.includes, + ProjectUri.Build.Resources.Resource.excludes, + ProjectUri.Build.TestResources.xUri, + + ProjectUri.CiManagement.Notifiers.xUri, + + ProjectUri.Contributors.xUri, + + ProjectUri.Dependencies.xUri, + ProjectUri.Dependencies.Dependency.Exclusions.xUri, + + ProjectUri.DependencyManagement.Dependencies.xUri, + ProjectUri.DependencyManagement.Dependencies.Dependency.Exclusions.xUri, + + ProjectUri.Developers.xUri, + ProjectUri.Developers.Developer.roles, ProjectUri.Licenses.xUri, + ProjectUri.MailingLists.xUri, ProjectUri.Modules.xUri, + ProjectUri.PluginRepositories.xUri, + + ProjectUri.Profiles.xUri, + ProjectUri.Profiles.Profile.Build.Plugins.xUri, + ProjectUri.Profiles.Profile.Build.Plugins.Plugin.Dependencies.xUri, + ProjectUri.Profiles.Profile.Build.Resources.xUri, + ProjectUri.Profiles.Profile.Build.TestResources.xUri, + ProjectUri.Profiles.Profile.Dependencies.xUri, + ProjectUri.Profiles.Profile.Dependencies.Dependency.Exclusions.xUri, + ProjectUri.Profiles.Profile.DependencyManagement.Dependencies.xUri, + ProjectUri.Profiles.Profile.PluginRepositories.xUri, + ProjectUri.Profiles.Profile.Reporting.Plugins.xUri, + ProjectUri.Profiles.Profile.Repositories.xUri, + + ProjectUri.Reporting.Plugins.xUri, + ProjectUri.Reporting.Plugins.Plugin.ReportSets.xUri, + + ProjectUri.Repositories.xUri, + + "http://apache.org/maven/project/profiles/profile/build/pluginManagement/plugins/plugin/dependencies#collection", + "http://apache.org/maven/project/profiles/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/exclusions#collection", + "http://apache.org/maven/project/profiles/profile/build/pluginManagement/plugins/plugin/executions#collection", + "http://apache.org/maven/project/profiles/profile/build/pluginManagement/plugins#collection", + "http://apache.org/maven/project/profiles/profile/build/plugins/plugin/dependencies/dependency/exclusions#collection", + "http://apache.org/maven/project/profiles/profile/dependencyManagement/dependencies/dependency/exclusions#collection", + "http://apache.org/maven/project/profiles/profile/reporting/plugins/plugin/reportSets#collection", + "http://apache.org/maven/project/profiles/profile/build/plugins/plugin/executions#collection" ) ); + } + + /** + * @see ModelTransformer#transformToDomainModel(java.util.List) + */ + public DomainModel transformToDomainModel( List properties ) + throws IOException + { + if ( properties == null ) + { + throw new IllegalArgumentException( "properties: null" ); + } + + List props = new ArrayList(); + for ( ModelProperty mp : properties ) + { //TODO: Resolved values + if ( mp.getValue() != null && ( mp.getValue().contains( "=" ) || mp.getValue().contains( "<" ) ) ) + { + props.add( new ModelProperty( mp.getUri(), "" ) ); + } + else + { + props.add( mp ); + } + } + + String xml = null; + try + { + xml = ModelMarshaller.unmarshalModelPropertiesToXml( props, ProjectUri.baseUri ); + return new PomClassicDomainModel( new MavenXpp3Reader().read( new StringReader( xml ) ) ); + } + catch ( XmlPullParserException e ) + { + throw new IOException( e + ":\r\n" + xml ); + } + } + + /** + * @see ModelTransformer#transformToModelProperties(java.util.List) + */ + public List transformToModelProperties( List domainModels ) + throws IOException + { + if ( domainModels == null || domainModels.isEmpty() ) + { + throw new IllegalArgumentException( "domainModels: null or empty" ); + } + + List modelProperties = new ArrayList(); + List projectNames = new ArrayList(); + StringBuffer scmUrl = new StringBuffer(); + StringBuffer scmConnectionUrl = new StringBuffer(); + StringBuffer scmDeveloperUrl = new StringBuffer(); + for ( DomainModel domainModel : domainModels ) + { + if ( !( domainModel instanceof PomClassicDomainModel ) ) + { + throw new IllegalArgumentException( "domainModels: Invalid domain model" ); + } + + PomClassicDomainModel pomDomainModel = (PomClassicDomainModel) domainModel; + if ( cache.containsKey( pomDomainModel.getId() ) ) + { + System.out.println( "Found in cache: ID = " + pomDomainModel.getId() ); + modelProperties.addAll( cache.get( pomDomainModel.getId() ) ); + continue; + } + + List tmp = ModelMarshaller.marshallXmlToModelProperties( + ( (PomClassicDomainModel) domainModel ).getInputStream(), ProjectUri.baseUri, uris ); + List clearedProperties = new ArrayList(); + + //Missing Version Rule + if ( getPropertyFor( ProjectUri.version, tmp ) == null ) + { + ModelProperty parentVersion = getPropertyFor( ProjectUri.Parent.version, tmp ); + if ( parentVersion != null ) + { + tmp.add( new ModelProperty( ProjectUri.version, parentVersion.getValue() ) ); + } + } + + //Modules Not Inherited Rule + if ( domainModels.indexOf( domainModel ) != 0 ) + { + ModelProperty modulesProperty = getPropertyFor( ProjectUri.Modules.xUri, tmp ); + if ( modulesProperty != null ) + { + tmp.remove( modulesProperty ); + tmp.removeAll( getPropertiesFor( ProjectUri.Modules.module, tmp ) ); + } + } + + //Missing groupId, use parent one Rule + if ( getPropertyFor( ProjectUri.groupId, tmp ) == null ) + { + ModelProperty parentGroupId = getPropertyFor( ProjectUri.Parent.groupId, tmp ); + if ( parentGroupId != null ) + { + tmp.add( new ModelProperty( ProjectUri.groupId, parentGroupId.getValue() ) ); + } + + } + + //Not inherited plugin execution rule + if ( domainModels.indexOf( domainModel ) > 0 ) + { + List removeProperties = new ArrayList(); + ModelDataSource source = new DefaultModelDataSource(); + source.init( tmp, Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) ); + List containers = + source.queryFor( ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri ); + for ( ModelContainer container : containers ) + { + for ( ModelProperty mp : container.getProperties() ) + { + if ( mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.Executions.Execution.inherited ) && + mp.getValue() != null && mp.getValue().equals( "false" ) ) + { + removeProperties.addAll( container.getProperties() ); + for ( int j = tmp.indexOf( mp ); j >= 0; j-- ) + { + if ( tmp.get( j ).getUri().equals( ProjectUri.Build.Plugins.Plugin.Executions.xUri ) ) + { + removeProperties.add( tmp.get( j ) ); + break; + } + } + break; + } + } + } + tmp.removeAll( removeProperties ); + } + //Not inherited plugin rule + if ( domainModels.indexOf( domainModel ) > 0 ) + { + List removeProperties = new ArrayList(); + ModelDataSource source = new DefaultModelDataSource(); + source.init( tmp, Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) ); + List containers = source.queryFor( ProjectUri.Build.Plugins.Plugin.xUri ); + for ( ModelContainer container : containers ) + { + for ( ModelProperty mp : container.getProperties() ) + { + if ( mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.inherited ) && mp.getValue() != null && + mp.getValue().equals( "false" ) ) + { + removeProperties.addAll( container.getProperties() ); + for ( int j = tmp.indexOf( mp ); j >= 0; j-- ) + { + if ( tmp.get( j ).getUri().equals( ProjectUri.Build.Plugins.Plugin.xUri ) ) + { + removeProperties.add( tmp.get( j ) ); + break; + } + } + break; + } + } + } + tmp.removeAll( removeProperties ); + } + + //SCM Rule + ModelProperty scmUrlProperty = getPropertyFor( ProjectUri.Scm.url, tmp ); + if ( scmUrl.length() == 0 && scmUrlProperty != null ) + { + scmUrl.append( scmUrlProperty.getValue() ); + for ( String projectName : projectNames ) + { + scmUrl.append( "/" ).append( projectName ); + } + int index = tmp.indexOf( scmUrlProperty ); + tmp.remove( index ); + tmp.add( index, new ModelProperty( ProjectUri.Scm.url, scmUrl.toString() ) ); + } + + //SCM Connection Rule + scmUrlProperty = getPropertyFor( ProjectUri.Scm.connection, tmp ); + if ( scmConnectionUrl.length() == 0 && scmUrlProperty != null ) + { + scmConnectionUrl.append( scmUrlProperty.getValue() ); + for ( String projectName : projectNames ) + { + scmConnectionUrl.append( "/" ).append( projectName ); + } + int index = tmp.indexOf( scmUrlProperty ); + tmp.remove( index ); + tmp.add( index, new ModelProperty( ProjectUri.Scm.connection, scmConnectionUrl.toString() ) ); + } + //SCM Developer Rule + scmUrlProperty = getPropertyFor( ProjectUri.Scm.developerConnection, tmp ); + if ( scmDeveloperUrl.length() == 0 && scmUrlProperty != null ) + { + scmDeveloperUrl.append( scmUrlProperty.getValue() ); + for ( String projectName : projectNames ) + { + scmDeveloperUrl.append( "/" ).append( projectName ); + } + int index = tmp.indexOf( scmUrlProperty ); + tmp.remove( index ); + tmp.add( index, new ModelProperty( ProjectUri.Scm.developerConnection, scmDeveloperUrl.toString() ) ); + } + + + //Remove Plugin Repository Inheritance Rule + //Project Name Inheritance Rule + //Packaging Inheritance Rule + //Build Resources Inheritence Rule + //Build Test Resources Inheritance Rule + //Profiles not inherited rule + for ( ModelProperty mp : tmp ) + { + String uri = mp.getUri(); + if ( domainModels.indexOf( domainModel ) > 0 && ( uri.equals( ProjectUri.name ) || + uri.equals( ProjectUri.packaging ) || uri.startsWith( ProjectUri.Profiles.xUri ) || + uri.startsWith( ProjectUri.Build.Resources.xUri ) || + uri.startsWith( ProjectUri.Build.TestResources.xUri ) || + uri.startsWith( ProjectUri.PluginRepositories.xUri ) ) ) + { + clearedProperties.add( mp ); + } + } + ModelProperty artifactId = getPropertyFor( ProjectUri.artifactId, tmp ); + if ( artifactId != null ) + { + projectNames.add( 0, artifactId.getValue() ); + } + + tmp.removeAll( clearedProperties ); + modelProperties.addAll( tmp ); + + if ( domainModels.indexOf( domainModel ) > 0 ) + { + //cache.put( pomDomainModel.getId(), modelProperties ); + } + + //Remove Parent Info + /* + for (ModelProperty mp : tmp) { + if (mp.getUri().startsWith(ProjectUri.Parent.xUri)) { + modelProperties.remove(mp); + } + } + */ + } + return modelProperties; + } + + /** + * Returns the base uri of all model properties: http://apache.org/maven/project/ + * + * @return Returns the base uri of all model properties: http://apache.org/maven/project/ + */ + public String getBaseUri() + { + return ProjectUri.baseUri; + } + + /** + * Returns all model properties containing the specified uri from the specified properties list. + * + * @param uri the uri to use in finding the returned model properties + * @param properties the model properties list to search + * @return all model properties containing the specified uri from the specified properties list + */ + private static List getPropertiesFor( String uri, List properties ) + { + List modelProperties = new ArrayList(); + for ( ModelProperty mp : properties ) + { + if ( uri.equals( mp.getUri() ) ) + { + modelProperties.add( mp ); + } + } + return modelProperties; + } + + + /** + * Returns the first model property containing the specified uri from the specified properties list. + * + * @param uri the uri to use in finding the returned model property + * @param properties the model properties list to search + * @return the first model property containing the specified uri from the specified properties list. + */ + private static ModelProperty getPropertyFor( String uri, List properties ) + { + for ( ModelProperty mp : properties ) + { + if ( uri.equals( mp.getUri() ) ) + { + return mp; + } + } + return null; + } +} + diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/ProjectBuilder.java b/maven-project/src/main/java/org/apache/maven/project/builder/ProjectBuilder.java new file mode 100644 index 0000000000..484b299933 --- /dev/null +++ b/maven-project/src/main/java/org/apache/maven/project/builder/ProjectBuilder.java @@ -0,0 +1,56 @@ +package org.apache.maven.project.builder; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * 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.Model; +import org.apache.maven.project.MavenProject; +import org.apache.maven.shared.model.InterpolatorProperty; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Collection; +import java.util.List; + +/** + * Provides services for building maven projects from models. + */ +public interface ProjectBuilder +{ + + String ROLE = ProjectBuilder.class.getName(); + + /** + * Returns a maven project for the specified input stream. + * + * @param pom input stream of the model + * @param inheritedModels list of models containing additional parent models in order from most to least specialized + * @param interpolatorProperties properties used for interpolation of properties within the model + * @param resolver artifact resolver used in resolving artifacts + * @param baseDirectory the base directory of the model + * @return a maven project for the specified input stream + * @throws IOException if there is a problem in the construction of the maven project + */ + MavenProject buildFromLocalPath( InputStream pom, List inheritedModels, + Collection interpolatorProperties, + PomArtifactResolver resolver, File baseDirectory ) + throws IOException; + +} diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/ProjectUri.java b/maven-project/src/main/java/org/apache/maven/project/builder/ProjectUri.java new file mode 100644 index 0000000000..feed163855 --- /dev/null +++ b/maven-project/src/main/java/org/apache/maven/project/builder/ProjectUri.java @@ -0,0 +1,1666 @@ +package org.apache.maven.project.builder; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * 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. + */ + +/** + * Defines all the unique ids for canonical data model. + */ +public class ProjectUri +{ + public static String baseUri = "http://apache.org/maven"; + + public static String xUri = "http://apache.org/maven/project"; + + public static class Parent + { + public static String xUri = "http://apache.org/maven/project/parent"; + + public static String artifactId = "http://apache.org/maven/project/parent/artifactId"; + + public static String groupId = "http://apache.org/maven/project/parent/groupId"; + + public static String version = "http://apache.org/maven/project/parent/version"; + + public static String relativePath = "http://apache.org/maven/project/parent/relativePath"; + } + + public static String modelVersion = "http://apache.org/maven/project/modelVersion"; + + public static String groupId = "http://apache.org/maven/project/groupId"; + + public static String artifactId = "http://apache.org/maven/project/artifactId"; + + public static String packaging = "http://apache.org/maven/project/packaging"; + + public static String name = "http://apache.org/maven/project/name"; + + public static String version = "http://apache.org/maven/project/version"; + + public static String description = "http://apache.org/maven/project/description"; + + public static String url = "http://apache.org/maven/project/url"; + + public static class Prerequisites + { + public static String xUri = "http://apache.org/maven/project/prerequisites"; + + public static String maven = "http://apache.org/maven/project/prerequisites/maven"; + } + + public static class IssueManagement + { + public static String xUri = "http://apache.org/maven/project/issueManagement"; + + public static String system = "http://apache.org/maven/project/issueManagement/system"; + + public static String url = "http://apache.org/maven/project/issueManagement/url"; + } + + public static class CiManagement + { + public static String xUri = "http://apache.org/maven/project/ciManagement"; + + public static String system = "http://apache.org/maven/project/ciManagement/system"; + + public static String url = "http://apache.org/maven/project/ciManagement/url"; + + public static class Notifiers + { + public static String xUri = "http://apache.org/maven/project/ciManagement/notifiers#collection"; + + public static class Notifier + { + public static String xUri = + "http://apache.org/maven/project/ciManagement/notifiers#collection/notifier"; + + public static String type = + "http://apache.org/maven/project/ciManagement/notifiers#collection/notifier/type"; + + public static String sendOnError = + "http://apache.org/maven/project/ciManagement/notifiers#collection/notifier/sendOnError"; + + public static String sendOnFailure = + "http://apache.org/maven/project/ciManagement/notifiers#collection/notifier/sendOnFailure"; + + public static String sendOnSuccess = + "http://apache.org/maven/project/ciManagement/notifiers#collection/notifier/sendOnSuccess"; + + public static String sendOnWarning = + "http://apache.org/maven/project/ciManagement/notifiers#collection/notifier/sendOnWarning"; + + public static String address = + "http://apache.org/maven/project/ciManagement/notifiers#collection/notifier/address"; + + public static String configuration = + "http://apache.org/maven/project/ciManagement/notifiers#collection/notifier/configuration"; + } + } + } + + public static String inceptionYear = "http://apache.org/maven/project/inceptionYear"; + + public static class MailingLists + { + public static String xUri = "http://apache.org/maven/project/mailingLists#collection"; + + public static class MailingList + { + public static String xUri = "http://apache.org/maven/project/mailingLists#collection/mailingList"; + + public static String name = "http://apache.org/maven/project/mailingLists#collection/mailingList/name"; + + public static String subscribe = + "http://apache.org/maven/project/mailingLists#collection/mailingList/subscribe"; + + public static String unsubscribe = + "http://apache.org/maven/project/mailingLists#collection/mailingList/unsubscribe"; + + public static String post = "http://apache.org/maven/project/mailingLists#collection/mailingList/post"; + + public static String archive = + "http://apache.org/maven/project/mailingLists#collection/mailingList/archive"; + + public static String otherArchives = + "http://apache.org/maven/project/mailingLists#collection/mailingList/otherArchives"; + } + } + + public static class Developers + { + public static String xUri = "http://apache.org/maven/project/developers#collection"; + + public static class Developer + { + public static String xUri = "http://apache.org/maven/project/developers#collection/developer"; + + public static String id = "http://apache.org/maven/project/developers#collection/developer/id"; + + public static String name = "http://apache.org/maven/project/developers#collection/developer/name"; + + public static String email = "http://apache.org/maven/project/developers#collection/developer/email"; + + public static String url = "http://apache.org/maven/project/developers#collection/developer/url"; + + public static String organization = + "http://apache.org/maven/project/developers#collection/developer/organization"; + + public static String organizationUrl = + "http://apache.org/maven/project/developers#collection/developer/organizationUrl"; + + public static String roles = + "http://apache.org/maven/project/developers#collection/developer/roles#collection"; + + public static String timezone = "http://apache.org/maven/project/developers#collection/developer/timezone"; + + public static String properties = + "http://apache.org/maven/project/developers#collection/developer/properties"; + } + } + + public static class Contributors + { + public static String xUri = "http://apache.org/maven/project/contributors#collection"; + + public static class Contributor + { + public static String xUri = "http://apache.org/maven/project/contributors#collection/contributor"; + + public static String name = "http://apache.org/maven/project/contributors#collection/contributor/name"; + + public static String email = "http://apache.org/maven/project/contributors#collection/contributor/email"; + + public static String url = "http://apache.org/maven/project/contributors#collection/contributor/url"; + + public static String organization = + "http://apache.org/maven/project/contributors#collection/contributor/organization"; + + public static String organizationUrl = + "http://apache.org/maven/project/contributors#collection/contributor/organizationUrl"; + + public static String roles = + "http://apache.org/maven/project/contributors#collection/contributor/roles#collection"; + + public static String timezone = + "http://apache.org/maven/project/contributors#collection/contributor/timezone"; + + public static String properties = + "http://apache.org/maven/project/contributors#collection/contributor/properties"; + } + } + + public static class Licenses + { + public static String xUri = "http://apache.org/maven/project/licenses#collection"; + + public static class License + { + public static String xUri = "http://apache.org/maven/project/licenses#collection/license"; + + public static String name = "http://apache.org/maven/project/licenses#collection/license/name"; + + public static String url = "http://apache.org/maven/project/licenses#collection/license/url"; + + public static String distribution = + "http://apache.org/maven/project/licenses#collection/license/distribution"; + + public static String comments = "http://apache.org/maven/project/licenses#collection/license/comments"; + } + } + + public static class Scm + { + public static String xUri = "http://apache.org/maven/project/scm"; + + public static String connection = "http://apache.org/maven/project/scm/connection"; + + public static String developerConnection = "http://apache.org/maven/project/scm/developerConnection"; + + public static String tag = "http://apache.org/maven/project/scm/tag"; + + public static String url = "http://apache.org/maven/project/scm/url"; + } + + public static class Organization + { + public static String xUri = "http://apache.org/maven/project/organization"; + + public static String name = "http://apache.org/maven/project/organization/name"; + + public static String url = "http://apache.org/maven/project/organization/url"; + } + + public static class Build + { + public static String xUri = "http://apache.org/maven/project/build"; + + public static String sourceDirectory = "http://apache.org/maven/project/build/sourceDirectory"; + + public static String scriptSourceDirectory = "http://apache.org/maven/project/build/scriptSourceDirectory"; + + public static String testSourceDirectory = "http://apache.org/maven/project/build/testSourceDirectory"; + + public static String outputDirectory = "http://apache.org/maven/project/build/outputDirectory"; + + public static String testOutputDirectory = "http://apache.org/maven/project/build/testOutputDirectory"; + + public static class Extensions + { + public static String xUri = "http://apache.org/maven/project/build/extensions#collection"; + + public static class Extension + { + public static String xUri = "http://apache.org/maven/project/build/extensions#collection/extension"; + + public static String groupId = + "http://apache.org/maven/project/build/extensions#collection/extension/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/build/extensions#collection/extension/artifactId"; + + public static String version = + "http://apache.org/maven/project/build/extensions#collection/extension/version"; + } + } + + public static String defaultGoal = "http://apache.org/maven/project/build/defaultGoal"; + + public static class Resources + { + public static String xUri = "http://apache.org/maven/project/build/resources#collection"; + + public static class Resource + { + public static String xUri = "http://apache.org/maven/project/build/resources#collection/resource"; + + public static String targetPath = + "http://apache.org/maven/project/build/resources#collection/resource/targetPath"; + + public static String filtering = + "http://apache.org/maven/project/build/resources#collection/resource/filtering"; + + public static String directory = + "http://apache.org/maven/project/build/resources#collection/resource/directory"; + + public static String includes = + "http://apache.org/maven/project/build/resources#collection/resource/includes#collection"; + + public static String excludes = + "http://apache.org/maven/project/build/resources#collection/resource/excludes#collection"; + } + } + + public static class TestResources + { + public static String xUri = "http://apache.org/maven/project/build/testResources#collection"; + + public static class TestResource + { + public static String xUri = + "http://apache.org/maven/project/build/testResources#collection/testResource"; + + public static String targetPath = + "http://apache.org/maven/project/build/testResources#collection/testResource/targetPath"; + + public static String filtering = + "http://apache.org/maven/project/build/testResources#collection/testResource/filtering"; + + public static String directory = + "http://apache.org/maven/project/build/testResources#collection/testResource/directory"; + + public static String excludes = + "http://apache.org/maven/project/build/testResources#collection/testResource/excludes"; + + public static class Includes + { + public static String xUri = + "http://apache.org/maven/project/build/testResources#collection/testResource/includes"; + + public static String include = + "http://apache.org/maven/project/build/testResources#collection/testResource/includes/include"; + } + } + } + + public static String directory = "http://apache.org/maven/project/build/directory"; + + public static String finalName = "http://apache.org/maven/project/build/finalName"; + + public static String filters = "http://apache.org/maven/project/build/filters"; + + public static class PluginManagement + { + public static String xUri = "http://apache.org/maven/project/build/pluginManagement"; + + public static class Plugins + { + public static String xUri = "http://apache.org/maven/project/build/pluginManagement/plugins#collection"; + + public static class Plugin + { + public static String xUri = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin"; + + public static String groupId = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/artifactId"; + + public static String version = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/version"; + + public static String extensions = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/extensions"; + + public static class Executions + { + public static String xUri = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions"; + + public static class Execution + { + public static String xUri = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions/execution"; + + public static String id = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions/execution/id"; + + public static String phase = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions/execution/phase"; + + public static String goals = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions/execution/goals"; + + public static String inherited = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions/execution/inherited"; + + public static String configuration = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions/execution/configuration"; + } + } + + public static class Dependencies + { + public static String xUri = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies"; + + public static class Dependency + { + public static String xUri = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency"; + + public static String groupId = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/artifactId"; + + public static String version = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/version"; + + public static String type = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/type"; + + public static String classifier = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/classifier"; + + public static String scope = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/scope"; + + public static String systemPath = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/systemPath"; + + public static class Exclusions + { + public static String xUri = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/exclusions"; + + public static class Exclusion + { + public static String xUri = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/exclusions/exclusion"; + + public static String artifactId = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/exclusions/exclusion/artifactId"; + + public static String groupId = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/exclusions/exclusion/groupId"; + } + } + + public static String optional = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/optional"; + } + } + + public static String goals = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/goals"; + + public static String inherited = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/inherited"; + + public static String configuration = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/configuration#collection"; + } + } + } + + public static class Plugins + { + public static String xUri = "http://apache.org/maven/project/build/plugins#collection"; + + public static class Plugin + { + public static String xUri = "http://apache.org/maven/project/build/plugins#collection/plugin"; + + public static String groupId = + "http://apache.org/maven/project/build/plugins#collection/plugin/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/build/plugins#collection/plugin/artifactId"; + + public static String version = + "http://apache.org/maven/project/build/plugins#collection/plugin/version"; + + public static String extensions = + "http://apache.org/maven/project/build/plugins#collection/plugin/extensions"; + + public static class Executions + { + public static String xUri = + "http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection"; + + public static class Execution + { + public static String xUri = + "http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution"; + + public static String id = + "http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/id"; + + public static String phase = + "http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/phase"; + + public static String goals = + "http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/goals"; + + public static String inherited = + "http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/inherited"; + + public static String configuration = + "http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/configuration"; + } + } + + public static class Dependencies + { + public static String xUri = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection"; + + public static class Dependency + { + public static String xUri = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency"; + + public static String groupId = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/artifactId"; + + public static String version = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/version"; + + public static String type = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/type"; + + public static String classifier = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/classifier"; + + public static String scope = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/scope"; + + public static String systemPath = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/systemPath"; + + public static class Exclusions + { + public static String xUri = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions"; + + public static class Exclusion + { + public static String xUri = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions/exclusion"; + + public static String artifactId = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions/exclusion/artifactId"; + + public static String groupId = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions/exclusion/groupId"; + } + } + + public static String optional = + "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/optional"; + } + } + + public static String goals = "http://apache.org/maven/project/build/plugins#collection/plugin/goals"; + + public static String inherited = + "http://apache.org/maven/project/build/plugins#collection/plugin/inherited"; + + public static String configuration = + "http://apache.org/maven/project/build/plugins#collection/plugin/configuration#collection"; + } + } + } + + public static class Profiles + { + public static String xUri = "http://apache.org/maven/project/profiles#collection"; + + public static class Profile + { + public static String xUri = "http://apache.org/maven/project/profiles#collection/profile"; + + public static String id = "http://apache.org/maven/project/profiles#collection/profile/id"; + + public static class Activation + { + public static String xUri = "http://apache.org/maven/project/profiles#collection/profile/activation"; + + public static String activeByDefault = + "http://apache.org/maven/project/profiles#collection/profile/activation/activeByDefault"; + + public static String jdk = "http://apache.org/maven/project/profiles#collection/profile/activation/jdk"; + + public static class Os + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/activation/os"; + + public static String name = + "http://apache.org/maven/project/profiles#collection/profile/activation/os/name"; + + public static String family = + "http://apache.org/maven/project/profiles#collection/profile/activation/os/family"; + + public static String arch = + "http://apache.org/maven/project/profiles#collection/profile/activation/os/arch"; + + public static String version = + "http://apache.org/maven/project/profiles#collection/profile/activation/os/version"; + } + + public static class Property + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/activation/property"; + + public static String name = + "http://apache.org/maven/project/profiles#collection/profile/activation/property/name"; + + public static String value = + "http://apache.org/maven/project/profiles#collection/profile/activation/property/value"; + } + + public static class File + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/activation/file"; + + public static String missing = + "http://apache.org/maven/project/profiles#collection/profile/activation/file/missing"; + + public static String exists = + "http://apache.org/maven/project/profiles#collection/profile/activation/file/exists"; + } + } + + public static class Build + { + public static String xUri = "http://apache.org/maven/project/profiles#collection/profile/build"; + + public static String defaultGoal = + "http://apache.org/maven/project/profiles#collection/profile/build/defaultGoal"; + + public static class Resources + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/resources#collection"; + + public static class Resource + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/resources#collection/resource"; + + public static String targetPath = + "http://apache.org/maven/project/profiles#collection/profile/build/resources#collection/resource/targetPath"; + + public static String filtering = + "http://apache.org/maven/project/profiles#collection/profile/build/resources#collection/resource/filtering"; + + public static String directory = + "http://apache.org/maven/project/profiles#collection/profile/build/resources#collection/resource/directory"; + + public static String includes = + "http://apache.org/maven/project/profiles#collection/profile/build/resources#collection/resource/includes#collection"; + + public static String excludes = + "http://apache.org/maven/project/profiles#collection/profile/build/resources#collection/resource/excludes#collection"; + } + } + + public static class TestResources + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/testResources#collection"; + + public static class TestResource + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/testResources#collection/testResource"; + + public static String targetPath = + "http://apache.org/maven/project/profiles#collection/profile/build/testResources#collection/testResource/targetPath"; + + public static String filtering = + "http://apache.org/maven/project/profiles#collection/profile/build/testResources#collection/testResource/filtering"; + + public static String directory = + "http://apache.org/maven/project/profiles#collection/profile/build/testResources#collection/testResource/directory"; + + public static String includes = + "http://apache.org/maven/project/profiles#collection/profile/build/testResources#collection/testResource/includes#collection"; + + public static String excludes = + "http://apache.org/maven/project/profiles#collection/profile/build/testResources#collection/testResource/excludes#collection"; + + } + } + + public static String directory = + "http://apache.org/maven/project/profiles#collection/profile/build/directory"; + + public static String finalName = + "http://apache.org/maven/project/profiles#collection/profile/build/finalName"; + + public static String filters = + "http://apache.org/maven/project/profiles#collection/profile/build/filters"; + + public static class PluginManagement + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement"; + + public static class Plugins + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins"; + + public static class Plugin + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin"; + + public static String groupId = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/artifactId"; + + public static String version = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/version"; + + public static String extensions = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/extensions"; + + public static class Executions + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/executions"; + + public static class Execution + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/executions/execution"; + + public static String id = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/executions/execution/id"; + + public static String phase = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/executions/execution/phase"; + + public static String goals = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/executions/execution/goals"; + + public static String inherited = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/executions/execution/inherited"; + + public static String configuration = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/executions/execution/configuration"; + } + } + + public static class Dependencies + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies"; + + public static class Dependency + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency"; + + public static String groupId = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/artifactId"; + + public static String version = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/version"; + + public static String type = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/type"; + + public static String classifier = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/classifier"; + + public static String scope = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/scope"; + + public static String systemPath = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/systemPath"; + + public static class Exclusions + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/exclusions"; + + public static class Exclusion + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/exclusions/exclusion"; + + public static String artifactId = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/exclusions/exclusion/artifactId"; + + public static String groupId = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/exclusions/exclusion/groupId"; + } + } + + public static String optional = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/optional"; + } + } + + public static String goals = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/goals"; + + public static String inherited = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/inherited"; + + public static String configuration = + "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins/plugin/configuration"; + } + } + } + + public static class Plugins + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins"; + + public static class Plugin + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin"; + + public static String groupId = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/artifactId"; + + public static String version = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/version"; + + public static String extensions = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/extensions"; + + public static class Executions + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/executions"; + + public static class Execution + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/executions/execution"; + + public static String id = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/executions/execution/id"; + + public static String phase = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/executions/execution/phase"; + + public static String goals = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/executions/execution/goals"; + + public static String inherited = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/executions/execution/inherited"; + + public static String configuration = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/executions/execution/configuration"; + } + } + + public static class Dependencies + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies"; + + public static class Dependency + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency"; + + public static String groupId = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency/artifactId"; + + public static String version = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency/version"; + + public static String type = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency/type"; + + public static String classifier = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency/classifier"; + + public static String scope = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency/scope"; + + public static String systemPath = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency/systemPath"; + + public static class Exclusions + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency/exclusions"; + + public static class Exclusion + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency/exclusions/exclusion"; + + public static String artifactId = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency/exclusions/exclusion/artifactId"; + + public static String groupId = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency/exclusions/exclusion/groupId"; + } + } + + public static String optional = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/dependencies/dependency/optional"; + } + } + + public static String goals = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/goals"; + + public static String inherited = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/inherited"; + + public static String configuration = + "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/configuration"; + } + } + } + + public static String modules = "http://apache.org/maven/project/profiles#collection/profile/modules"; + + public static class Repositories + { + public static String xUri = "http://apache.org/maven/project/profiles#collection/profile/repositories"; + + public static class Repository + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository"; + + public static class Releases + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/releases"; + + public static String enabled = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/releases/enabled"; + + public static String updatePolicy = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/releases/updatePolicy"; + + public static String checksumPolicy = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/releases/checksumPolicy"; + } + + public static class Snapshots + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/snapshots"; + + public static String enabled = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/snapshots/enabled"; + + public static String updatePolicy = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/snapshots/updatePolicy"; + + public static String checksumPolicy = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/snapshots/checksumPolicy"; + } + + public static String id = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/id"; + + public static String name = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/name"; + + public static String url = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/url"; + + public static String layout = + "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/layout"; + } + } + + public static class PluginRepositories + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories"; + + public static class PluginRepository + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository"; + + public static class Releases + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/releases"; + + public static String enabled = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/releases/enabled"; + + public static String updatePolicy = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/releases/updatePolicy"; + + public static String checksumPolicy = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/releases/checksumPolicy"; + } + + public static class Snapshots + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/snapshots"; + + public static String enabled = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/snapshots/enabled"; + + public static String updatePolicy = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/snapshots/updatePolicy"; + + public static String checksumPolicy = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/snapshots/checksumPolicy"; + } + + public static String id = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/id"; + + public static String name = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/name"; + + public static String url = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/url"; + + public static String layout = + "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/layout"; + } + } + + public static class Dependencies + { + public static String xUri = "http://apache.org/maven/project/profiles#collection/profile/dependencies"; + + public static class Dependency + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency"; + + public static String groupId = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency/artifactId"; + + public static String version = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency/version"; + + public static String type = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency/type"; + + public static String classifier = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency/classifier"; + + public static String scope = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency/scope"; + + public static String systemPath = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency/systemPath"; + + public static class Exclusions + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency/exclusions"; + + public static class Exclusion + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency/exclusions/exclusion"; + + public static String artifactId = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency/exclusions/exclusion/artifactId"; + + public static String groupId = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency/exclusions/exclusion/groupId"; + } + } + + public static String optional = + "http://apache.org/maven/project/profiles#collection/profile/dependencies/dependency/optional"; + } + } + + public static String reports = "http://apache.org/maven/project/profiles#collection/profile/reports"; + + public static class Reporting + { + public static String xUri = "http://apache.org/maven/project/profiles#collection/profile/reporting"; + + public static String excludeDefaults = + "http://apache.org/maven/project/profiles#collection/profile/reporting/excludeDefaults"; + + public static String outputDirectory = + "http://apache.org/maven/project/profiles#collection/profile/reporting/outputDirectory"; + + public static class Plugins + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins"; + + public static class Plugin + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin"; + + public static String groupId = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/artifactId"; + + public static String version = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/version"; + + public static String inherited = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/inherited"; + + public static String configuration = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/configuration"; + + public static class ReportSets + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets"; + + public static class ReportSet + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets/reportSet"; + + public static String id = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets/reportSet/id"; + + public static String configuration = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets/reportSet/configuration"; + + public static String inherited = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets/reportSet/inherited"; + + public static String reports = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets/reportSet/reports"; + } + } + } + } + } + + public static class DependencyManagement + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement"; + + public static class Dependencies + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection"; + + public static class Dependency + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency"; + + public static String groupId = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/artifactId"; + + public static String version = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/version"; + + public static String type = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/type"; + + public static String classifier = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/classifier"; + + public static String scope = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/scope"; + + public static String systemPath = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/systemPath"; + + public static class Exclusions + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/exclusions"; + + public static class Exclusion + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/exclusions/exclusion"; + + public static String artifactId = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/exclusions/exclusion/artifactId"; + + public static String groupId = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/exclusions/exclusion/groupId"; + } + } + + public static String optional = + "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/optional"; + } + } + } + + public static class DistributionManagement + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement"; + + public static class Repository + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/repository"; + + public static String uniqueVersion = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/repository/uniqueVersion"; + + public static String id = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/repository/id"; + + public static String name = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/repository/name"; + + public static String url = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/repository/url"; + + public static String layout = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/repository/layout"; + } + + public static class SnapshotRepository + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/snapshotRepository"; + + public static String uniqueVersion = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/snapshotRepository/uniqueVersion"; + + public static String id = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/snapshotRepository/id"; + + public static String name = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/snapshotRepository/name"; + + public static String url = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/snapshotRepository/url"; + + public static String layout = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/snapshotRepository/layout"; + } + + public static class Site + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/site"; + + public static String id = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/site/id"; + + public static String name = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/site/name"; + + public static String url = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/site/url"; + } + + public static String downloadUrl = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/downloadUrl"; + + public static class Relocation + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/relocation"; + + public static String groupId = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/relocation/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/relocation/artifactId"; + + public static String version = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/relocation/version"; + + public static String message = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/relocation/message"; + } + + public static String status = + "http://apache.org/maven/project/profiles#collection/profile/distributionManagement/status"; + } + + public static String properties = "http://apache.org/maven/project/profiles#collection/profile/properties"; + } + } + + public static class Modules + { + public static String xUri = "http://apache.org/maven/project/modules#collection"; + + public static String module = "http://apache.org/maven/project/modules#collection/module"; + } + + public static class Repositories + { + public static String xUri = "http://apache.org/maven/project/repositories#collection"; + + public static class Repository + { + public static String xUri = "http://apache.org/maven/project/repositories#collection/repository"; + + public static class Releases + { + public static String xUri = + "http://apache.org/maven/project/repositories#collection/repository/releases"; + + public static String enabled = + "http://apache.org/maven/project/repositories#collection/repository/releases/enabled"; + + public static String updatePolicy = + "http://apache.org/maven/project/repositories#collection/repository/releases/updatePolicy"; + + public static String checksumPolicy = + "http://apache.org/maven/project/repositories#collection/repository/releases/checksumPolicy"; + } + + public static class Snapshots + { + public static String xUri = + "http://apache.org/maven/project/repositories#collection/repository/snapshots"; + + public static String enabled = + "http://apache.org/maven/project/repositories#collection/repository/snapshots/enabled"; + + public static String updatePolicy = + "http://apache.org/maven/project/repositories#collection/repository/snapshots/updatePolicy"; + + public static String checksumPolicy = + "http://apache.org/maven/project/repositories#collection/repository/snapshots/checksumPolicy"; + } + + public static String id = "http://apache.org/maven/project/repositories#collection/repository/id"; + + public static String name = "http://apache.org/maven/project/repositories#collection/repository/name"; + + public static String url = "http://apache.org/maven/project/repositories#collection/repository/url"; + + public static String layout = "http://apache.org/maven/project/repositories#collection/repository/layout"; + } + } + + public static class PluginRepositories + { + public static String xUri = "http://apache.org/maven/project/pluginRepositories#collection"; + + public static class PluginRepository + { + public static String xUri = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository"; + + public static class Releases + { + public static String xUri = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository/releases"; + + public static String enabled = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository/releases/enabled"; + + public static String updatePolicy = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository/releases/updatePolicy"; + + public static String checksumPolicy = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository/releases/checksumPolicy"; + } + + public static class Snapshots + { + public static String xUri = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository/snapshots"; + + public static String enabled = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository/snapshots/enabled"; + + public static String updatePolicy = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository/snapshots/updatePolicy"; + + public static String checksumPolicy = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository/snapshots/checksumPolicy"; + } + + public static String id = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository/id"; + + public static String name = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository/name"; + + public static String url = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository/url"; + + public static String layout = + "http://apache.org/maven/project/pluginRepositories#collection/pluginRepository/layout"; + } + } + + public static class Dependencies + { + public static String xUri = "http://apache.org/maven/project/dependencies#collection"; + + public static class Dependency + { + public static String xUri = "http://apache.org/maven/project/dependencies#collection/dependency"; + + public static String groupId = "http://apache.org/maven/project/dependencies#collection/dependency/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/dependencies#collection/dependency/artifactId"; + + public static String version = "http://apache.org/maven/project/dependencies#collection/dependency/version"; + + public static String type = "http://apache.org/maven/project/dependencies#collection/dependency/type"; + + public static String classifier = + "http://apache.org/maven/project/dependencies#collection/dependency/classifier"; + + public static String scope = "http://apache.org/maven/project/dependencies#collection/dependency/scope"; + + public static String systemPath = + "http://apache.org/maven/project/dependencies#collection/dependency/systemPath"; + + public static class Exclusions + { + public static String xUri = + "http://apache.org/maven/project/dependencies#collection/dependency/exclusions"; + + public static class Exclusion + { + public static String xUri = + "http://apache.org/maven/project/dependencies#collection/dependency/exclusions/exclusion"; + + public static String artifactId = + "http://apache.org/maven/project/dependencies#collection/dependency/exclusions/exclusion/artifactId"; + + public static String groupId = + "http://apache.org/maven/project/dependencies#collection/dependency/exclusions/exclusion/groupId"; + } + } + + public static String optional = + "http://apache.org/maven/project/dependencies#collection/dependency/optional"; + } + } + + public static String reports = "http://apache.org/maven/project/reports"; + + public static class Reporting + { + public static String xUri = "http://apache.org/maven/project/reporting"; + + public static String excludeDefaults = "http://apache.org/maven/project/reporting/excludeDefaults"; + + public static String outputDirectory = "http://apache.org/maven/project/reporting/outputDirectory"; + + public static class Plugins + { + public static String xUri = "http://apache.org/maven/project/reporting/plugins#collection"; + + public static class Plugin + { + public static String xUri = "http://apache.org/maven/project/reporting/plugins#collection/plugin"; + + public static String groupId = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/artifactId"; + + public static String version = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/version"; + + public static String inherited = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/inherited"; + + public static String configuration = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/configuration"; + + public static class ReportSets + { + public static String xUri = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets"; + + public static class ReportSet + { + public static String xUri = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets/reportSet"; + + public static String id = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets/reportSet/id"; + + public static String configuration = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets/reportSet/configuration"; + + public static String inherited = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets/reportSet/inherited"; + + public static String reports = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets/reportSet/reports"; + } + } + } + } + } + + public static class DependencyManagement + { + public static String xUri = "http://apache.org/maven/project/dependencyManagement"; + + public static class Dependencies + { + public static String xUri = "http://apache.org/maven/project/dependencyManagement/dependencies#collection"; + + public static class Dependency + { + public static String xUri = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency"; + + public static String groupId = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/artifactId"; + + public static String version = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/version"; + + public static String type = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/type"; + + public static String classifier = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/classifier"; + + public static String scope = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/scope"; + + public static String systemPath = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/systemPath"; + + public static class Exclusions + { + public static String xUri = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/exclusions"; + + public static class Exclusion + { + public static String xUri = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/exclusions/exclusion"; + + public static String artifactId = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/exclusions/exclusion/artifactId"; + + public static String groupId = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/exclusions/exclusion/groupId"; + } + } + + public static String optional = + "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/optional"; + } + } + } + + public static class DistributionManagement + { + public static String xUri = "http://apache.org/maven/project/distributionManagement"; + + public static class Repository + { + public static String xUri = "http://apache.org/maven/project/distributionManagement/repository"; + + public static String uniqueVersion = + "http://apache.org/maven/project/distributionManagement/repository/uniqueVersion"; + + public static String id = "http://apache.org/maven/project/distributionManagement/repository/id"; + + public static String name = "http://apache.org/maven/project/distributionManagement/repository/name"; + + public static String url = "http://apache.org/maven/project/distributionManagement/repository/url"; + + public static String layout = "http://apache.org/maven/project/distributionManagement/repository/layout"; + } + + public static class SnapshotRepository + { + public static String xUri = "http://apache.org/maven/project/distributionManagement/snapshotRepository"; + + public static String uniqueVersion = + "http://apache.org/maven/project/distributionManagement/snapshotRepository/uniqueVersion"; + + public static String id = "http://apache.org/maven/project/distributionManagement/snapshotRepository/id"; + + public static String name = + "http://apache.org/maven/project/distributionManagement/snapshotRepository/name"; + + public static String url = "http://apache.org/maven/project/distributionManagement/snapshotRepository/url"; + + public static String layout = + "http://apache.org/maven/project/distributionManagement/snapshotRepository/layout"; + } + + public static class Site + { + public static String xUri = "http://apache.org/maven/project/distributionManagement/site"; + + public static String id = "http://apache.org/maven/project/distributionManagement/site/id"; + + public static String name = "http://apache.org/maven/project/distributionManagement/site/name"; + + public static String url = "http://apache.org/maven/project/distributionManagement/site/url"; + } + + public static String downloadUrl = "http://apache.org/maven/project/distributionManagement/downloadUrl"; + + public static class Relocation + { + public static String xUri = "http://apache.org/maven/project/distributionManagement/relocation"; + + public static String groupId = "http://apache.org/maven/project/distributionManagement/relocation/groupId"; + + public static String artifactId = + "http://apache.org/maven/project/distributionManagement/relocation/artifactId"; + + public static String version = "http://apache.org/maven/project/distributionManagement/relocation/version"; + + public static String message = "http://apache.org/maven/project/distributionManagement/relocation/message"; + } + + public static String status = "http://apache.org/maven/project/distributionManagement/status"; + } + + public static String properties = "http://apache.org/maven/project/properties"; + +} diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java b/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java new file mode 100644 index 0000000000..b29a98cb53 --- /dev/null +++ b/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java @@ -0,0 +1,295 @@ +package org.apache.maven.project.builder.impl; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * 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.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.model.Model; +import org.apache.maven.model.Parent; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.builder.ArtifactModelContainerFactory; +import org.apache.maven.project.builder.IdModelContainerFactory; +import org.apache.maven.project.builder.PomArtifactResolver; +import org.apache.maven.project.builder.PomClassicDomainModel; +import org.apache.maven.project.builder.PomClassicTransformer; +import org.apache.maven.project.builder.ProjectBuilder; +import org.apache.maven.project.validation.ModelValidationResult; +import org.apache.maven.project.validation.ModelValidator; +import org.apache.maven.shared.model.DomainModel; +import org.apache.maven.shared.model.InterpolatorProperty; +import org.apache.maven.shared.model.ModelTransformerContext; +import org.codehaus.plexus.logging.LogEnabled; +import org.codehaus.plexus.logging.Logger; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +/** + * Default implementation of the project builder. + */ +public final class DefaultProjectBuilder + implements ProjectBuilder, LogEnabled +{ + + private ArtifactFactory artifactFactory; + + /** + * Logger instance + */ + private Logger logger; + + private ModelValidator validator; + + /** + * Default constructor + */ + public DefaultProjectBuilder() + { + } + + /** + * Constructor + * + * @param artifactFactory the artifact factory + */ + protected DefaultProjectBuilder( ArtifactFactory artifactFactory ) + { + if ( artifactFactory == null ) + { + throw new IllegalArgumentException( "artifactFactory: null" ); + } + this.artifactFactory = artifactFactory; + } + + /** + * @see ProjectBuilder#buildFromLocalPath(java.io.InputStream, java.util.List, java.util.Collection, org.apache.maven.project.builder.PomArtifactResolver, java.io.File) + */ + public MavenProject buildFromLocalPath( InputStream pom, List inheritedModels, + Collection interpolatorProperties, + PomArtifactResolver resolver, File projectDirectory ) + throws IOException + { + if ( pom == null ) + { + throw new IllegalArgumentException( "pom: null" ); + } + + if ( resolver == null ) + { + throw new IllegalArgumentException( "resolver: null" ); + } + + if ( projectDirectory == null ) + { + throw new IllegalArgumentException( "projectDirectory: null" ); + } + + if ( inheritedModels == null ) + { + inheritedModels = new ArrayList(); + } + else + { + inheritedModels = new ArrayList( inheritedModels ); + Collections.reverse( inheritedModels ); + } + + List properties; + if ( interpolatorProperties == null ) + { + properties = new ArrayList(); + } + else + { + properties = new ArrayList( interpolatorProperties ); + } + + PomClassicDomainModel domainModel = new PomClassicDomainModel( pom ); + List domainModels = new ArrayList(); + domainModels.add( domainModel ); + + if ( domainModel.getModel().getParent() != null ) + { + if ( isParentLocal( domainModel.getModel().getParent(), projectDirectory ) ) + { + domainModels.addAll( getDomainModelParentsFromLocalPath( domainModel, resolver, projectDirectory ) ); + } + else + { + domainModels.addAll( getDomainModelParentsFromRepository( domainModel, resolver ) ); + } + } + + for ( Model model : inheritedModels ) + { + domainModels.add( new PomClassicDomainModel( model ) ); + } + + PomClassicTransformer transformer = new PomClassicTransformer(); + ModelTransformerContext ctx = new ModelTransformerContext( + Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) ); + + PomClassicDomainModel transformedDomainModel = + ( (PomClassicDomainModel) ctx.transform( domainModels, transformer, transformer, properties ) ); + Model model = transformedDomainModel.getModel(); + return new MavenProject( model ); + } + + private boolean isParentLocal( Parent parent, File projectDirectory ) + { + try + { + File f = new File( projectDirectory, parent.getRelativePath() ).getCanonicalFile(); + if ( f.isDirectory() ) + { + f = new File( f, "pom.xml" ); + } + return f.exists(); + } + catch ( IOException e ) + { + e.printStackTrace(); + return false; + } + } + + private List getDomainModelParentsFromRepository( PomClassicDomainModel domainModel, + PomArtifactResolver artifactResolver ) + throws IOException + { + if ( artifactFactory == null ) + { + throw new IllegalArgumentException( "artifactFactory: not initialized" ); + } + + List domainModels = new ArrayList(); + + Parent parent = domainModel.getModel().getParent(); + + if ( parent == null ) + { + return domainModels; + } + + Artifact artifactParent = + artifactFactory.createParentArtifact( parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); + artifactResolver.resolve( artifactParent ); + + PomClassicDomainModel parentDomainModel = + new PomClassicDomainModel( new FileInputStream( artifactParent.getFile() ) ); + if ( !parentDomainModel.matchesParent( domainModel.getModel().getParent() ) ) + { + logger.warn( "Parent pom ids do not match: File = " + artifactParent.getFile().getAbsolutePath() ); + return domainModels; + } + else + { + // logger.info("Adding pom to hierarchy: Group Id = " + parent.getGroupId() + ", Artifact Id =" + // + parent.getArtifactId() + ", Version = " + parent.getVersion() + ", File" + artifactParent.getFile()); + } + + domainModels.add( parentDomainModel ); + domainModels.addAll( getDomainModelParentsFromRepository( parentDomainModel, artifactResolver ) ); + return domainModels; + } + + + private List getDomainModelParentsFromLocalPath( PomClassicDomainModel domainModel, + PomArtifactResolver artifactResolver, + File projectDirectory ) + throws IOException + { + + if ( artifactFactory == null ) + { + throw new IllegalArgumentException( "artifactFactory: not initialized" ); + } + + List domainModels = new ArrayList(); + + Parent parent = domainModel.getModel().getParent(); + + if ( parent == null ) + { + return domainModels; + } + + Model model = domainModel.getModel(); + + File parentFile = new File( projectDirectory, model.getParent().getRelativePath() ).getCanonicalFile(); + if ( parentFile.isDirectory() ) + { + parentFile = new File( parentFile.getAbsolutePath(), "pom.xml" ); + } + + if ( !parentFile.exists() ) + { + throw new IOException( "File does not exist: File =" + parentFile.getAbsolutePath() ); + } + + PomClassicDomainModel parentDomainModel = new PomClassicDomainModel( new FileInputStream( parentFile ) ); + if ( !parentDomainModel.matchesParent( domainModel.getModel().getParent() ) ) + { + logger.warn( "Parent pom ids do not match: File = " + parentFile.getAbsolutePath() ); + } + + domainModels.add( parentDomainModel ); + if ( parentDomainModel.getModel().getParent() != null ) + { + if ( isParentLocal( parentDomainModel.getModel().getParent(), parentFile.getParentFile() ) ) + { + domainModels.addAll( getDomainModelParentsFromLocalPath( parentDomainModel, artifactResolver, + parentFile.getParentFile() ) ); + } + else + { + domainModels.addAll( getDomainModelParentsFromRepository( parentDomainModel, artifactResolver ) ); + } + } + + return domainModels; + } + + + public void enableLogging( Logger logger ) + { + this.logger = logger; + } + + private void validateModel( Model model ) + throws IOException + { + ModelValidationResult validationResult = validator.validate( model ); + + if ( validationResult.getMessageCount() > 0 ) + { + throw new IOException( "Failed to validate: " + validationResult.toString() ); + } + } + + +} diff --git a/maven-project/src/main/resources/META-INF/plexus/components.xml b/maven-project/src/main/resources/META-INF/plexus/components.xml index 78b4b6ae68..3728658765 100644 --- a/maven-project/src/main/resources/META-INF/plexus/components.xml +++ b/maven-project/src/main/resources/META-INF/plexus/components.xml @@ -110,11 +110,24 @@ under the License. | | --> + + org.apache.maven.project.builder.ProjectBuilder + default + org.apache.maven.project.builder.impl.DefaultProjectBuilder + + + org.apache.maven.artifact.factory.ArtifactFactory + + + org.apache.maven.project.MavenProjectBuilder default org.apache.maven.project.DefaultMavenProjectBuilder + + org.apache.maven.project.builder.ProjectBuilder + org.apache.maven.project.workspace.ProjectWorkspace diff --git a/maven-project/src/test/java/org/apache/maven/project/inheritance/AbstractProjectInheritanceTestCase.java b/maven-project/src/test/java/org/apache/maven/project/inheritance/AbstractProjectInheritanceTestCase.java index 956ab07fb4..ed74bd1aea 100644 --- a/maven-project/src/test/java/org/apache/maven/project/inheritance/AbstractProjectInheritanceTestCase.java +++ b/maven-project/src/test/java/org/apache/maven/project/inheritance/AbstractProjectInheritanceTestCase.java @@ -53,6 +53,6 @@ public abstract class AbstractProjectInheritanceTestCase protected File getLocalRepositoryPath() { - return getTestFile( "src/test/resources/inheritance-repo/" + getTestSeries() ); + return getTestFile("src/test/resources/inheritance-repo/" + getTestSeries() ); } } diff --git a/maven-project/src/test/java/org/apache/maven/project/inheritance/t12scm/ProjectInheritanceTest.java b/maven-project/src/test/java/org/apache/maven/project/inheritance/t12scm/ProjectInheritanceTest.java index 2b2450a500..df19eadcea 100644 --- a/maven-project/src/test/java/org/apache/maven/project/inheritance/t12scm/ProjectInheritanceTest.java +++ b/maven-project/src/test/java/org/apache/maven/project/inheritance/t12scm/ProjectInheritanceTest.java @@ -69,12 +69,12 @@ public class ProjectInheritanceTest System.out.println( "Child SCM developer connection is: " + project1.getScm().getDeveloperConnection() ); - assertEquals( project1.getScm().getUrl(), project0.getScm().getUrl() + "/modules/p1" ); + assertEquals( project1.getScm().getUrl(), project0.getScm().getUrl() + "/p1" ); assertEquals( project1.getScm().getConnection(), project0.getScm().getConnection() - + "/modules/p1" ); + + "/p1" ); assertEquals( project1.getScm().getDeveloperConnection(), project0.getScm() .getDeveloperConnection() - + "/modules/p1" ); + + "/p1" ); } public void testScmInfoCalculatedCorrectlyOnChildOnlyRead() @@ -93,10 +93,10 @@ public class ProjectInheritanceTest System.out.println( "Child SCM developer connection is: " + project1.getScm().getDeveloperConnection() ); - assertEquals( project1.getScm().getUrl(), "http://host/viewer?path=/p0/modules/p1" ); - assertEquals( project1.getScm().getConnection(), "scm:svn:http://host/p0/modules/p1" ); + assertEquals( project1.getScm().getUrl(), "http://host/viewer?path=/p0/p1" ); + assertEquals( project1.getScm().getConnection(), "scm:svn:http://host/p0/p1" ); assertEquals( project1.getScm().getDeveloperConnection(), - "scm:svn:https://host/p0/modules/p1" ); + "scm:svn:https://host/p0/p1" ); } // public void testScmInfoCalculatedCorrectlyOnChildReadFromLocalRepository() diff --git a/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml b/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml index e74455e1c7..9e24d8da1f 100644 --- a/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml +++ b/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml @@ -75,11 +75,24 @@ under the License. + + org.apache.maven.project.builder.ProjectBuilder + default + org.apache.maven.project.builder.impl.DefaultProjectBuilder + + + org.apache.maven.artifact.factory.ArtifactFactory + + + org.apache.maven.project.MavenProjectBuilder test org.apache.maven.project.TestProjectBuilder + + org.apache.maven.project.builder.ProjectBuilder + org.apache.maven.project.workspace.ProjectWorkspace diff --git a/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml b/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml index b76f324e0a..93376a933f 100644 --- a/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml +++ b/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml @@ -73,11 +73,24 @@ under the License. + + org.apache.maven.project.builder.ProjectBuilder + default + org.apache.maven.project.builder.impl.DefaultProjectBuilder + + + org.apache.maven.artifact.factory.ArtifactFactory + + + org.apache.maven.project.MavenProjectBuilder test org.apache.maven.project.TestProjectBuilder + + org.apache.maven.project.builder.ProjectBuilder + org.apache.maven.project.workspace.ProjectWorkspace diff --git a/pom.xml b/pom.xml index d25ecbc7b6..8b38b1a965 100644 --- a/pom.xml +++ b/pom.xml @@ -1,20 +1,20 @@ - + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.apache.maven @@ -32,14 +32,15 @@ publication, and distribution publication are all controlled from the declarative file. Maven can be extended by plugins to utilise a number of other development tools for reporting or the build - process. + process. + http://maven.apache.org/ 2001 jira http://jira.codehaus.org/browse/MNG - + @@ -271,8 +272,10 @@ 1.1 1.5.5 1.0-beta-3 + 1.0-SNAPSHOT + 3.2.6 - + @@ -367,7 +370,7 @@ plexus-component-api - + org.apache.maven.wagon @@ -404,6 +407,16 @@ doxia-sink-api ${doxiaVersion} + + org.apache.maven.shared + maven-shared-model + ${mavenSharedModel} + + + org.codehaus.woodstox + wstx-asl + ${woodstoxVersion} + easymock easymock @@ -424,7 +437,7 @@ commons-logging - + aspectj