Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ private static long getDependencyCount(PomEditor editor, boolean managed) {
/**
* Detects the project's dependency management conventions by analyzing existing dependencies.
*/
private Conventions detectConventions(MavenProject project) throws MojoExecutionException {
private Conventions detectConventions(MavenProject project) {
Conventions conv = new Conventions();

File pomFile = project.getFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ private DependencyEntry resolveCoordinates() throws MojoFailureException {
return coords;
}

private void checkChildModuleDependencies(MavenProject parentProject, String depGroupId, String depArtifactId)
throws MojoExecutionException {
private void checkChildModuleDependencies(MavenProject parentProject, String depGroupId, String depArtifactId) {
if (parentProject.getBasedir() == null) {
getLog().debug("Parent project basedir is null, skipping child module dependency check");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
Expand Down Expand Up @@ -220,7 +219,7 @@ public TreeMojo(
* @see org.apache.maven.plugin.Mojo#execute()
*/
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
public void execute() throws MojoExecutionException {
if (isSkip()) {
getLog().info("Skipping plugin execution");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,9 @@ protected File getMarkerFile(boolean res) {
*
* @return <code>true</code> if and only if the file or directory denoted by this abstract pathname exists;
* <code>false</code> otherwise
* @throws MojoExecutionException if a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkRead(java.lang.String)}</code> method denies read access to the file or
* directory
*/
@Override
public boolean isMarkerSet() throws MojoExecutionException {
public boolean isMarkerSet() {
File marker = getMarkerFile();

File marker2 = getMarkerFile(!this.resolved);
Expand All @@ -94,7 +91,7 @@ public boolean isMarkerSet() throws MojoExecutionException {
}

@Override
public boolean isMarkerOlder(Artifact theArtifact) throws MojoExecutionException {
public boolean isMarkerOlder(Artifact theArtifact) {
File marker = getMarkerFile();
if (marker.exists()) {
return theArtifact.getFile().lastModified() > marker.lastModified();
Expand Down Expand Up @@ -142,11 +139,9 @@ public void setMarker() throws MojoExecutionException {
*
* @return <code>true</code> if and only if the file or directory is successfully deleted; <code>false</code>
* otherwise
* @throws SecurityException if a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkDelete}</code> method denies delete access to the file
*/
@Override
public boolean clearMarker() throws MojoExecutionException {
public boolean clearMarker() {
File marker = getMarkerFile();
File marker2 = getMarkerFile(!this.resolved);
boolean markResult = marker.delete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AddDependencyMojoTest {
private AddDependencyMojo mojo;

@BeforeEach
void setUp() throws Exception {
void setUp() {
session = mock(MavenSession.class);
buildContext = mock(BuildContext.class);
project = mock(MavenProject.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class RemoveDependencyMojoTest {
private RemoveDependencyMojo mojo;

@BeforeEach
void setUp() throws Exception {
void setUp() {
session = mock(MavenSession.class);
buildContext = mock(BuildContext.class);
project = mock(MavenProject.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TestCollectMojo {
private DependencyArtifactStubFactory stubFactory;

@BeforeEach
void setUp() throws Exception {
void setUp() {
stubFactory = new DependencyArtifactStubFactory(null, false);
}

Expand Down Expand Up @@ -101,7 +101,7 @@ void testCollectTestEnvironmentExcludeTransitive(CollectDependenciesMojo mojo) t

@Test
@InjectMojo(goal = "collect")
void testSilent(CollectDependenciesMojo mojo) throws Exception {
void testSilent(CollectDependenciesMojo mojo) {
assertFalse(mojo.getLog() instanceof DependencySilentLog);

mojo.setSilent(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ExclusionCheckerTest {
private ExclusionChecker checker;

@BeforeEach
void setUp() throws Exception {
void setUp() {
checker = new ExclusionChecker();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
*/
package org.apache.maven.plugins.dependency.fromConfiguration;

import java.io.IOException;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DefaultArtifact;
import org.junit.jupiter.api.Test;
Expand All @@ -29,7 +27,7 @@
class TestArtifactItem {

@Test
void testArtifactItemConstructor() throws IOException {
void testArtifactItemConstructor() {
Artifact artifact = new DefaultArtifact("g", "a", "1.0", Artifact.SCOPE_COMPILE, "jar", "one", null);

ArtifactItem item = new ArtifactItem(artifact);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class TestUnpackMojo {
private ArchiverManager archiverManager;

@BeforeEach
void setUp() throws Exception {
void setUp() {
stubFactory = new DependencyArtifactStubFactory(tempDir, true, false);
stubFactory.setUnpackableFile(archiverManager);
stubFactory.setSrcFile(MojoExtension.getTestFile("test.txt"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class TestDestFileFilter {
private DependencyArtifactStubFactory fact;

@BeforeEach
void setUp() throws Exception {
void setUp() {
this.fact = new DependencyArtifactStubFactory(outputFolder, false);
}

Expand Down
Loading