diff --git a/maven-core/src/test/java/org/apache/maven/execution/ProjectSorterTest.java b/maven-core/src/test/java/org/apache/maven/execution/ProjectSorterTest.java index af50f9dcef..996a3f8a57 100644 --- a/maven-core/src/test/java/org/apache/maven/execution/ProjectSorterTest.java +++ b/maven-core/src/test/java/org/apache/maven/execution/ProjectSorterTest.java @@ -1,161 +1,161 @@ -package org.apache.maven.execution; - -/* - * 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 junit.framework.TestCase; -import org.apache.maven.model.Build; -import org.apache.maven.model.Dependency; -import org.apache.maven.model.Extension; -import org.apache.maven.model.Model; -import org.apache.maven.execution.DuplicateProjectException; -import org.apache.maven.project.MavenProject; -import org.codehaus.plexus.util.dag.CycleDetectedException; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * Test sorting projects by dependencies. - * - * @author Brett Porter - * @version $Id: ProjectSorterTest.java 513038 2007-02-28 22:54:19Z jvanzyl $ - */ -public class ProjectSorterTest - extends TestCase -{ - - public void testShouldNotFailWhenProjectReferencesNonExistentProject() - throws CycleDetectedException, DuplicateProjectException - { - MavenProject project = createProject( "group", "artifact", "1.0" ); - Model model = project.getModel(); - - Build build = model.getBuild(); - - if ( build == null ) - { - build = new Build(); - model.setBuild( build ); - } - - Extension extension = new Extension(); - - extension.setArtifactId( "other-artifact" ); - extension.setGroupId( "other.group" ); - extension.setVersion( "1.0" ); - - build.addExtension( extension ); - - new ReactorManager.ProjectSorter( Collections.singletonList( project ) ); - } - - public void testMatchingArtifactIdsDifferentGroupIds() - throws CycleDetectedException, DuplicateProjectException - { - List projects = new ArrayList(); - MavenProject project1 = createProject( "groupId1", "artifactId", "1.0" ); - projects.add( project1 ); - MavenProject project2 = createProject( "groupId2", "artifactId", "1.0" ); - projects.add( project2 ); - project1.getDependencies().add( createDependency( project2 ) ); - - projects = new ReactorManager.ProjectSorter( projects ).getSortedProjects(); - - assertEquals( project2, projects.get( 0 ) ); - assertEquals( project1, projects.get( 1 ) ); - } - - public void testMatchingGroupIdsDifferentArtifactIds() - throws CycleDetectedException, DuplicateProjectException - { - List projects = new ArrayList(); - MavenProject project1 = createProject( "groupId", "artifactId1", "1.0" ); - projects.add( project1 ); - MavenProject project2 = createProject( "groupId", "artifactId2", "1.0" ); - projects.add( project2 ); - project1.getDependencies().add( createDependency( project2 ) ); - - projects = new ReactorManager.ProjectSorter( projects ).getSortedProjects(); - - assertEquals( project2, projects.get( 0 ) ); - assertEquals( project1, projects.get( 1 ) ); - } - - public void testMatchingIdsAndVersions() - throws CycleDetectedException - { - List projects = new ArrayList(); - MavenProject project1 = createProject( "groupId", "artifactId", "1.0" ); - projects.add( project1 ); - MavenProject project2 = createProject( "groupId", "artifactId", "1.0" ); - projects.add( project2 ); - - try - { - projects = new ReactorManager.ProjectSorter( projects ).getSortedProjects(); - fail( "Duplicate projects should fail" ); - } - catch ( DuplicateProjectException e ) - { - // expected - assertTrue( true ); - } - } - - public void testMatchingIdsAndDifferentVersions() - throws CycleDetectedException - { - List projects = new ArrayList(); - MavenProject project1 = createProject( "groupId", "artifactId", "1.0" ); - projects.add( project1 ); - MavenProject project2 = createProject( "groupId", "artifactId", "2.0" ); - projects.add( project2 ); - - try - { - projects = new ReactorManager.ProjectSorter( projects ).getSortedProjects(); - fail( "Duplicate projects should fail" ); - } - catch ( DuplicateProjectException e ) - { - // expected - assertTrue( true ); - } - } - - private Dependency createDependency( MavenProject project ) - { - Dependency depdendency = new Dependency(); - depdendency.setArtifactId( project.getArtifactId() ); - depdendency.setGroupId( project.getGroupId() ); - depdendency.setVersion( project.getVersion() ); - return depdendency; - } - - private static MavenProject createProject( String groupId, String artifactId, String version ) - { - Model model = new Model(); - model.setGroupId( groupId ); - model.setArtifactId( artifactId ); - model.setVersion( version ); - return new MavenProject( model ); - } -} +package org.apache.maven.execution; + +/* + * 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 junit.framework.TestCase; +import org.apache.maven.model.Build; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Extension; +import org.apache.maven.model.Model; +import org.apache.maven.execution.DuplicateProjectException; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.dag.CycleDetectedException; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Test sorting projects by dependencies. + * + * @author Brett Porter + * @version $Id: ProjectSorterTest.java 513038 2007-02-28 22:54:19Z jvanzyl $ + */ +public class ProjectSorterTest + extends TestCase +{ + + public void testShouldNotFailWhenProjectReferencesNonExistentProject() + throws CycleDetectedException, DuplicateProjectException + { + MavenProject project = createProject( "group", "artifact", "1.0" ); + Model model = project.getModel(); + + Build build = model.getBuild(); + + if ( build == null ) + { + build = new Build(); + model.setBuild( build ); + } + + Extension extension = new Extension(); + + extension.setArtifactId( "other-artifact" ); + extension.setGroupId( "other.group" ); + extension.setVersion( "1.0" ); + + build.addExtension( extension ); + + new ReactorManager.ProjectSorter( Collections.singletonList( project ) ); + } + + public void testMatchingArtifactIdsDifferentGroupIds() + throws CycleDetectedException, DuplicateProjectException + { + List projects = new ArrayList(); + MavenProject project1 = createProject( "groupId1", "artifactId", "1.0" ); + projects.add( project1 ); + MavenProject project2 = createProject( "groupId2", "artifactId", "1.0" ); + projects.add( project2 ); + project1.getDependencies().add( createDependency( project2 ) ); + + projects = new ReactorManager.ProjectSorter( projects ).getSortedProjects(); + + assertEquals( project2, projects.get( 0 ) ); + assertEquals( project1, projects.get( 1 ) ); + } + + public void testMatchingGroupIdsDifferentArtifactIds() + throws CycleDetectedException, DuplicateProjectException + { + List projects = new ArrayList(); + MavenProject project1 = createProject( "groupId", "artifactId1", "1.0" ); + projects.add( project1 ); + MavenProject project2 = createProject( "groupId", "artifactId2", "1.0" ); + projects.add( project2 ); + project1.getDependencies().add( createDependency( project2 ) ); + + projects = new ReactorManager.ProjectSorter( projects ).getSortedProjects(); + + assertEquals( project2, projects.get( 0 ) ); + assertEquals( project1, projects.get( 1 ) ); + } + + public void testMatchingIdsAndVersions() + throws CycleDetectedException + { + List projects = new ArrayList(); + MavenProject project1 = createProject( "groupId", "artifactId", "1.0" ); + projects.add( project1 ); + MavenProject project2 = createProject( "groupId", "artifactId", "1.0" ); + projects.add( project2 ); + + try + { + projects = new ReactorManager.ProjectSorter( projects ).getSortedProjects(); + fail( "Duplicate projects should fail" ); + } + catch ( DuplicateProjectException e ) + { + // expected + assertTrue( true ); + } + } + + public void testMatchingIdsAndDifferentVersions() + throws CycleDetectedException + { + List projects = new ArrayList(); + MavenProject project1 = createProject( "groupId", "artifactId", "1.0" ); + projects.add( project1 ); + MavenProject project2 = createProject( "groupId", "artifactId", "2.0" ); + projects.add( project2 ); + + try + { + projects = new ReactorManager.ProjectSorter( projects ).getSortedProjects(); + fail( "Duplicate projects should fail" ); + } + catch ( DuplicateProjectException e ) + { + // expected + assertTrue( true ); + } + } + + private Dependency createDependency( MavenProject project ) + { + Dependency depdendency = new Dependency(); + depdendency.setArtifactId( project.getArtifactId() ); + depdendency.setGroupId( project.getGroupId() ); + depdendency.setVersion( project.getVersion() ); + return depdendency; + } + + private static MavenProject createProject( String groupId, String artifactId, String version ) + { + Model model = new Model(); + model.setGroupId( groupId ); + model.setArtifactId( artifactId ); + model.setVersion( version ); + return new MavenProject( model ); + } +} 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 index 072b383437..f11b532eb4 100644 --- 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 @@ -1,230 +1,230 @@ -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.Reporting.Plugins.Plugin.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 static String findBaseUriFrom( List modelProperties ) - { - String baseUri = null; - for ( ModelProperty mp : modelProperties ) - { - if ( baseUri == null || mp.getUri().length() < baseUri.length() ) - { - baseUri = mp.getUri(); - } - } - return baseUri; - } - - private ArtifactModelContainer( List properties ) - { - this.properties = new ArrayList( properties ); - this.properties = Collections.unmodifiableList( this.properties ); - String uri = findBaseUriFrom( this.properties ); - - for ( ModelProperty mp : this.properties ) - { - if ( version == null && mp.getUri().equals( uri + "/version" ) ) - { - this.version = mp.getResolvedValue(); - } - else if ( artifactId == null && mp.getUri().equals( uri + "/artifactId" ) ) - { - this.artifactId = mp.getResolvedValue(); - } - else if ( groupId == null && mp.getUri().equals( uri + "/groupId" ) ) - { - this.groupId = mp.getResolvedValue(); - } - else if ( type == null && mp.getUri().equals( ProjectUri.Dependencies.Dependency.type ) - || mp.getUri().equals(ProjectUri.DependencyManagement.Dependencies.Dependency.type) - || mp.getUri().equals(ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.Dependency.type) - || mp.getUri().equals(ProjectUri.Build.Plugins.Plugin.Dependencies.Dependency.type)) - { - this.type = mp.getResolvedValue(); - } - } - 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 ) - { - StringBuffer sb = new StringBuffer(); - for ( ModelProperty mp : properties ) - { - sb.append( mp ).append( "\r\n" ); - } - throw new IllegalArgumentException( "Properties does not contain artifact id. Group ID = " + groupId + - ", Version = " + version + ", Base = " + uri + ":\r\n" + sb ); - } - - 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 ) - { - if ( c.type.equals( type ) ) - { - return ModelContainerAction.JOIN; - } - else - { - return ModelContainerAction.NOP; - } - } - return ModelContainerAction.JOIN; - } - if ( version == null ) - { - if ( c.version == null ) - { - if ( c.type.equals( type ) ) - { - return ModelContainerAction.JOIN; - } - else - { - return ModelContainerAction.NOP; - } - } - return ModelContainerAction.JOIN; - } - 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(); - } - } -} +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.Reporting.Plugins.Plugin.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 static String findBaseUriFrom( List modelProperties ) + { + String baseUri = null; + for ( ModelProperty mp : modelProperties ) + { + if ( baseUri == null || mp.getUri().length() < baseUri.length() ) + { + baseUri = mp.getUri(); + } + } + return baseUri; + } + + private ArtifactModelContainer( List properties ) + { + this.properties = new ArrayList( properties ); + this.properties = Collections.unmodifiableList( this.properties ); + String uri = findBaseUriFrom( this.properties ); + + for ( ModelProperty mp : this.properties ) + { + if ( version == null && mp.getUri().equals( uri + "/version" ) ) + { + this.version = mp.getResolvedValue(); + } + else if ( artifactId == null && mp.getUri().equals( uri + "/artifactId" ) ) + { + this.artifactId = mp.getResolvedValue(); + } + else if ( groupId == null && mp.getUri().equals( uri + "/groupId" ) ) + { + this.groupId = mp.getResolvedValue(); + } + else if ( type == null && mp.getUri().equals( ProjectUri.Dependencies.Dependency.type ) + || mp.getUri().equals(ProjectUri.DependencyManagement.Dependencies.Dependency.type) + || mp.getUri().equals(ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.Dependency.type) + || mp.getUri().equals(ProjectUri.Build.Plugins.Plugin.Dependencies.Dependency.type)) + { + this.type = mp.getResolvedValue(); + } + } + 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 ) + { + StringBuffer sb = new StringBuffer(); + for ( ModelProperty mp : properties ) + { + sb.append( mp ).append( "\r\n" ); + } + throw new IllegalArgumentException( "Properties does not contain artifact id. Group ID = " + groupId + + ", Version = " + version + ", Base = " + uri + ":\r\n" + sb ); + } + + 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 ) + { + if ( c.type.equals( type ) ) + { + return ModelContainerAction.JOIN; + } + else + { + return ModelContainerAction.NOP; + } + } + return ModelContainerAction.JOIN; + } + if ( version == null ) + { + if ( c.version == null ) + { + if ( c.type.equals( type ) ) + { + return ModelContainerAction.JOIN; + } + else + { + return ModelContainerAction.NOP; + } + } + return ModelContainerAction.JOIN; + } + 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 index 25a9b45fab..96aa871da8 100644 --- 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 @@ -1,112 +1,112 @@ -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.Profiles.Profile.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.getResolvedValue(); - } - } - } - - 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; - } - } -} +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.Profiles.Profile.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.getResolvedValue(); + } + } + } + + 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 index 3b848b7a91..cc9f5fd11d 100644 --- 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 @@ -1,93 +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() ); - } - } -} +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 index cfb538a295..01a8dbed9a 100644 --- 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 @@ -1,307 +1,307 @@ -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.File; -import java.io.FileInputStream; -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; - - private File file; - - private File parentFile; - - private File projectDirectory; - - /** - * 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 = null; - MavenXpp3Writer writer = new MavenXpp3Writer(); - try - { - out = WriterFactory.newXmlWriter( baos ); - writer.write( out, model ); - } - finally - { - if ( out != null ) - { - 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 ); - } - - public PomClassicDomainModel( File file ) - throws IOException - { - this( new FileInputStream( file ) ); - this.file = file; - } - - public File getParentFile() - { - return parentFile; - } - - public void setParentFile( File parentFile ) - { - this.parentFile = parentFile; - } - - public void setProjectDirectory(File projectDirectory) - { - this.projectDirectory = projectDirectory; - } - - public File getProjectDirectory() - { - return projectDirectory; - } - - public boolean isPomInBuild() - { - return projectDirectory != null; - } - - /** - * 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() != null ) - ? model.getParent().getGroupId() - : model.getGroupId(); - String artifactId = ( model.getArtifactId() == null && model.getParent() != null ) - ? model.getParent().getArtifactId() - : model.getArtifactId(); - String version = ( model.getVersion() == null && model.getParent() != 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 ); - } - - /** - * @return file of pom. May be null. - */ - public File getFile() - { - return file; - } - - /** - * @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() ); - } - -} +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.File; +import java.io.FileInputStream; +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; + + private File file; + + private File parentFile; + + private File projectDirectory; + + /** + * 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 = null; + MavenXpp3Writer writer = new MavenXpp3Writer(); + try + { + out = WriterFactory.newXmlWriter( baos ); + writer.write( out, model ); + } + finally + { + if ( out != null ) + { + 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 ); + } + + public PomClassicDomainModel( File file ) + throws IOException + { + this( new FileInputStream( file ) ); + this.file = file; + } + + public File getParentFile() + { + return parentFile; + } + + public void setParentFile( File parentFile ) + { + this.parentFile = parentFile; + } + + public void setProjectDirectory(File projectDirectory) + { + this.projectDirectory = projectDirectory; + } + + public File getProjectDirectory() + { + return projectDirectory; + } + + public boolean isPomInBuild() + { + return projectDirectory != null; + } + + /** + * 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() != null ) + ? model.getParent().getGroupId() + : model.getGroupId(); + String artifactId = ( model.getArtifactId() == null && model.getParent() != null ) + ? model.getParent().getArtifactId() + : model.getArtifactId(); + String version = ( model.getVersion() == null && model.getParent() != 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 ); + } + + /** + * @return file of pom. May be null. + */ + public File getFile() + { + return file; + } + + /** + * @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 index c83ae9b5fd..3ace6b3e99 100644 --- 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 @@ -1,848 +1,848 @@ -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.model.Model; -import org.apache.maven.shared.model.*; -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.io.File; -import java.io.ByteArrayInputStream; -import java.util.*; - -/** - * 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 static Set uris = new HashSet( Arrays.asList( ProjectUri.Build.Extensions.xUri, - ProjectUri.Build.PluginManagement.Plugins.xUri, - ProjectUri.Build.PluginManagement.Plugins.Plugin.configuration, - ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.xUri, - ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.Dependency.Exclusions.xUri, - - ProjectUri.Build.Plugins.xUri, - ProjectUri.Build.Plugins.Plugin.configuration, - ProjectUri.Reporting.Plugins.xUri, - ProjectUri.Reporting.Plugins.Plugin.configuration, - ProjectUri.Build.Plugins.Plugin.Dependencies.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" ) ); - - private static Map> cache = new HashMap>(); - - private Collection profiles; - - //private static List cache = new ArrayList(); - - /** - * Default constructor - */ - public PomClassicTransformer( Collection profiles ) - { - this.profiles = profiles; - } - - /** - * @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( properties ); - - //dependency management - ModelDataSource source = new DefaultModelDataSource(); - source.init( props, Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) ); - - for ( ModelContainer dependencyContainer : source.queryFor( ProjectUri.Dependencies.Dependency.xUri ) ) - { - for ( ModelContainer managementContainer : source.queryFor( - ProjectUri.DependencyManagement.Dependencies.Dependency.xUri ) ) - { - managementContainer = new ArtifactModelContainerFactory().create( - transformDependencyManagement( managementContainer.getProperties() ) ); - ModelContainerAction action = dependencyContainer.containerAction( managementContainer ); - if ( action.equals( ModelContainerAction.JOIN ) || action.equals( ModelContainerAction.DELETE ) ) - { - source.join( dependencyContainer, managementContainer ); - } - } - } - - for ( ModelContainer dependencyContainer : source.queryFor( ProjectUri.Build.Plugins.Plugin.xUri ) ) - { - for ( ModelContainer managementContainer : source.queryFor( - ProjectUri.Build.PluginManagement.Plugins.Plugin.xUri ) ) - { - managementContainer = new ArtifactModelContainerFactory().create( - transformPluginManagement( managementContainer.getProperties() ) ); - - //Remove duplicate executions tags - boolean hasExecutionsTag = false; - for ( ModelProperty mp : dependencyContainer.getProperties() ) - { - if ( mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.Executions.xUri ) ) - { - hasExecutionsTag = true; - break; - } - } - List pList = new ArrayList(); - if ( !hasExecutionsTag ) - { - pList = managementContainer.getProperties(); - } - else - { - for ( ModelProperty mp : managementContainer.getProperties() ) - { - if ( !mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.Executions.xUri ) ) - { - pList.add( mp ); - } - } - } - managementContainer = new ArtifactModelContainerFactory().create( pList ); - - ModelContainerAction action = dependencyContainer.containerAction( managementContainer ); - if ( action.equals( ModelContainerAction.JOIN ) || action.equals( ModelContainerAction.DELETE ) ) - { - source.join( dependencyContainer, managementContainer ); - } - } - } - - props = source.getModelProperties(); - - //Rule: Do not join plugin executions without ids - Set removeProperties = new HashSet(); - ModelDataSource dataSource = new DefaultModelDataSource(); - dataSource.init( props, Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) ); - List containers = dataSource.queryFor( ProjectUri.Build.Plugins.Plugin.xUri ); - for ( ModelContainer pluginContainer : containers ) - { - ModelDataSource executionSource = new DefaultModelDataSource(); - executionSource.init( pluginContainer.getProperties(), - Arrays.asList( new ArtifactModelContainerFactory(), new PluginExecutionIdModelContainerFactory() ) ); - List executionContainers = - executionSource.queryFor( ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri ); - if ( executionContainers.size() < 2 ) - { - continue; - } - - boolean hasAtLeastOneWithoutId = true; - for ( ModelContainer executionContainer : executionContainers ) - { - if ( hasAtLeastOneWithoutId ) - { - hasAtLeastOneWithoutId = hasExecutionId( executionContainer ); - } - if ( !hasAtLeastOneWithoutId && !hasExecutionId( executionContainer ) && - executionContainers.indexOf( executionContainer ) > 0 ) - { - removeProperties.addAll( executionContainer.getProperties() ); - } - } - } - props.removeAll( removeProperties ); - - 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 siteUrl = new StringBuffer(); - StringBuffer scmUrl = new StringBuffer(); - StringBuffer scmConnectionUrl = new StringBuffer(); - StringBuffer scmDeveloperUrl = new StringBuffer(); - - boolean containsBuildResources = false; - boolean containsTestResources = false; - boolean containsPluginRepositories = false; - - 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.getResolvedValue() ) ); - } - } - - //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.getResolvedValue() ) ); - } - - } - - //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 PluginExecutionIdModelContainerFactory() ) ); - 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.getResolvedValue() != null && mp.getResolvedValue().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.getResolvedValue() != null && - mp.getResolvedValue().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 ); - } - - //Site Rule - - ModelProperty siteUrlProperty = getPropertyFor( ProjectUri.DistributionManagement.Site.url, tmp ); - if ( siteUrl.length() == 0 && siteUrlProperty != null ) - { - siteUrl.append( siteUrlProperty.getResolvedValue());//.substring(0, siteUrlProperty.getResolvedValue().lastIndexOf("/")) ); - for ( String projectName : projectNames ) - { - if(!siteUrl.toString().endsWith( "/")) { - siteUrl.append( "/" ); - } - siteUrl.append( projectName ); - } - int index = tmp.indexOf( siteUrlProperty ); - tmp.remove( index ); - tmp.add( index, new ModelProperty( ProjectUri.DistributionManagement.Site.url, siteUrl.toString() ) ); - } - //If DistributionManagement site URL is property, - //SCM Rule - ModelProperty scmUrlProperty = getPropertyFor( ProjectUri.Scm.url, tmp ); - if ( scmUrl.length() == 0 && scmUrlProperty != null ) - { - scmUrl.append( scmUrlProperty.getResolvedValue() ); - 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.getResolvedValue() ); - 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.getResolvedValue() ); - 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() ) ); - } - - //Project Name Inheritance Rule - //Packaging 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 ) ) ) - { - clearedProperties.add( mp ); - } - } - - //Remove Plugin Repository Inheritance Rule - //Build Resources Inheritence Rule - //Build Test Resources Inheritance Rule - //Only inherit IF: the above is contained in super pom (domainModels.size() -1) && the child doesn't has it's own respective field - if ( domainModels.indexOf( domainModel ) == 0 ) - { - containsBuildResources = hasProjectUri( ProjectUri.Build.Resources.xUri, tmp ); - containsTestResources = hasProjectUri( ProjectUri.Build.TestResources.xUri, tmp ); - containsPluginRepositories = hasProjectUri( ProjectUri.PluginRepositories.xUri, tmp ); - } - for ( ModelProperty mp : tmp ) - { - if ( domainModels.indexOf( domainModel ) > 0 ) - { - String uri = mp.getUri(); - boolean isNotSuperPom = domainModels.indexOf( domainModel ) != ( domainModels.size() - 1 ); - if ( isNotSuperPom ) - { - if ( uri.startsWith( ProjectUri.Build.Resources.xUri ) || - uri.startsWith( ProjectUri.Build.TestResources.xUri ) || - uri.startsWith( ProjectUri.PluginRepositories.xUri ) ) - { - clearedProperties.add( mp ); - } - } - else - { - if ( containsBuildResources && uri.startsWith( ProjectUri.Build.Resources.xUri ) ) - { - clearedProperties.add( mp ); - } - else if ( containsTestResources && uri.startsWith( ProjectUri.Build.TestResources.xUri ) ) - { - clearedProperties.add( mp ); - } - else if ( containsPluginRepositories && uri.startsWith( ProjectUri.PluginRepositories.xUri ) ) - { - clearedProperties.add( mp ); - } - } - } - } - - ModelProperty artifactId = getPropertyFor( ProjectUri.artifactId, tmp ); - if ( artifactId != null ) - { - projectNames.add( 0, artifactId.getResolvedValue() ); - } - - tmp.removeAll( clearedProperties ); - modelProperties.addAll( tmp ); - modelProperties.removeAll( clearedProperties ); - } - - //Rule: Build plugin config overrides reporting plugin config - ModelDataSource source = new DefaultModelDataSource(); - source.init( modelProperties, Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) ); - - List reportContainers = source.queryFor( ProjectUri.Reporting.Plugins.Plugin.xUri ); - for ( ModelContainer pluginContainer : source.queryFor( ProjectUri.Build.Plugins.Plugin.xUri ) ) - { - ModelContainer transformedReportContainer = new ArtifactModelContainerFactory().create( - transformPlugin( pluginContainer.getProperties() ) ); - - for(ModelContainer reportContainer : reportContainers) { - ModelContainerAction action = transformedReportContainer.containerAction( reportContainer ); - if ( action.equals( ModelContainerAction.JOIN ) ) - { - source.join( transformedReportContainer, reportContainer ); - break; - } - } - } - - modelProperties = source.getModelProperties(); - return modelProperties; - } - - public void interpolateModelProperties(List modelProperties, - List interpolatorProperties, - DomainModel domainModel) - throws IOException - { - interpolateModelProperties( modelProperties, interpolatorProperties, (PomClassicDomainModel) domainModel); - } - - public static String interpolateXmlString( String xml, List interpolatorProperties ) - throws IOException - { - List modelProperties = - ModelMarshaller.marshallXmlToModelProperties( new ByteArrayInputStream(xml.getBytes()), ProjectUri.baseUri, uris ); - - Map aliases = new HashMap(); - aliases.put( "project.", "pom."); - - List ips = new ArrayList(interpolatorProperties); - ips.addAll(ModelTransformerContext.createInterpolatorProperties(modelProperties, ProjectUri.baseUri, aliases, - PomInterpolatorTag.PROJECT_PROPERTIES.name(), false, false)); - - for(ModelProperty mp : modelProperties) - { - if(mp.getUri().startsWith(ProjectUri.properties) && mp.getValue() != null ) - { - String uri = mp.getUri(); - ips.add( new InterpolatorProperty( "${" + uri.substring( uri.lastIndexOf( "/" ) + 1, - uri.length() ) + "}", mp.getValue() ) ); - } - } - - ModelTransformerContext.interpolateModelProperties( modelProperties, ips ); - return ModelMarshaller.unmarshalModelPropertiesToXml( modelProperties, ProjectUri.baseUri ); - } - - public static String interpolateModelAsString(Model model, List interpolatorProperties, File projectDirectory) - throws IOException - { - PomClassicDomainModel domainModel = new PomClassicDomainModel( model ); - domainModel.setProjectDirectory( projectDirectory ); - List modelProperties = - ModelMarshaller.marshallXmlToModelProperties( domainModel.getInputStream(), ProjectUri.baseUri, uris ); - interpolateModelProperties( modelProperties, interpolatorProperties, domainModel); - - return ModelMarshaller.unmarshalModelPropertiesToXml( modelProperties, ProjectUri.baseUri ); - } - - public static Model interpolateModel(Model model, List interpolatorProperties, File projectDirectory) - throws IOException - { - String pomXml = interpolateModelAsString( model, interpolatorProperties, projectDirectory ); - PomClassicDomainModel domainModel = new PomClassicDomainModel( new ByteArrayInputStream( pomXml.getBytes() )); - return domainModel.getModel(); - } - - private static boolean containsProjectVersion( List interpolatorProperties ) - { - InterpolatorProperty versionInterpolatorProperty = - new ModelProperty( ProjectUri.version, "").asInterpolatorProperty( ProjectUri.baseUri); - for( InterpolatorProperty ip : interpolatorProperties) - { - if ( ip.equals( versionInterpolatorProperty ) ) - { - return true; - } - } - return false; - } - - private static void putProjectAliasIn(Map map, String s) - { - map.put( "\\$\\{project." + s + "\\}", "\\$\\{" + s + "\\}"); - } - - private static Map aliases = new HashMap(); - - static - { - aliases.put( "project.", "pom."); - aliases.put( "\\$\\{project.build.", "\\$\\{build."); - - List aliasList = Arrays.asList("artifactId", "groupId", "version", "packaging", "name", "description", - "url", "inceptionYear", "scm.url", "ciManagement.url", - "distributionManagement.repository.name", - "distributionManagement.site.url", - "reporting.outputDirectory", "parent.groupId", "parent.artifactId", - "parent.version", "prerequisites.maven", "issueManagement.url", "organization.name"); - for(String alias : aliasList) { - putProjectAliasIn(aliases, alias); - } - - } - - private static void interpolateModelProperties(List modelProperties, - List interpolatorProperties, - PomClassicDomainModel domainModel) - throws IOException - { - if(!containsProjectVersion(interpolatorProperties)) - { - aliases.put("\\$\\{project.version\\}", "\\$\\{version\\}"); - } - - List firstPassModelProperties = new ArrayList(); - List secondPassModelProperties = new ArrayList(); - - ModelProperty buildProperty = new ModelProperty(ProjectUri.Build.xUri, null); - for(ModelProperty mp : modelProperties) - { - if( mp.getValue() != null && !mp.getUri().contains( "#property" ) && !mp.getUri().contains( "#collection" )) - { - if( !buildProperty.isParentOf( mp ) || mp.getUri().equals(ProjectUri.Build.finalName ) ) - { - firstPassModelProperties.add(mp); - } - else - { - secondPassModelProperties.add(mp); - } - } - } - - - List standardInterpolatorProperties = new ArrayList(); - if(domainModel.isPomInBuild()) - { - String basedir = domainModel.getProjectDirectory().getAbsolutePath(); - standardInterpolatorProperties.add(new InterpolatorProperty("${project.basedir}", basedir, - PomInterpolatorTag.PROJECT_PROPERTIES.name() )); - standardInterpolatorProperties.add(new InterpolatorProperty("${basedir}", basedir, - PomInterpolatorTag.PROJECT_PROPERTIES.name() )); - standardInterpolatorProperties.add(new InterpolatorProperty("${pom.basedir}", basedir, - PomInterpolatorTag.PROJECT_PROPERTIES.name() )); - - } - - for(ModelProperty mp : modelProperties) - { - if(mp.getUri().startsWith(ProjectUri.properties) && mp.getValue() != null ) - { - String uri = mp.getUri(); - standardInterpolatorProperties.add( new InterpolatorProperty( "${" + uri.substring( uri.lastIndexOf( "/" ) + 1, - uri.length() ) + "}", mp.getValue(), PomInterpolatorTag.PROJECT_PROPERTIES.name() ) ); - } - } - - //FIRST PASS - Withhold using build directories as interpolator properties - List ips1 = new ArrayList(interpolatorProperties); - ips1.addAll(standardInterpolatorProperties); - ips1.addAll(ModelTransformerContext.createInterpolatorProperties(firstPassModelProperties, ProjectUri.baseUri, aliases, - PomInterpolatorTag.PROJECT_PROPERTIES.name(), false, false)); - Collections.sort(ips1, new Comparator() - { - public int compare(InterpolatorProperty o, InterpolatorProperty o1) { - return PomInterpolatorTag.valueOf(o.getTag()).compareTo(PomInterpolatorTag.valueOf(o1.getTag())); - } - }); - - ModelTransformerContext.interpolateModelProperties( modelProperties, ips1 ); - - //SECOND PASS - Set absolute paths on build directories - if( domainModel.isPomInBuild() ) - { String basedir = domainModel.getProjectDirectory().getAbsolutePath(); - Map buildDirectories = new HashMap(); - for(ModelProperty mp : secondPassModelProperties) - { - if(mp.getUri().equals( ProjectUri.Build.directory )) - { - File file = new File(mp.getResolvedValue()); - if( !file.isAbsolute() ) - { - buildDirectories.put(mp, new ModelProperty(mp.getUri(), new File(basedir, file.getPath()).getAbsolutePath())); - } - } - } - - for ( Map.Entry e : buildDirectories.entrySet() ) - { - secondPassModelProperties.remove( e.getKey() ); - secondPassModelProperties.add(e.getValue() ); - } - } - - //THIRD PASS - Use build directories as interpolator properties - List ips2 = new ArrayList(interpolatorProperties); - ips2.addAll(standardInterpolatorProperties); - ips2.addAll(ModelTransformerContext.createInterpolatorProperties(secondPassModelProperties, ProjectUri.baseUri, aliases, - PomInterpolatorTag.PROJECT_PROPERTIES.name(), false, false)); - ips2.addAll(interpolatorProperties); - Collections.sort(ips2, new Comparator() - { - public int compare(InterpolatorProperty o, InterpolatorProperty o1) { - return PomInterpolatorTag.valueOf(o.getTag()).compareTo(PomInterpolatorTag.valueOf(o1.getTag())); - } - }); - - ModelTransformerContext.interpolateModelProperties( modelProperties, ips2 ); - } - - private static boolean hasExecutionId( ModelContainer executionContainer ) - { - for ( ModelProperty mp : executionContainer.getProperties() ) - { - if ( mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.Executions.Execution.id ) ) - { - return true; - } - } - return false; - } - - /** - * 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; - } - - private static boolean hasProjectUri( String projectUri, List modelProperties ) - { - for ( ModelProperty mp : modelProperties ) - { - if ( mp.getUri().equals( projectUri ) ) - { - return true; - } - } - return false; - } - - /** - * 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; - } - - private static List transformDependencyManagement( List modelProperties ) - { - List transformedProperties = new ArrayList(); - for ( ModelProperty mp : modelProperties ) - { - if ( mp.getUri().startsWith( ProjectUri.DependencyManagement.xUri ) ) - { - transformedProperties.add( new ModelProperty( - mp.getUri().replace( ProjectUri.DependencyManagement.xUri, ProjectUri.xUri ), mp.getResolvedValue() ) ); - } - } - return transformedProperties; - } - - private static List transformPluginManagement( List modelProperties ) - { - List transformedProperties = new ArrayList(); - for ( ModelProperty mp : modelProperties ) - { - if ( mp.getUri().startsWith( ProjectUri.Build.PluginManagement.xUri ) ) - { - transformedProperties.add( new ModelProperty( - mp.getUri().replace( ProjectUri.Build.PluginManagement.xUri, ProjectUri.Build.xUri ), - mp.getResolvedValue() ) ); - } - } - return transformedProperties; - } - - private static List transformPlugin( List modelProperties ) - { - List transformedProperties = new ArrayList(); - for ( ModelProperty mp : modelProperties ) - { - if ( mp.getUri().startsWith( ProjectUri.Build.Plugins.xUri ) ) - { if(mp.getUri().startsWith(ProjectUri.Build.Plugins.Plugin.configuration) - || mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.groupId) - || mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.artifactId) - || mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.version) - || mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.xUri ) ) - { - transformedProperties.add( new ModelProperty( - mp.getUri().replace( ProjectUri.Build.Plugins.xUri, ProjectUri.Reporting.Plugins.xUri ), - mp.getResolvedValue() ) ); - } - - } - } - return transformedProperties; - } -} - +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.model.Model; +import org.apache.maven.shared.model.*; +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.io.File; +import java.io.ByteArrayInputStream; +import java.util.*; + +/** + * 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 static Set uris = new HashSet( Arrays.asList( ProjectUri.Build.Extensions.xUri, + ProjectUri.Build.PluginManagement.Plugins.xUri, + ProjectUri.Build.PluginManagement.Plugins.Plugin.configuration, + ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.xUri, + ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.Dependency.Exclusions.xUri, + + ProjectUri.Build.Plugins.xUri, + ProjectUri.Build.Plugins.Plugin.configuration, + ProjectUri.Reporting.Plugins.xUri, + ProjectUri.Reporting.Plugins.Plugin.configuration, + ProjectUri.Build.Plugins.Plugin.Dependencies.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" ) ); + + private static Map> cache = new HashMap>(); + + private Collection profiles; + + //private static List cache = new ArrayList(); + + /** + * Default constructor + */ + public PomClassicTransformer( Collection profiles ) + { + this.profiles = profiles; + } + + /** + * @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( properties ); + + //dependency management + ModelDataSource source = new DefaultModelDataSource(); + source.init( props, Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) ); + + for ( ModelContainer dependencyContainer : source.queryFor( ProjectUri.Dependencies.Dependency.xUri ) ) + { + for ( ModelContainer managementContainer : source.queryFor( + ProjectUri.DependencyManagement.Dependencies.Dependency.xUri ) ) + { + managementContainer = new ArtifactModelContainerFactory().create( + transformDependencyManagement( managementContainer.getProperties() ) ); + ModelContainerAction action = dependencyContainer.containerAction( managementContainer ); + if ( action.equals( ModelContainerAction.JOIN ) || action.equals( ModelContainerAction.DELETE ) ) + { + source.join( dependencyContainer, managementContainer ); + } + } + } + + for ( ModelContainer dependencyContainer : source.queryFor( ProjectUri.Build.Plugins.Plugin.xUri ) ) + { + for ( ModelContainer managementContainer : source.queryFor( + ProjectUri.Build.PluginManagement.Plugins.Plugin.xUri ) ) + { + managementContainer = new ArtifactModelContainerFactory().create( + transformPluginManagement( managementContainer.getProperties() ) ); + + //Remove duplicate executions tags + boolean hasExecutionsTag = false; + for ( ModelProperty mp : dependencyContainer.getProperties() ) + { + if ( mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.Executions.xUri ) ) + { + hasExecutionsTag = true; + break; + } + } + List pList = new ArrayList(); + if ( !hasExecutionsTag ) + { + pList = managementContainer.getProperties(); + } + else + { + for ( ModelProperty mp : managementContainer.getProperties() ) + { + if ( !mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.Executions.xUri ) ) + { + pList.add( mp ); + } + } + } + managementContainer = new ArtifactModelContainerFactory().create( pList ); + + ModelContainerAction action = dependencyContainer.containerAction( managementContainer ); + if ( action.equals( ModelContainerAction.JOIN ) || action.equals( ModelContainerAction.DELETE ) ) + { + source.join( dependencyContainer, managementContainer ); + } + } + } + + props = source.getModelProperties(); + + //Rule: Do not join plugin executions without ids + Set removeProperties = new HashSet(); + ModelDataSource dataSource = new DefaultModelDataSource(); + dataSource.init( props, Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) ); + List containers = dataSource.queryFor( ProjectUri.Build.Plugins.Plugin.xUri ); + for ( ModelContainer pluginContainer : containers ) + { + ModelDataSource executionSource = new DefaultModelDataSource(); + executionSource.init( pluginContainer.getProperties(), + Arrays.asList( new ArtifactModelContainerFactory(), new PluginExecutionIdModelContainerFactory() ) ); + List executionContainers = + executionSource.queryFor( ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri ); + if ( executionContainers.size() < 2 ) + { + continue; + } + + boolean hasAtLeastOneWithoutId = true; + for ( ModelContainer executionContainer : executionContainers ) + { + if ( hasAtLeastOneWithoutId ) + { + hasAtLeastOneWithoutId = hasExecutionId( executionContainer ); + } + if ( !hasAtLeastOneWithoutId && !hasExecutionId( executionContainer ) && + executionContainers.indexOf( executionContainer ) > 0 ) + { + removeProperties.addAll( executionContainer.getProperties() ); + } + } + } + props.removeAll( removeProperties ); + + 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 siteUrl = new StringBuffer(); + StringBuffer scmUrl = new StringBuffer(); + StringBuffer scmConnectionUrl = new StringBuffer(); + StringBuffer scmDeveloperUrl = new StringBuffer(); + + boolean containsBuildResources = false; + boolean containsTestResources = false; + boolean containsPluginRepositories = false; + + 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.getResolvedValue() ) ); + } + } + + //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.getResolvedValue() ) ); + } + + } + + //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 PluginExecutionIdModelContainerFactory() ) ); + 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.getResolvedValue() != null && mp.getResolvedValue().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.getResolvedValue() != null && + mp.getResolvedValue().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 ); + } + + //Site Rule + + ModelProperty siteUrlProperty = getPropertyFor( ProjectUri.DistributionManagement.Site.url, tmp ); + if ( siteUrl.length() == 0 && siteUrlProperty != null ) + { + siteUrl.append( siteUrlProperty.getResolvedValue());//.substring(0, siteUrlProperty.getResolvedValue().lastIndexOf("/")) ); + for ( String projectName : projectNames ) + { + if(!siteUrl.toString().endsWith( "/")) { + siteUrl.append( "/" ); + } + siteUrl.append( projectName ); + } + int index = tmp.indexOf( siteUrlProperty ); + tmp.remove( index ); + tmp.add( index, new ModelProperty( ProjectUri.DistributionManagement.Site.url, siteUrl.toString() ) ); + } + //If DistributionManagement site URL is property, + //SCM Rule + ModelProperty scmUrlProperty = getPropertyFor( ProjectUri.Scm.url, tmp ); + if ( scmUrl.length() == 0 && scmUrlProperty != null ) + { + scmUrl.append( scmUrlProperty.getResolvedValue() ); + 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.getResolvedValue() ); + 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.getResolvedValue() ); + 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() ) ); + } + + //Project Name Inheritance Rule + //Packaging 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 ) ) ) + { + clearedProperties.add( mp ); + } + } + + //Remove Plugin Repository Inheritance Rule + //Build Resources Inheritence Rule + //Build Test Resources Inheritance Rule + //Only inherit IF: the above is contained in super pom (domainModels.size() -1) && the child doesn't has it's own respective field + if ( domainModels.indexOf( domainModel ) == 0 ) + { + containsBuildResources = hasProjectUri( ProjectUri.Build.Resources.xUri, tmp ); + containsTestResources = hasProjectUri( ProjectUri.Build.TestResources.xUri, tmp ); + containsPluginRepositories = hasProjectUri( ProjectUri.PluginRepositories.xUri, tmp ); + } + for ( ModelProperty mp : tmp ) + { + if ( domainModels.indexOf( domainModel ) > 0 ) + { + String uri = mp.getUri(); + boolean isNotSuperPom = domainModels.indexOf( domainModel ) != ( domainModels.size() - 1 ); + if ( isNotSuperPom ) + { + if ( uri.startsWith( ProjectUri.Build.Resources.xUri ) || + uri.startsWith( ProjectUri.Build.TestResources.xUri ) || + uri.startsWith( ProjectUri.PluginRepositories.xUri ) ) + { + clearedProperties.add( mp ); + } + } + else + { + if ( containsBuildResources && uri.startsWith( ProjectUri.Build.Resources.xUri ) ) + { + clearedProperties.add( mp ); + } + else if ( containsTestResources && uri.startsWith( ProjectUri.Build.TestResources.xUri ) ) + { + clearedProperties.add( mp ); + } + else if ( containsPluginRepositories && uri.startsWith( ProjectUri.PluginRepositories.xUri ) ) + { + clearedProperties.add( mp ); + } + } + } + } + + ModelProperty artifactId = getPropertyFor( ProjectUri.artifactId, tmp ); + if ( artifactId != null ) + { + projectNames.add( 0, artifactId.getResolvedValue() ); + } + + tmp.removeAll( clearedProperties ); + modelProperties.addAll( tmp ); + modelProperties.removeAll( clearedProperties ); + } + + //Rule: Build plugin config overrides reporting plugin config + ModelDataSource source = new DefaultModelDataSource(); + source.init( modelProperties, Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) ); + + List reportContainers = source.queryFor( ProjectUri.Reporting.Plugins.Plugin.xUri ); + for ( ModelContainer pluginContainer : source.queryFor( ProjectUri.Build.Plugins.Plugin.xUri ) ) + { + ModelContainer transformedReportContainer = new ArtifactModelContainerFactory().create( + transformPlugin( pluginContainer.getProperties() ) ); + + for(ModelContainer reportContainer : reportContainers) { + ModelContainerAction action = transformedReportContainer.containerAction( reportContainer ); + if ( action.equals( ModelContainerAction.JOIN ) ) + { + source.join( transformedReportContainer, reportContainer ); + break; + } + } + } + + modelProperties = source.getModelProperties(); + return modelProperties; + } + + public void interpolateModelProperties(List modelProperties, + List interpolatorProperties, + DomainModel domainModel) + throws IOException + { + interpolateModelProperties( modelProperties, interpolatorProperties, (PomClassicDomainModel) domainModel); + } + + public static String interpolateXmlString( String xml, List interpolatorProperties ) + throws IOException + { + List modelProperties = + ModelMarshaller.marshallXmlToModelProperties( new ByteArrayInputStream(xml.getBytes()), ProjectUri.baseUri, uris ); + + Map aliases = new HashMap(); + aliases.put( "project.", "pom."); + + List ips = new ArrayList(interpolatorProperties); + ips.addAll(ModelTransformerContext.createInterpolatorProperties(modelProperties, ProjectUri.baseUri, aliases, + PomInterpolatorTag.PROJECT_PROPERTIES.name(), false, false)); + + for(ModelProperty mp : modelProperties) + { + if(mp.getUri().startsWith(ProjectUri.properties) && mp.getValue() != null ) + { + String uri = mp.getUri(); + ips.add( new InterpolatorProperty( "${" + uri.substring( uri.lastIndexOf( "/" ) + 1, + uri.length() ) + "}", mp.getValue() ) ); + } + } + + ModelTransformerContext.interpolateModelProperties( modelProperties, ips ); + return ModelMarshaller.unmarshalModelPropertiesToXml( modelProperties, ProjectUri.baseUri ); + } + + public static String interpolateModelAsString(Model model, List interpolatorProperties, File projectDirectory) + throws IOException + { + PomClassicDomainModel domainModel = new PomClassicDomainModel( model ); + domainModel.setProjectDirectory( projectDirectory ); + List modelProperties = + ModelMarshaller.marshallXmlToModelProperties( domainModel.getInputStream(), ProjectUri.baseUri, uris ); + interpolateModelProperties( modelProperties, interpolatorProperties, domainModel); + + return ModelMarshaller.unmarshalModelPropertiesToXml( modelProperties, ProjectUri.baseUri ); + } + + public static Model interpolateModel(Model model, List interpolatorProperties, File projectDirectory) + throws IOException + { + String pomXml = interpolateModelAsString( model, interpolatorProperties, projectDirectory ); + PomClassicDomainModel domainModel = new PomClassicDomainModel( new ByteArrayInputStream( pomXml.getBytes() )); + return domainModel.getModel(); + } + + private static boolean containsProjectVersion( List interpolatorProperties ) + { + InterpolatorProperty versionInterpolatorProperty = + new ModelProperty( ProjectUri.version, "").asInterpolatorProperty( ProjectUri.baseUri); + for( InterpolatorProperty ip : interpolatorProperties) + { + if ( ip.equals( versionInterpolatorProperty ) ) + { + return true; + } + } + return false; + } + + private static void putProjectAliasIn(Map map, String s) + { + map.put( "\\$\\{project." + s + "\\}", "\\$\\{" + s + "\\}"); + } + + private static Map aliases = new HashMap(); + + static + { + aliases.put( "project.", "pom."); + aliases.put( "\\$\\{project.build.", "\\$\\{build."); + + List aliasList = Arrays.asList("artifactId", "groupId", "version", "packaging", "name", "description", + "url", "inceptionYear", "scm.url", "ciManagement.url", + "distributionManagement.repository.name", + "distributionManagement.site.url", + "reporting.outputDirectory", "parent.groupId", "parent.artifactId", + "parent.version", "prerequisites.maven", "issueManagement.url", "organization.name"); + for(String alias : aliasList) { + putProjectAliasIn(aliases, alias); + } + + } + + private static void interpolateModelProperties(List modelProperties, + List interpolatorProperties, + PomClassicDomainModel domainModel) + throws IOException + { + if(!containsProjectVersion(interpolatorProperties)) + { + aliases.put("\\$\\{project.version\\}", "\\$\\{version\\}"); + } + + List firstPassModelProperties = new ArrayList(); + List secondPassModelProperties = new ArrayList(); + + ModelProperty buildProperty = new ModelProperty(ProjectUri.Build.xUri, null); + for(ModelProperty mp : modelProperties) + { + if( mp.getValue() != null && !mp.getUri().contains( "#property" ) && !mp.getUri().contains( "#collection" )) + { + if( !buildProperty.isParentOf( mp ) || mp.getUri().equals(ProjectUri.Build.finalName ) ) + { + firstPassModelProperties.add(mp); + } + else + { + secondPassModelProperties.add(mp); + } + } + } + + + List standardInterpolatorProperties = new ArrayList(); + if(domainModel.isPomInBuild()) + { + String basedir = domainModel.getProjectDirectory().getAbsolutePath(); + standardInterpolatorProperties.add(new InterpolatorProperty("${project.basedir}", basedir, + PomInterpolatorTag.PROJECT_PROPERTIES.name() )); + standardInterpolatorProperties.add(new InterpolatorProperty("${basedir}", basedir, + PomInterpolatorTag.PROJECT_PROPERTIES.name() )); + standardInterpolatorProperties.add(new InterpolatorProperty("${pom.basedir}", basedir, + PomInterpolatorTag.PROJECT_PROPERTIES.name() )); + + } + + for(ModelProperty mp : modelProperties) + { + if(mp.getUri().startsWith(ProjectUri.properties) && mp.getValue() != null ) + { + String uri = mp.getUri(); + standardInterpolatorProperties.add( new InterpolatorProperty( "${" + uri.substring( uri.lastIndexOf( "/" ) + 1, + uri.length() ) + "}", mp.getValue(), PomInterpolatorTag.PROJECT_PROPERTIES.name() ) ); + } + } + + //FIRST PASS - Withhold using build directories as interpolator properties + List ips1 = new ArrayList(interpolatorProperties); + ips1.addAll(standardInterpolatorProperties); + ips1.addAll(ModelTransformerContext.createInterpolatorProperties(firstPassModelProperties, ProjectUri.baseUri, aliases, + PomInterpolatorTag.PROJECT_PROPERTIES.name(), false, false)); + Collections.sort(ips1, new Comparator() + { + public int compare(InterpolatorProperty o, InterpolatorProperty o1) { + return PomInterpolatorTag.valueOf(o.getTag()).compareTo(PomInterpolatorTag.valueOf(o1.getTag())); + } + }); + + ModelTransformerContext.interpolateModelProperties( modelProperties, ips1 ); + + //SECOND PASS - Set absolute paths on build directories + if( domainModel.isPomInBuild() ) + { String basedir = domainModel.getProjectDirectory().getAbsolutePath(); + Map buildDirectories = new HashMap(); + for(ModelProperty mp : secondPassModelProperties) + { + if(mp.getUri().equals( ProjectUri.Build.directory )) + { + File file = new File(mp.getResolvedValue()); + if( !file.isAbsolute() ) + { + buildDirectories.put(mp, new ModelProperty(mp.getUri(), new File(basedir, file.getPath()).getAbsolutePath())); + } + } + } + + for ( Map.Entry e : buildDirectories.entrySet() ) + { + secondPassModelProperties.remove( e.getKey() ); + secondPassModelProperties.add(e.getValue() ); + } + } + + //THIRD PASS - Use build directories as interpolator properties + List ips2 = new ArrayList(interpolatorProperties); + ips2.addAll(standardInterpolatorProperties); + ips2.addAll(ModelTransformerContext.createInterpolatorProperties(secondPassModelProperties, ProjectUri.baseUri, aliases, + PomInterpolatorTag.PROJECT_PROPERTIES.name(), false, false)); + ips2.addAll(interpolatorProperties); + Collections.sort(ips2, new Comparator() + { + public int compare(InterpolatorProperty o, InterpolatorProperty o1) { + return PomInterpolatorTag.valueOf(o.getTag()).compareTo(PomInterpolatorTag.valueOf(o1.getTag())); + } + }); + + ModelTransformerContext.interpolateModelProperties( modelProperties, ips2 ); + } + + private static boolean hasExecutionId( ModelContainer executionContainer ) + { + for ( ModelProperty mp : executionContainer.getProperties() ) + { + if ( mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.Executions.Execution.id ) ) + { + return true; + } + } + return false; + } + + /** + * 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; + } + + private static boolean hasProjectUri( String projectUri, List modelProperties ) + { + for ( ModelProperty mp : modelProperties ) + { + if ( mp.getUri().equals( projectUri ) ) + { + return true; + } + } + return false; + } + + /** + * 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; + } + + private static List transformDependencyManagement( List modelProperties ) + { + List transformedProperties = new ArrayList(); + for ( ModelProperty mp : modelProperties ) + { + if ( mp.getUri().startsWith( ProjectUri.DependencyManagement.xUri ) ) + { + transformedProperties.add( new ModelProperty( + mp.getUri().replace( ProjectUri.DependencyManagement.xUri, ProjectUri.xUri ), mp.getResolvedValue() ) ); + } + } + return transformedProperties; + } + + private static List transformPluginManagement( List modelProperties ) + { + List transformedProperties = new ArrayList(); + for ( ModelProperty mp : modelProperties ) + { + if ( mp.getUri().startsWith( ProjectUri.Build.PluginManagement.xUri ) ) + { + transformedProperties.add( new ModelProperty( + mp.getUri().replace( ProjectUri.Build.PluginManagement.xUri, ProjectUri.Build.xUri ), + mp.getResolvedValue() ) ); + } + } + return transformedProperties; + } + + private static List transformPlugin( List modelProperties ) + { + List transformedProperties = new ArrayList(); + for ( ModelProperty mp : modelProperties ) + { + if ( mp.getUri().startsWith( ProjectUri.Build.Plugins.xUri ) ) + { if(mp.getUri().startsWith(ProjectUri.Build.Plugins.Plugin.configuration) + || mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.groupId) + || mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.artifactId) + || mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.version) + || mp.getUri().equals( ProjectUri.Build.Plugins.Plugin.xUri ) ) + { + transformedProperties.add( new ModelProperty( + mp.getUri().replace( ProjectUri.Build.Plugins.xUri, ProjectUri.Reporting.Plugins.xUri ), + mp.getResolvedValue() ) ); + } + + } + } + return transformedProperties; + } +} + 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 index a60e63c77d..da11471e93 100644 --- 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 @@ -1,60 +1,60 @@ -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.project.ProjectBuilderConfiguration; -import org.apache.maven.shared.model.ImportModel; -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 - * @param projectBuilderConfiguration - * @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 importModels, - Collection interpolatorProperties, - PomArtifactResolver resolver, File baseDirectory, - ProjectBuilderConfiguration projectBuilderConfiguration ) - throws IOException; - -} +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.project.ProjectBuilderConfiguration; +import org.apache.maven.shared.model.ImportModel; +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 + * @param projectBuilderConfiguration + * @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 importModels, + Collection interpolatorProperties, + PomArtifactResolver resolver, File baseDirectory, + ProjectBuilderConfiguration projectBuilderConfiguration ) + 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 index ac217a9c2d..24d723d997 100644 --- 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 @@ -1,1666 +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#collection"; - - public static class Execution - { - public static String xUri = - "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution"; - - public static String id = - "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/id"; - - public static String phase = - "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/phase"; - - public static String goals = - "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals"; - - public static String inherited = - "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/inherited"; - - public static String configuration = - "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/execution#collection/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#set"; - } - } - } - - 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#set"; - } - } - } - - 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#collection"; - - public static class ReportSet - { - public static String xUri = - "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets#collection/reportSet"; - - public static String id = - "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets#collection/reportSet/id"; - - public static String configuration = - "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets#collection/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#set"; - - public static class ReportSets - { - public static String xUri = - "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection"; - - public static class ReportSet - { - public static String xUri = - "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/reportSet"; - - public static String id = - "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/reportSet/id"; - - public static String configuration = - "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/reportSet/configuration"; - - public static String inherited = - "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/reportSet/inherited"; - - public static String reports = - "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/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"; - -} +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#collection"; + + public static class Execution + { + public static String xUri = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution"; + + public static String id = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/id"; + + public static String phase = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/phase"; + + public static String goals = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals"; + + public static String inherited = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/inherited"; + + public static String configuration = + "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/execution#collection/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#set"; + } + } + } + + 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#set"; + } + } + } + + 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#collection"; + + public static class ReportSet + { + public static String xUri = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets#collection/reportSet"; + + public static String id = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets#collection/reportSet/id"; + + public static String configuration = + "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets#collection/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#set"; + + public static class ReportSets + { + public static String xUri = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection"; + + public static class ReportSet + { + public static String xUri = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/reportSet"; + + public static String id = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/reportSet/id"; + + public static String configuration = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/reportSet/configuration"; + + public static String inherited = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/reportSet/inherited"; + + public static String reports = + "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/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 index 362dc6271c..f1b56a6184 100644 --- 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 @@ -1,350 +1,350 @@ -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.MavenTools; -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.InvalidRepositoryException; -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.ProjectBuilderConfiguration; -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.ImportModel; -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.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; - - private MavenTools mavenTools; - - /** - * 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, java.util.Collection, org.apache.maven.project.builder.PomArtifactResolver, java.io.File, org.apache.maven.project.ProjectBuilderConfiguration) - */ - public MavenProject buildFromLocalPath( InputStream pom, List inheritedModels, - Collection importModels, - Collection interpolatorProperties, - PomArtifactResolver resolver, File projectDirectory, - ProjectBuilderConfiguration projectBuilderConfiguration ) - 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 ); - domainModel.setProjectDirectory( projectDirectory ); - - List domainModels = new ArrayList(); - domainModels.add( domainModel ); - - File parentFile = null; - if ( domainModel.getModel().getParent() != null ) - { - List mavenParents; - if ( isParentLocal( domainModel.getModel().getParent(), projectDirectory ) ) - { - mavenParents = getDomainModelParentsFromLocalPath( domainModel, resolver, projectDirectory ); - } - else - { - mavenParents = getDomainModelParentsFromRepository( domainModel, resolver ); - } - - if ( mavenParents.size() > 0 ) - { - PomClassicDomainModel dm = (PomClassicDomainModel) mavenParents.get( 0 ); - parentFile = dm.getFile(); - domainModel.setParentFile( parentFile ); - } - - domainModels.addAll( mavenParents ); - } - - for ( Model model : inheritedModels ) - { - domainModels.add( new PomClassicDomainModel( model ) ); - } - - PomClassicTransformer transformer = new PomClassicTransformer( null ); - ModelTransformerContext ctx = new ModelTransformerContext( - Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) ); - - PomClassicDomainModel transformedDomainModel = ( (PomClassicDomainModel) ctx.transform( domainModels, - transformer, - transformer, - importModels, - properties ) ); - try - { - MavenProject mavenProject = new MavenProject( transformedDomainModel.getModel(), artifactFactory, - mavenTools, null, - projectBuilderConfiguration ); - mavenProject.setParentFile( parentFile ); - return mavenProject; - } - catch ( InvalidRepositoryException e ) - { - throw new IOException( e.getMessage() ); - } - } - - /** - * Returns true if the relative path of the specified parent references a pom, otherwise returns false. - * - * @param parent the parent model info - * @param projectDirectory the project directory of the child pom - * @return true if the relative path of the specified parent references a pom, otherwise returns fals - */ - 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( artifactParent.getFile() ); - - if ( !parentDomainModel.matchesParent( domainModel.getModel().getParent() ) ) - { - logger.debug( "Parent pom ids do not match: Parent File = " + artifactParent.getFile().getAbsolutePath() + - ": Child ID = " + domainModel.getModel().getId() ); - return domainModels; - } - - domainModels.add( parentDomainModel ); - domainModels.addAll( getDomainModelParentsFromRepository( parentDomainModel, artifactResolver ) ); - return domainModels; - } - - /** - * Returns list of domain model parents of the specified domain model. The parent domain models are part - * - * @param domainModel - * @param artifactResolver - * @param projectDirectory - * @return - * @throws IOException - */ - 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( parentFile ); - parentDomainModel.setProjectDirectory( parentFile.getParentFile() ); - - if ( !parentDomainModel.matchesParent( domainModel.getModel().getParent() ) ) - { - logger.debug( "Parent pom ids do not match: Parent File = " + parentFile.getAbsolutePath() + ", Parent ID = " - + parentDomainModel.getId() + ", Child ID = " + domainModel.getId() + ", Expected Parent ID = " - + domainModel.getModel().getParent().getId() ); - List parentDomainModels = getDomainModelParentsFromRepository( domainModel, artifactResolver ); - if(parentDomainModels.size() == 0) - { - throw new IOException("Unable to find parent pom on local path or repo: " - + domainModel.getModel().getParent().getId()); - } - //logger.info("Attempting to lookup from the repository: Found parents: " + parentDomainModels.size()); - domainModels.addAll( parentDomainModels ); - return domainModels; - } - - 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() ); - } - } -} +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.MavenTools; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.InvalidRepositoryException; +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.ProjectBuilderConfiguration; +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.ImportModel; +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.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; + + private MavenTools mavenTools; + + /** + * 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, java.util.Collection, org.apache.maven.project.builder.PomArtifactResolver, java.io.File, org.apache.maven.project.ProjectBuilderConfiguration) + */ + public MavenProject buildFromLocalPath( InputStream pom, List inheritedModels, + Collection importModels, + Collection interpolatorProperties, + PomArtifactResolver resolver, File projectDirectory, + ProjectBuilderConfiguration projectBuilderConfiguration ) + 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 ); + domainModel.setProjectDirectory( projectDirectory ); + + List domainModels = new ArrayList(); + domainModels.add( domainModel ); + + File parentFile = null; + if ( domainModel.getModel().getParent() != null ) + { + List mavenParents; + if ( isParentLocal( domainModel.getModel().getParent(), projectDirectory ) ) + { + mavenParents = getDomainModelParentsFromLocalPath( domainModel, resolver, projectDirectory ); + } + else + { + mavenParents = getDomainModelParentsFromRepository( domainModel, resolver ); + } + + if ( mavenParents.size() > 0 ) + { + PomClassicDomainModel dm = (PomClassicDomainModel) mavenParents.get( 0 ); + parentFile = dm.getFile(); + domainModel.setParentFile( parentFile ); + } + + domainModels.addAll( mavenParents ); + } + + for ( Model model : inheritedModels ) + { + domainModels.add( new PomClassicDomainModel( model ) ); + } + + PomClassicTransformer transformer = new PomClassicTransformer( null ); + ModelTransformerContext ctx = new ModelTransformerContext( + Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) ); + + PomClassicDomainModel transformedDomainModel = ( (PomClassicDomainModel) ctx.transform( domainModels, + transformer, + transformer, + importModels, + properties ) ); + try + { + MavenProject mavenProject = new MavenProject( transformedDomainModel.getModel(), artifactFactory, + mavenTools, null, + projectBuilderConfiguration ); + mavenProject.setParentFile( parentFile ); + return mavenProject; + } + catch ( InvalidRepositoryException e ) + { + throw new IOException( e.getMessage() ); + } + } + + /** + * Returns true if the relative path of the specified parent references a pom, otherwise returns false. + * + * @param parent the parent model info + * @param projectDirectory the project directory of the child pom + * @return true if the relative path of the specified parent references a pom, otherwise returns fals + */ + 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( artifactParent.getFile() ); + + if ( !parentDomainModel.matchesParent( domainModel.getModel().getParent() ) ) + { + logger.debug( "Parent pom ids do not match: Parent File = " + artifactParent.getFile().getAbsolutePath() + + ": Child ID = " + domainModel.getModel().getId() ); + return domainModels; + } + + domainModels.add( parentDomainModel ); + domainModels.addAll( getDomainModelParentsFromRepository( parentDomainModel, artifactResolver ) ); + return domainModels; + } + + /** + * Returns list of domain model parents of the specified domain model. The parent domain models are part + * + * @param domainModel + * @param artifactResolver + * @param projectDirectory + * @return + * @throws IOException + */ + 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( parentFile ); + parentDomainModel.setProjectDirectory( parentFile.getParentFile() ); + + if ( !parentDomainModel.matchesParent( domainModel.getModel().getParent() ) ) + { + logger.debug( "Parent pom ids do not match: Parent File = " + parentFile.getAbsolutePath() + ", Parent ID = " + + parentDomainModel.getId() + ", Child ID = " + domainModel.getId() + ", Expected Parent ID = " + + domainModel.getModel().getParent().getId() ); + List parentDomainModels = getDomainModelParentsFromRepository( domainModel, artifactResolver ); + if(parentDomainModels.size() == 0) + { + throw new IOException("Unable to find parent pom on local path or repo: " + + domainModel.getModel().getParent().getId()); + } + //logger.info("Attempting to lookup from the repository: Found parents: " + parentDomainModels.size()); + domainModels.addAll( parentDomainModels ); + return domainModels; + } + + 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() ); + } + } +}