Skip to content

Commit

Permalink
Reduce injection (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo authored Dec 24, 2024
1 parent 1a5742b commit 1001771
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
*/

import javax.inject.Inject;
import javax.inject.Named;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -381,17 +380,15 @@ public class JLinkMojo extends AbstractJLinkMojo {
/**
* The JAR archiver needed for archiving the environments.
*/
private final ZipArchiver zipArchiver;
private final ZipArchiver zipArchiver = new ZipArchiver();

@Inject
public JLinkMojo(
MavenProjectHelper projectHelper,
ToolchainManager toolchainManager,
@Named("zip") ZipArchiver zipArchiver,
MavenResourcesFiltering mavenResourcesFiltering,
LocationManager locationManager) {
super(toolchainManager);
this.zipArchiver = zipArchiver;
this.mavenResourcesFiltering = mavenResourcesFiltering;
this.projectHelper = projectHelper;
this.locationManager = locationManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

public class JLinkMojoTest {

private JLinkMojo mojo = new JLinkMojo(null, null, null, null, null);
private JLinkMojo mojo = new JLinkMojo(null, null, null, null);

@BeforeEach
public void setUp() throws NoSuchFieldException, IllegalAccessException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

public class MultipleLauncherTest {

private JLinkMojo mojo = new JLinkMojo(null, null, null, null, null);
private JLinkMojo mojo = new JLinkMojo(null, null, null, null);

@Test
void testSingleLauncher() throws Exception {
Expand Down

0 comments on commit 1001771

Please sign in to comment.