mirror of https://github.com/apache/maven.git
Some work toward fixing multiple goals for plugin management.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@721278 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8da8916f50
commit
7b85810d0d
|
@ -385,8 +385,14 @@ public class ProjectUri
|
|||
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 class Goals
|
||||
{
|
||||
public static String xURI =
|
||||
"http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals#collection";
|
||||
|
||||
public static String goal =
|
||||
"http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals#collection/goal";
|
||||
}
|
||||
|
||||
public static String inherited =
|
||||
"http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/inherited";
|
||||
|
@ -450,8 +456,15 @@ public class ProjectUri
|
|||
}
|
||||
}
|
||||
|
||||
public static String goals =
|
||||
"http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/goals";
|
||||
public static class Goals
|
||||
{
|
||||
public static String xURI =
|
||||
"http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/goals#collection";
|
||||
|
||||
public static String goal =
|
||||
"http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/goals#collection/goal";
|
||||
|
||||
}
|
||||
|
||||
public static String inherited =
|
||||
"http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/inherited";
|
||||
|
@ -498,8 +511,14 @@ public class ProjectUri
|
|||
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 class Goals
|
||||
{
|
||||
public static String xURI =
|
||||
"http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/goals#collection";
|
||||
|
||||
public static String goal =
|
||||
"http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/goals#collection/goal";
|
||||
}
|
||||
|
||||
public static String inherited =
|
||||
"http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/inherited";
|
||||
|
@ -562,8 +581,14 @@ public class ProjectUri
|
|||
"http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/optional";
|
||||
}
|
||||
}
|
||||
public static class Goals
|
||||
{
|
||||
public static String xURI =
|
||||
"http://apache.org/maven/project/build/plugins#collection/plugin/goals#collection";
|
||||
|
||||
public static String goals = "http://apache.org/maven/project/build/plugins#collection/plugin/goals";
|
||||
public static String goal =
|
||||
"http://apache.org/maven/project/build/plugins#collection/plugin/goals#collection/goal";
|
||||
}
|
||||
|
||||
public static String inherited =
|
||||
"http://apache.org/maven/project/build/plugins#collection/plugin/inherited";
|
||||
|
@ -750,8 +775,14 @@ public class ProjectUri
|
|||
public static String phase =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/phase";
|
||||
|
||||
public static String goals =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals";
|
||||
public static class Goals
|
||||
{
|
||||
public static String xURI =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals#collection";
|
||||
|
||||
public static String goal =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals#collection/goal";
|
||||
}
|
||||
|
||||
public static String inherited =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/inherited";
|
||||
|
@ -815,8 +846,14 @@ public class ProjectUri
|
|||
}
|
||||
}
|
||||
|
||||
public static String goals =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/goals";
|
||||
public static class Goals
|
||||
{
|
||||
public static String xURI =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/goals#collection";
|
||||
|
||||
public static String goal =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/goal";
|
||||
}
|
||||
|
||||
public static String inherited =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/inherited";
|
||||
|
@ -865,8 +902,14 @@ public class ProjectUri
|
|||
public static String phase =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/phase";
|
||||
|
||||
public static String goals =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/goals";
|
||||
public static class Goals
|
||||
{
|
||||
public static String xURI =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/goals#collection";
|
||||
|
||||
public static String goal =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/goals#collection/goal";
|
||||
}
|
||||
|
||||
public static String inherited =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/inherited";
|
||||
|
@ -930,14 +973,20 @@ public class ProjectUri
|
|||
}
|
||||
}
|
||||
|
||||
public static String goals =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/goals";
|
||||
public static class Goals
|
||||
{
|
||||
public static String xURI =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/goals#collection";
|
||||
|
||||
public static String goal =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/goals#collection/goal";
|
||||
}
|
||||
|
||||
public static String inherited =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/inherited";
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/inherited";
|
||||
|
||||
public static String configuration =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/configuration";
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/configuration";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import static org.junit.Assert.*;
|
|||
|
||||
public class EnforcerPomTest
|
||||
{
|
||||
@org.junit.Test
|
||||
@org.junit.Test
|
||||
public void dependencyManagementWithScopeAndClassifier() throws IOException
|
||||
{
|
||||
List<ModelProperty> mp = new ArrayList<ModelProperty>();
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
package org.apache.maven.project.builder;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import org.apache.maven.shared.model.*;
|
||||
import org.apache.maven.shared.model.impl.DefaultModelDataSource;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class PluginSpecTest {
|
||||
|
||||
@org.junit.Test
|
||||
public void goalsInherited() {
|
||||
List<ModelProperty> mp = new ArrayList<ModelProperty>();
|
||||
mp.add(new ModelProperty(ProjectUri.xUri, null));
|
||||
mp.add(new ModelProperty(ProjectUri.Build.xUri, null));
|
||||
mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.xUri, null));
|
||||
mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.xUri, null));
|
||||
mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.xUri, null));
|
||||
mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.groupId, "gid"));
|
||||
mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.artifactId, "aid"));
|
||||
mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.version, "v1"));
|
||||
|
||||
mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.xUri, null));
|
||||
mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.Execution.xUri, null));
|
||||
mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.Execution.id, "site-docs"));
|
||||
mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.Execution.phase, "phase"));
|
||||
// mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.Execution.goals, null));
|
||||
/*
|
||||
<phase>pre-site</phase>
|
||||
<goals>
|
||||
<goal>xdoc</goal>
|
||||
<goal>xsd</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>standard</id>
|
||||
<goals>
|
||||
<goal>java</goal>
|
||||
<goal>xpp3-reader</goal>
|
||||
<goal>xpp3-writer</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
|
||||
|
||||
List<ModelProperty> mp2 = new ArrayList<ModelProperty>();
|
||||
mp2.add(new ModelProperty(ProjectUri.xUri, null));
|
||||
mp2.add(new ModelProperty(ProjectUri.Dependencies.xUri, null));
|
||||
mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.xUri, null));
|
||||
mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.groupId, "gid"));
|
||||
mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.artifactId, "aid"));
|
||||
mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.xUri, null));
|
||||
mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.groupId, "gid"));
|
||||
mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.artifactId, "aid"));
|
||||
mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.classifier, "tests"));
|
||||
|
||||
DomainModel childModel = new DefaultDomainModel(mp2);
|
||||
DomainModel parentModel = new DefaultDomainModel(mp);
|
||||
|
||||
ModelTransformerContext ctx = new ModelTransformerContext(Arrays.asList(new ArtifactModelContainerFactory(),
|
||||
new IdModelContainerFactory()));
|
||||
|
||||
ModelTransformer transformer = new PomTransformer(new DefaultDomainModelFactory());
|
||||
DomainModel domainModel = ctx.transform( Arrays.asList(childModel, parentModel), transformer, transformer );
|
||||
|
||||
DefaultModelDataSource source = new DefaultModelDataSource();
|
||||
source.init(domainModel.getModelProperties(), Arrays.asList(new ArtifactModelContainerFactory(), new IdModelContainerFactory()));
|
||||
List<ModelContainer> containers = source.queryFor(ProjectUri.Dependencies.Dependency.xUri);
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue