Skip to content

Instantly share code, notes, and snippets.

@paulbakker
Created September 27, 2011 22:49
Show Gist options
  • Save paulbakker/1246483 to your computer and use it in GitHub Desktop.
Save paulbakker/1246483 to your computer and use it in GitHub Desktop.
MavenPluginFacet mavenPluginFacet = getProject().getFacet(MavenPluginFacet.class);
int nrOfPlugins = getNumberOfPlugins();
MavenPluginBuilder plugin = MavenPluginBuilder.create()
.setDependency(
DependencyBuilder.create()
.setGroupId("org.apache.maven.plugins")
.setArtifactId("maven-site-plugin")
.setVersion("3.0")
);
MavenPluginAdapter mvnPlugin = new MavenPluginAdapter(plugin);
MavenCoreFacet facet = project.getFacet(MavenCoreFacet.class);
Profile profile = new Profile();
profile.setId(profileId);
profile.getBuild().addPlugin(theplugin);
Model pom = facet.getPOM();
pom.addProfile(profile);
facet.setPOM(pom);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment