Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Dec 16, 2024
1 parent 0551698 commit c357ba7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 25 deletions.
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ under the License.
</dependency>

<!-- misc -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
<version>0.9.0.M2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
Expand Down
42 changes: 27 additions & 15 deletions src/main/java/org/apache/maven/plugin/doap/DoapMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package org.apache.maven.plugin.doap;

import javax.inject.Inject;

import java.io.File;
import java.io.IOException;
import java.io.Writer;
Expand Down Expand Up @@ -59,7 +61,6 @@
import org.apache.maven.plugin.doap.options.DoapOptions;
import org.apache.maven.plugin.doap.options.ExtOptions;
import org.apache.maven.plugin.doap.options.Standard;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
Expand Down Expand Up @@ -124,32 +125,28 @@ public class DoapMojo extends AbstractMojo {
*
* @since 1.0
*/
@Component
private ScmManager scmManager;
private final ScmManager scmManager;

/**
* Artifact factory.
*
* @since 1.0
*/
@Component
private ArtifactFactory artifactFactory;
private final ArtifactFactory artifactFactory;

/**
* Used to resolve artifacts.
*
* @since 1.0
*/
@Component
private RepositoryMetadataManager repositoryMetadataManager;
private final RepositoryMetadataManager repositoryMetadataManager;

/**
* Internationalization component.
*
* @since 1.0
*/
@Component
private I18N i18n;
private final I18N i18n;

// ----------------------------------------------------------------------
// Mojo parameters
Expand Down Expand Up @@ -196,24 +193,21 @@ public class DoapMojo extends AbstractMojo {
*
* @since 1.1
*/
@Component
private ArtifactFactory factory;
private final ArtifactFactory factory;

/**
* Project builder
*
* @since 1.1
*/
@Component
private MavenProjectBuilder mavenProjectBuilder;
private final MavenProjectBuilder mavenProjectBuilder;

/**
* Used for resolving artifacts
*
* @since 1.1
*/
@Component
private ArtifactResolver resolver;
private final ArtifactResolver resolver;

/**
* The current user system settings for use in Maven.
Expand Down Expand Up @@ -388,6 +382,24 @@ public class DoapMojo extends AbstractMojo {
*/
private UserMessages messages = new UserMessages();

@Inject
public DoapMojo(
ScmManager scmManager,
ArtifactFactory artifactFactory,
RepositoryMetadataManager repositoryMetadataManager,
I18N i18n,
ArtifactFactory factory,
MavenProjectBuilder mavenProjectBuilder,
ArtifactResolver resolver) {
this.scmManager = scmManager;
this.artifactFactory = artifactFactory;
this.repositoryMetadataManager = repositoryMetadataManager;
this.i18n = i18n;
this.factory = factory;
this.mavenProjectBuilder = mavenProjectBuilder;
this.resolver = resolver;
}

// ----------------------------------------------------------------------
// Public methods
// ----------------------------------------------------------------------
Expand Down
10 changes: 0 additions & 10 deletions src/test/java/org/apache/maven/plugin/doap/DoapMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@
* @author <a href="mailto:[email protected]">Vincent Siveton</a>
*/
public class DoapMojoTest extends AbstractMojoTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
}

@Override
protected void tearDown() throws Exception {
super.tearDown();
}

/**
* Verify the generation of a pure DOAP file.
*
Expand Down

0 comments on commit c357ba7

Please sign in to comment.