Skip to content

Commit

Permalink
guicify (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo authored Dec 11, 2024
1 parent 5976fe3 commit df4d256
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 19 deletions.
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,25 @@ under the License.
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
<version>0.9.0.M2</version>
<scope>provided</scope>
</dependency>

<!-- other -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>

<!-- test -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.resources.remote.io.xpp3.RemoteResourcesBundleXpp3Reader;
import org.apache.maven.plugin.resources.remote.io.xpp3.SupplementalDataModelXpp3Reader;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.DefaultProjectBuildingRequest;
import org.apache.maven.project.MavenProject;
Expand Down Expand Up @@ -349,24 +348,6 @@ public abstract class AbstractProcessRemoteResourcesMojo extends AbstractMojo {
@Parameter(defaultValue = "${project.build.outputTimestamp}")
private String outputTimestamp;

@Component
protected RepositorySystem repoSystem;

/**
* Filtering support, for local resources that override those in the remote bundle.
*/
@Component
private MavenFileFilter fileFilter;

@Component
private ResourceManager locator;

@Component
private ProjectBuilder projectBuilder;

@Component
private ArtifactHandlerManager artifactHandlerManager;

/**
* Map of artifacts to supplemental project object models.
*/
Expand All @@ -380,6 +361,32 @@ public abstract class AbstractProcessRemoteResourcesMojo extends AbstractMojo {

private VelocityEngine velocity;

protected final RepositorySystem repoSystem;

/**
* Filtering support, for local resources that override those in the remote bundle.
*/
private final MavenFileFilter fileFilter;

private final ResourceManager locator;

private final ProjectBuilder projectBuilder;

private final ArtifactHandlerManager artifactHandlerManager;

protected AbstractProcessRemoteResourcesMojo(
RepositorySystem repoSystem,
MavenFileFilter fileFilter,
ResourceManager locator,
ProjectBuilder projectBuilder,
ArtifactHandlerManager artifactHandlerManager) {
this.repoSystem = repoSystem;
this.fileFilter = fileFilter;
this.locator = locator;
this.projectBuilder = projectBuilder;
this.artifactHandlerManager = artifactHandlerManager;
}

@Override
public void execute() throws MojoExecutionException {
if (skip) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@
*/
package org.apache.maven.plugin.resources.remote;

import javax.inject.Inject;

import java.util.LinkedHashSet;
import java.util.Set;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.shared.filtering.MavenFileFilter;
import org.codehaus.plexus.resource.ResourceManager;
import org.eclipse.aether.RepositorySystem;

/**
* <p>
Expand All @@ -46,6 +53,17 @@
requiresDependencyResolution = ResolutionScope.TEST,
threadSafe = true)
public class AggregateProcessRemoteResourcesMojo extends AbstractProcessRemoteResourcesMojo {

@Inject
public AggregateProcessRemoteResourcesMojo(
RepositorySystem repoSystem,
MavenFileFilter fileFilter,
ResourceManager locator,
ProjectBuilder projectBuilder,
ArtifactHandlerManager artifactHandlerManager) {
super(repoSystem, fileFilter, locator, projectBuilder, artifactHandlerManager);
}

@Override
protected Set<Artifact> getAllDependencies() {
LinkedHashSet<Artifact> result = new LinkedHashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@
*/
package org.apache.maven.plugin.resources.remote;

import javax.inject.Inject;

import java.util.Set;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.shared.filtering.MavenFileFilter;
import org.codehaus.plexus.resource.ResourceManager;
import org.eclipse.aether.RepositorySystem;

/**
* <p>
Expand All @@ -43,6 +50,17 @@
requiresDependencyResolution = ResolutionScope.TEST,
threadSafe = true)
public class ProcessRemoteResourcesMojo extends AbstractProcessRemoteResourcesMojo {

@Inject
public ProcessRemoteResourcesMojo(
RepositorySystem repoSystem,
MavenFileFilter fileFilter,
ResourceManager locator,
ProjectBuilder projectBuilder,
ArtifactHandlerManager artifactHandlerManager) {
super(repoSystem, fileFilter, locator, projectBuilder, artifactHandlerManager);
}

@Override
protected Set<Artifact> getAllDependencies() {
return project.getArtifacts();
Expand Down

0 comments on commit df4d256

Please sign in to comment.