Java Code Examples for org.apache.maven.plugin.descriptor.PluginDescriptor#getGoalPrefixFromArtifactId()
The following examples show how to use
org.apache.maven.plugin.descriptor.PluginDescriptor#getGoalPrefixFromArtifactId() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AddPluginArtifactMetadataMojo.java From takari-lifecycle with Eclipse Public License 1.0 | 5 votes |
/** * @return the goal prefix parameter or the goal prefix from the Plugin artifactId. */ private String getGoalPrefix() { if (goalPrefix == null) { goalPrefix = PluginDescriptor.getGoalPrefixFromArtifactId(project.getArtifactId()); } return goalPrefix; }
Example 2
Source File: ConfluenceDeployMojo.java From maven-confluence-plugin with Apache License 2.0 | 4 votes |
@SuppressWarnings("unchecked") private void generatePluginReport( ConfluenceService confluence, final Site site, final Locale locale ) throws Exception { final String goalPrefix = PluginDescriptor.getGoalPrefixFromArtifactId(project.getArtifactId()); final PluginDescriptor pluginDescriptor = new PluginDescriptor(); pluginDescriptor.setGroupId(project.getGroupId()); pluginDescriptor.setArtifactId(project.getArtifactId()); pluginDescriptor.setVersion(project.getVersion()); pluginDescriptor.setGoalPrefix(goalPrefix); final java.util.List<ComponentDependency> deps = new java.util.ArrayList<>(); deps.addAll(toComponentDependencies(project.getRuntimeDependencies())); deps.addAll(toComponentDependencies(project.getCompileDependencies())); pluginDescriptor.setDependencies(deps); pluginDescriptor.setDescription(project.getDescription()); PluginToolsRequest req = new DefaultPluginToolsRequest(project, pluginDescriptor); req.setEncoding(getEncoding()); req.setLocal(local); req.setRemoteRepos(remoteRepos); req.setSkipErrorNoDescriptorsFound(false); req.setDependencies(dependencies); try { mojoScanner.populatePluginDescriptor(req); } catch (InvalidPluginDescriptorException e) { // this is OK, it happens to lifecycle plugins. Allow generation to proceed. getLog().warn(format("Plugin without mojos. %s\nMojoScanner:%s", e.getMessage(), mojoScanner.getClass())); } final Model.Page parentPage = loadParentPage(confluence, Optional.of(site)).join(); outputDirectory.mkdirs(); getLog().info( format("speceKey=%s parentPageTitle=%s", parentPage.getSpace(), parentPage.getTitle()) ); final PluginGenerator generator = new PluginGenerator(); final PluginToolsRequest request = new DefaultPluginToolsRequest(project, pluginDescriptor); final Model.Page confluenceHomePage = generator.processMojoDescriptors( request.getPluginDescriptor(), confluence, parentPage, site, locale ); confluence.addLabelsByName(confluenceHomePage.getId(), site.getHome().getComputedLabels() ).join(); final Map<String, Model.Page> varsToParentPageMap = new HashMap<>(); generateChildren( confluence, site, site.getHome(), confluenceHomePage, varsToParentPageMap); generator.generateGoalsPages(confluence, confluenceHomePage, varsToParentPageMap); // // Write the overview // PluginOverviewRenderer r = new PluginOverviewRenderer( getSink(), pluginDescriptor, locale ); // r.render(); // }