Skip to content

Commit

Permalink
Prefer Guice to Plexus
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Nov 19, 2024
1 parent 8e9f3ea commit f8b886f
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
*/
package org.apache.maven.plugins.site.descriptor;

import javax.inject.Inject;

import java.io.File;
import java.io.IOException;
import java.util.Locale;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
Expand All @@ -50,21 +51,26 @@ public class SiteDescriptorAttachMojo extends AbstractSiteDescriptorMojo {
@Parameter(property = "basedir", required = true, readonly = true)
private File basedir;

/**
* Attach site descriptor only if packaging is pom.
* @since 3.0
*/
@Parameter(defaultValue = "true")
private boolean pomPackagingOnly;

/**
* Maven ProjectHelper.
*
* @since 2.1.1
*/
@Component
private MavenProjectHelper projectHelper;

/**
* Attach site descriptor only if packaging is pom.
* @since 3.0
*/
@Parameter(defaultValue = "true")
private boolean pomPackagingOnly;
@Inject
public SiteDescriptorAttachMojo(MavenProjectHelper projectHelper) {
this.projectHelper = projectHelper;
}

@Override
public void execute() throws MojoExecutionException {
if (pomPackagingOnly && !"pom".equals(project.getPackaging())) {
// https://issues.apache.org/jira/browse/MSITE-597
Expand Down

0 comments on commit f8b886f

Please sign in to comment.