本文整理汇总了Java中org.apache.maven.model.Plugin.setConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java Plugin.setConfiguration方法的具体用法?Java Plugin.setConfiguration怎么用?Java Plugin.setConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.Plugin
的用法示例。
在下文中一共展示了Plugin.setConfiguration方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getJavadocPlugin
import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private static Plugin getJavadocPlugin() {
final Plugin javadocPlugin = new Plugin();
javadocPlugin.setGroupId("org.apache.maven.plugins");
javadocPlugin.setArtifactId("maven-javadoc-plugin");
//javadocPlugin.setVersion("2.10.4");
PluginExecution pluginExecution = new PluginExecution();
pluginExecution.setId("javadoc");
List<String> goals = new ArrayList<>();
goals.add("jar");
pluginExecution.setGoals(goals);
pluginExecution.setPhase("package");
List<PluginExecution> pluginExecutions = new ArrayList<>();
pluginExecutions.add(pluginExecution);
javadocPlugin.setExecutions(pluginExecutions);
final Xpp3Dom javadocConfig = new Xpp3Dom("configuration");
final Xpp3Dom quiet = new Xpp3Dom("quiet");
quiet.setValue("true");
javadocConfig.addChild(quiet);
javadocPlugin.setConfiguration(javadocConfig);
return javadocPlugin;
}
示例2: testExecuteInParentWithConfigurationInPluginManagement
import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
/**
* Test of execute method, of class RequirePropertyDiverges.
*/
@Test
public void testExecuteInParentWithConfigurationInPluginManagement() throws EnforcerRuleException
{
RequirePropertyDiverges mockInstance = createMockRule();
final MavenProject project = createMavenProject( "company", "company-parent-pom" );
final Build build = new Build();
// create pluginManagement
final Plugin pluginInManagement = newPlugin( "org.apache.maven.plugins", "maven-enforcer-plugin", "1.0");
final Xpp3Dom configuration = createPluginConfiguration();
pluginInManagement.setConfiguration( configuration );
final PluginManagement pluginManagement = new PluginManagement();
pluginManagement.addPlugin( pluginInManagement );
build.setPluginManagement( pluginManagement );
// create plugins
final Plugin pluginInPlugins = newPlugin( "org.apache.maven.plugins", "maven-enforcer-plugin", "1.0");
build.addPlugin( pluginInPlugins );
// add build
project.getOriginalModel().setBuild( build );
//project.getOriginalModel().setBuild( build );
setUpHelper( project, "parentValue" );
mockInstance.execute( helper );
}
示例3: getSurefirePlugin
import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private static Plugin getSurefirePlugin() {
final Plugin surefirePlugin = new Plugin();
surefirePlugin.setGroupId("org.apache.maven.plugins");
surefirePlugin.setArtifactId("maven-surefire-plugin");
surefirePlugin.setVersion("2.19.1");
final Xpp3Dom mavenPluginConfiguration = new Xpp3Dom("configuration");
final Xpp3Dom skipTests = new Xpp3Dom("skipTests");
skipTests.setValue("${skipTests}");
mavenPluginConfiguration.addChild(skipTests);
surefirePlugin.setConfiguration(mavenPluginConfiguration);
return surefirePlugin;
}
示例4: createParentProject
import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private MavenProject createParentProject() {
final MavenProject project = createMavenProject( "company", "company-parent-pom" );
final Build build = new Build();
build.setPluginManagement( new PluginManagement() );
final Plugin plugin = newPlugin( "org.apache.maven.plugins", "maven-enforcer-plugin", "1.0");
final Xpp3Dom configuration = createPluginConfiguration();
plugin.setConfiguration( configuration );
build.addPlugin( plugin );
project.getOriginalModel().setBuild( build );
return project;
}
示例5: addDockerPlugin
import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
public static void addDockerPlugin(String artifactId, String version, String dockerHubOrg, InputStream is, OutputStream os) throws IOException {
final MavenXpp3Reader reader = new MavenXpp3Reader();
Model pomModel;
try {
pomModel = reader.read(is);
}
catch (IOException | XmlPullParserException e) {
throw new IllegalStateException(e);
}
final Plugin dockerPlugin = new Plugin();
dockerPlugin.setGroupId("io.fabric8");
dockerPlugin.setArtifactId("docker-maven-plugin");
dockerPlugin.setVersion("0.14.2");
final Xpp3Dom mavenPluginConfiguration = new Xpp3Dom("configuration");
final Xpp3Dom images = addElement(mavenPluginConfiguration, "images");
final Xpp3Dom image = addElement(images, "image");
if (!version.endsWith("BUILD-SNAPSHOT")) {
addElement(image, "name", dockerHubOrg + "/${project.artifactId}:" + version);
}
else {
addElement(image, "name", dockerHubOrg + "/${project.artifactId}");
}
final Xpp3Dom build = addElement(image, "build");
addElement(build, "from", "anapsix/alpine-java:8");
final Xpp3Dom volumes = addElement(build, "volumes");
addElement(volumes, "volume", "/tmp");
final Xpp3Dom entryPoint = new Xpp3Dom("entryPoint");
build.addChild(entryPoint);
final Xpp3Dom exec = new Xpp3Dom("exec");
entryPoint.addChild(exec);
addElement(exec, "arg", "java");
addElement(exec, "arg", "-jar");
addElement(exec, "arg", "/maven/" + artifactId + ".jar");
final Xpp3Dom assembly = addElement(build, "assembly");
addElement(assembly, "descriptor", "assembly.xml");
dockerPlugin.setConfiguration(mavenPluginConfiguration);
pomModel.getBuild().addPlugin(dockerPlugin);
pomModel.toString();
writeModelToFile(pomModel, os);
}