diff --git a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java index c0b8c50b56f3..7d34098a4352 100644 --- a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java +++ b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java @@ -222,7 +222,7 @@ protected void validate(C context) throws Exception { .warnAboutDeprecatedOptions(context.invokerRequest.parserRequest(), context.logger::warn); } - protected void pushCoreProperties(C context) throws Exception { + protected void pushCoreProperties(C context) { System.setProperty( Constants.MAVEN_HOME, context.invokerRequest.installationDirectory().toString()); @@ -235,7 +235,7 @@ protected void pushCoreProperties(C context) throws Exception { * {@link PropertyContributor} SPI invocation, and "refreshes" already pushed user properties by re-writing them * as SPI may have modified them. */ - protected void pushUserProperties(C context) throws Exception { + protected void pushUserProperties(C context) { ProtoSession protoSession = context.protoSession; HashSet sys = new HashSet<>(protoSession.getSystemProperties().keySet()); if (context.pushedUserProperties == null) { @@ -493,7 +493,7 @@ protected String describe(Terminal terminal) { return terminal.getClass().getSimpleName() + " (" + String.join(", ", subs) + ")"; } - protected void preCommands(C context) throws Exception { + protected void preCommands(C context) { boolean verbose = context.invokerRequest.effectiveVerbose(); boolean version = context.invokerRequest.options().showVersion().orElse(false); if (verbose || version) { @@ -520,7 +520,7 @@ protected ContainerCapsuleFactory createContainerCapsuleFactory() { return new PlexusContainerCapsuleFactory<>(); } - protected void postContainer(C context) throws Exception { + protected void postContainer(C context) { ProtoSession protoSession = context.protoSession; for (PropertyContributor propertyContributor : context.lookup .lookup(PropertyContributorsHolder.class) @@ -533,13 +533,13 @@ protected void postContainer(C context) throws Exception { context.protoSession = protoSession; } - protected void lookup(C context) throws Exception { + protected void lookup(C context) { if (context.eventSpyDispatcher == null) { context.eventSpyDispatcher = context.lookup.lookup(EventSpyDispatcher.class); } } - protected void init(C context) throws Exception { + protected void init(C context) { Map data = new HashMap<>(); data.put("plexus", context.lookup.lookup(PlexusContainer.class)); data.put("workingDirectory", context.cwd.get().toString()); @@ -549,7 +549,7 @@ protected void init(C context) throws Exception { context.eventSpyDispatcher.init(() -> data); } - protected void postCommands(C context) throws Exception { + protected void postCommands(C context) { InvokerRequest invokerRequest = context.invokerRequest; Logger logger = context.logger; if (invokerRequest.options().showErrors().orElse(false)) { @@ -716,10 +716,9 @@ protected Runnable settings(C context, boolean emitSettingsWarnings, SettingsBui }; } - protected void customizeSettingsRequest(C context, SettingsBuilderRequest settingsBuilderRequest) - throws Exception {} + protected void customizeSettingsRequest(C context, SettingsBuilderRequest settingsBuilderRequest) {} - protected void customizeSettingsResult(C context, SettingsBuilderResult settingsBuilderResult) throws Exception {} + protected void customizeSettingsResult(C context, SettingsBuilderResult settingsBuilderResult) {} protected boolean mayDisableInteractiveMode(C context, boolean proposedInteractive) { if (!context.invokerRequest.options().forceInteractive().orElse(false)) { diff --git a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/PlexusContainerCapsuleFactory.java b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/PlexusContainerCapsuleFactory.java index d3463acaf772..c5f0014bcc13 100644 --- a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/PlexusContainerCapsuleFactory.java +++ b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/PlexusContainerCapsuleFactory.java @@ -200,11 +200,11 @@ protected LoggerManager createLoggerManager() { return new Slf4jLoggerManager(); } - protected void customizeContainerConfiguration(C context, ContainerConfiguration configuration) throws Exception {} + protected void customizeContainerConfiguration(C context, ContainerConfiguration configuration) {} - protected void customizeContainer(C context, PlexusContainer container) throws Exception {} + protected void customizeContainer(C context, PlexusContainer container) {} - protected List parseExtClasspath(C context) throws Exception { + protected List parseExtClasspath(C context) { ProtoSession protoSession = context.protoSession; String extClassPath = protoSession.getUserProperties().get(Constants.MAVEN_EXT_CLASS_PATH); if (extClassPath == null) { diff --git a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/MavenInvoker.java b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/MavenInvoker.java index 44b435712eaf..238ecdb78e6f 100644 --- a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/MavenInvoker.java +++ b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/MavenInvoker.java @@ -100,7 +100,7 @@ protected int execute(MavenContext context) throws Exception { return doExecute(context, request); } - protected MavenExecutionRequest prepareMavenExecutionRequest() throws Exception { + protected MavenExecutionRequest prepareMavenExecutionRequest() { // explicitly fill in "defaults"? DefaultMavenExecutionRequest mavenExecutionRequest = new DefaultMavenExecutionRequest(); mavenExecutionRequest.setRepositoryCache(new DefaultRepositoryCache()); @@ -453,7 +453,7 @@ protected void performProfileActivation(MavenContext context, ProfileActivation } } - protected int doExecute(MavenContext context, MavenExecutionRequest request) throws Exception { + protected int doExecute(MavenContext context, MavenExecutionRequest request) { context.eventSpyDispatcher.onEvent(request); MavenExecutionResult result; diff --git a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnenc/goals/Init.java b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnenc/goals/Init.java index a4e13bb78132..56a70fac9592 100644 --- a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnenc/goals/Init.java +++ b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnenc/goals/Init.java @@ -235,7 +235,7 @@ protected PromptBuilder dispatcherPrompt(PromptBuilder promptBuilder) { } private PromptBuilder configureDispatcher( - EncryptContext context, DispatcherMeta dispatcherMeta, PromptBuilder promptBuilder) throws Exception { + EncryptContext context, DispatcherMeta dispatcherMeta, PromptBuilder promptBuilder) { context.addInHeader( context.style.italic().bold().foreground(Colors.rgbColor("yellow")), "Configure " + dispatcherMeta.displayName()); diff --git a/impl/maven-cli/src/main/java/org/apache/maven/cling/transfer/SimplexTransferListener.java b/impl/maven-cli/src/main/java/org/apache/maven/cling/transfer/SimplexTransferListener.java index f8156154b0c2..f65b28852da5 100644 --- a/impl/maven-cli/src/main/java/org/apache/maven/cling/transfer/SimplexTransferListener.java +++ b/impl/maven-cli/src/main/java/org/apache/maven/cling/transfer/SimplexTransferListener.java @@ -215,7 +215,7 @@ public void process(Consumer consumer) { consumer.accept(event); } - public void waitForProcessed() throws InterruptedException { + public void waitForProcessed() { // nothing, is async } } diff --git a/impl/maven-core/src/main/java/org/apache/maven/configuration/internal/DefaultBeanConfigurator.java b/impl/maven-core/src/main/java/org/apache/maven/configuration/internal/DefaultBeanConfigurator.java index a6722fc5f4bc..b8233506055b 100644 --- a/impl/maven-core/src/main/java/org/apache/maven/configuration/internal/DefaultBeanConfigurator.java +++ b/impl/maven-core/src/main/java/org/apache/maven/configuration/internal/DefaultBeanConfigurator.java @@ -178,7 +178,7 @@ public boolean canConvert(Class type) { } @Override - protected Object fromString(String value) throws ComponentConfigurationException { + protected Object fromString(String value) { return Paths.get(value.replace('/' == File.separatorChar ? '\\' : '/', File.separatorChar)); } diff --git a/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java b/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java index f94271ed1f22..1b7fcb15041f 100644 --- a/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java +++ b/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java @@ -35,7 +35,6 @@ import org.apache.maven.execution.MavenSession; import org.apache.maven.internal.MultilineMessageHelper; import org.apache.maven.internal.impl.DefaultLifecycleRegistry; -import org.apache.maven.lifecycle.LifecycleExecutionException; import org.apache.maven.lifecycle.LifecycleNotFoundException; import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException; import org.apache.maven.lifecycle.MavenExecutionPlan; @@ -103,8 +102,7 @@ public MavenExecutionPlan resolveBuildPlan( MavenSession session, MavenProject project, TaskSegment taskSegment, Set projectArtifacts) throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, - NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException, - LifecycleExecutionException { + NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException { MavenExecutionPlan executionPlan = lifeCycleExecutionPlanCalculator.calculateExecutionPlan(session, project, taskSegment.getTasks()); diff --git a/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java b/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java index 3bca5cf6b3f3..3fb79123de26 100644 --- a/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java +++ b/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java @@ -34,7 +34,6 @@ import java.util.Optional; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ExecutionException; import java.util.concurrent.Executors; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; @@ -186,8 +185,7 @@ public BuildPlanExecutor( this.lifecycles = lifecycles; } - public void execute(MavenSession session, ReactorContext reactorContext, List taskSegments) - throws ExecutionException, InterruptedException { + public void execute(MavenSession session, ReactorContext reactorContext, List taskSegments) { try (BuildContext ctx = new BuildContext(session, reactorContext, taskSegments)) { ctx.execute(); } diff --git a/impl/maven-core/src/test/java/org/apache/maven/DefaultMavenTest.java b/impl/maven-core/src/test/java/org/apache/maven/DefaultMavenTest.java index 7c1f8e10205b..ce661848f364 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/DefaultMavenTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/DefaultMavenTest.java @@ -48,7 +48,7 @@ private static final class WsrClassCatcher extends AbstractMavenLifecyclePartici private final AtomicReference> wsrClassRef = new AtomicReference<>(null); @Override - public void afterProjectsRead(MavenSession session) throws MavenExecutionException { + public void afterProjectsRead(MavenSession session) { wsrClassRef.set(session.getRepositorySession().getWorkspaceReader().getClass()); } } diff --git a/impl/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorPathTest.java b/impl/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorPathTest.java index 263478ccb256..38cc360449ae 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorPathTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorPathTest.java @@ -41,12 +41,12 @@ class DefaultBeanConfiguratorPathTest { private BeanConfigurator configurator; @BeforeEach - void setUp() throws Exception { + void setUp() { configurator = new DefaultBeanConfigurator(); } @AfterEach - void tearDown() throws Exception { + void tearDown() { configurator = null; } diff --git a/impl/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java b/impl/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java index db0301f58135..f7509db9008c 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java @@ -39,12 +39,12 @@ class DefaultBeanConfiguratorTest { private BeanConfigurator configurator; @BeforeEach - void setUp() throws Exception { + void setUp() { configurator = new DefaultBeanConfigurator(); } @AfterEach - void tearDown() throws Exception { + void tearDown() { configurator = null; } diff --git a/impl/maven-core/src/test/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeTest.java b/impl/maven-core/src/test/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeTest.java index 09af78fb6e58..9e412ece185a 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeTest.java @@ -32,7 +32,7 @@ class MojoExecutionScopeTest { @Test - void testNestedEnter() throws Exception { + void testNestedEnter() { MojoExecutionScope scope = new MojoExecutionScope(); scope.enter(); diff --git a/impl/maven-core/src/test/java/org/apache/maven/internal/impl/DefaultChecksumAlgorithmServiceTest.java b/impl/maven-core/src/test/java/org/apache/maven/internal/impl/DefaultChecksumAlgorithmServiceTest.java index 3d46bc36ce84..0d70f839928d 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/internal/impl/DefaultChecksumAlgorithmServiceTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/internal/impl/DefaultChecksumAlgorithmServiceTest.java @@ -68,7 +68,7 @@ void emptySha1Calculator() { } @Test - void calculateByte() throws IOException { + void calculateByte() { Map checksums = service.calculate( "test".getBytes(StandardCharsets.UTF_8), service.select(Arrays.asList("SHA-1", "MD5"))); assertNotNull(checksums); @@ -78,7 +78,7 @@ void calculateByte() throws IOException { } @Test - void calculateByteBuffer() throws IOException { + void calculateByteBuffer() { Map checksums = service.calculate( ByteBuffer.wrap("test".getBytes(StandardCharsets.UTF_8)), service.select(Arrays.asList("SHA-1", "MD5"))); diff --git a/impl/maven-core/src/test/java/org/apache/maven/internal/transformation/AbstractRepositoryTestCase.java b/impl/maven-core/src/test/java/org/apache/maven/internal/transformation/AbstractRepositoryTestCase.java index d20e157c258b..05cd003f03ce 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/internal/transformation/AbstractRepositoryTestCase.java +++ b/impl/maven-core/src/test/java/org/apache/maven/internal/transformation/AbstractRepositoryTestCase.java @@ -61,7 +61,7 @@ public abstract class AbstractRepositoryTestCase { protected RepositorySystemSession session; @BeforeEach - public void setUp() throws Exception { + public void setUp() { session = newMavenRepositorySystemSession(system); } diff --git a/impl/maven-core/src/test/java/org/apache/maven/internal/transformation/impl/ConsumerPomBuilderTest.java b/impl/maven-core/src/test/java/org/apache/maven/internal/transformation/impl/ConsumerPomBuilderTest.java index 5bd794795259..3006a0e34587 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/internal/transformation/impl/ConsumerPomBuilderTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/internal/transformation/impl/ConsumerPomBuilderTest.java @@ -142,7 +142,7 @@ void testSimpleConsumer() throws Exception { } @Test - void testScmInheritance() throws Exception { + void testScmInheritance() { Model model = Model.newBuilder() .scm(Scm.newBuilder() .connection("scm:git:https://github.com/apache/maven-project.git") diff --git a/impl/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorSubModulesTest.java b/impl/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorSubModulesTest.java index 98c5c336a0c4..c4ef52fb1e12 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorSubModulesTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorSubModulesTest.java @@ -65,7 +65,7 @@ protected String getProjectsDirectory() { } @Test - void testCreation() throws Exception { + void testCreation() { assertNotNull(defaultLifeCycles); assertNotNull(mojoExecutor); assertNotNull(lifeCycleBuilder); diff --git a/impl/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java b/impl/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java index 800d4bf59924..34467abac830 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java @@ -285,7 +285,7 @@ void testLifecycleQueryingUsingADefaultLifecyclePhase() throws Exception { } @Test - void testLifecyclePluginsRetrievalForDefaultLifecycle() throws Exception { + void testLifecyclePluginsRetrievalForDefaultLifecycle() { List plugins = new ArrayList<>(lifecycleExecutor.getPluginsBoundByDefaultToAllLifecycles("jar")); assertThat(plugins.toString(), plugins, hasSize(8)); diff --git a/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/BuilderCommonTest.java b/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/BuilderCommonTest.java index c2ab0108266a..f2baa63e2de1 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/BuilderCommonTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/BuilderCommonTest.java @@ -79,13 +79,13 @@ void testDefaultBindingPluginsWarning() throws Exception { } @Test - void testHandleBuildError() throws Exception {} + void testHandleBuildError() {} @Test - void testAttachToThread() throws Exception {} + void testAttachToThread() {} @Test - void testGetKey() throws Exception {} + void testGetKey() {} public BuilderCommon getBuilderCommon(Logger logger) { final LifecycleDebugLogger debugLogger = new LifecycleDebugLogger(); diff --git a/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java b/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java index 6e97f804bca0..ceeb0c109056 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java +++ b/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java @@ -190,10 +190,7 @@ public static MavenExecutionPlan getProjectBExecutionPlan() return createExecutionPlan(ProjectDependencyGraphStub.B.getExecutionProject(), me); } - private static MavenExecutionPlan createExecutionPlan(MavenProject project, List mojoExecutions) - throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException, - NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, - PluginResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException { + private static MavenExecutionPlan createExecutionPlan(MavenProject project, List mojoExecutions) { final List planItemList = ExecutionPlanItem.createExecutionPlanItems(project, mojoExecutions); return new MavenExecutionPlan(planItemList, getDefaultLifecycles()); diff --git a/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStub.java b/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStub.java index f9a80b8659ff..c808fce1767b 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStub.java +++ b/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStub.java @@ -107,10 +107,7 @@ public static List getProjectBuilds(MavenSession session) } private static ProjectSegment createProjectBuild( - MavenProject project, MavenSession session, TaskSegment taskSegment) - throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException, - NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, - PluginResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException { + MavenProject project, MavenSession session, TaskSegment taskSegment) { final MavenSession session1 = session.clone(); return new ProjectSegment(project, taskSegment, session1); } diff --git a/impl/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java b/impl/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java index 0aa04debdf3c..abe176e7d696 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java @@ -48,8 +48,6 @@ import org.apache.maven.model.root.RootLocator; import org.apache.maven.plugin.descriptor.MojoDescriptor; import org.apache.maven.plugin.descriptor.PluginDescriptor; -import org.apache.maven.project.CycleDetectedException; -import org.apache.maven.project.DuplicateProjectException; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.MutablePlexusContainer; import org.codehaus.plexus.PlexusContainer; @@ -337,8 +335,7 @@ void testValueExtractionFromSystemPropertiesWithMissingProjectWithDotNotation() } @SuppressWarnings("deprecation") - private static MavenSession createSession(PlexusContainer container, ArtifactRepository repo, Properties properties) - throws CycleDetectedException, DuplicateProjectException { + private static MavenSession createSession(PlexusContainer container, ArtifactRepository repo, Properties properties) { MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setSystemProperties(properties) .setGoals(Collections.emptyList()) @@ -498,7 +495,7 @@ private ExpressionEvaluator createExpressionEvaluator( return new PluginParameterExpressionEvaluator(session, mojoExecution); } - protected Artifact createArtifact(String groupId, String artifactId, String version) throws Exception { + protected Artifact createArtifact(String groupId, String artifactId, String version) { Dependency dependency = new Dependency(); dependency.setGroupId(groupId); dependency.setArtifactId(artifactId); diff --git a/impl/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java b/impl/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java index 4b25cf559bcc..f6659f0a96f5 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java +++ b/impl/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java @@ -54,8 +54,6 @@ import org.apache.maven.model.root.RootLocator; import org.apache.maven.plugin.descriptor.MojoDescriptor; import org.apache.maven.plugin.descriptor.PluginDescriptor; -import org.apache.maven.project.CycleDetectedException; -import org.apache.maven.project.DuplicateProjectException; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.MutablePlexusContainer; import org.codehaus.plexus.PlexusContainer; @@ -293,7 +291,7 @@ public void testValueExtractionFromSystemPropertiesWithMissingProjectWithDotNota @SuppressWarnings("deprecation") private static MavenSession createSession(PlexusContainer container, ArtifactRepository repo, Properties properties) - throws CycleDetectedException, DuplicateProjectException, NoLocalRepositoryManagerException { + throws NoLocalRepositoryManagerException { MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setSystemProperties(properties) .setGoals(Collections.emptyList()) diff --git a/impl/maven-core/src/test/java/org/apache/maven/project/ExtensionDescriptorBuilderTest.java b/impl/maven-core/src/test/java/org/apache/maven/project/ExtensionDescriptorBuilderTest.java index 5e73daa27952..3f40ecd11f52 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/project/ExtensionDescriptorBuilderTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/project/ExtensionDescriptorBuilderTest.java @@ -42,12 +42,12 @@ class ExtensionDescriptorBuilderTest { private ExtensionDescriptorBuilder builder; @BeforeEach - void setUp() throws Exception { + void setUp() { builder = new ExtensionDescriptorBuilder(); } @AfterEach - void tearDown() throws Exception { + void tearDown() { builder = null; } diff --git a/impl/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java b/impl/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java index 4fe089e6ceff..1b596cf08546 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java @@ -84,7 +84,7 @@ class PomConstructionTest { private File testDirectory; @BeforeEach - void setUp() throws Exception { + void setUp() { testDirectory = new File(getBasedir(), BASE_POM_DIR); new File(getBasedir(), BASE_MIXIN_DIR); EmptyLifecycleBindingsInjector.useEmpty(); @@ -1226,7 +1226,7 @@ void testCompleteModelWithParent() throws Exception { } @SuppressWarnings("checkstyle:MethodLength") - private void testCompleteModel(PomTestWrapper pom) throws Exception { + private void testCompleteModel(PomTestWrapper pom) { assertEquals("4.0.0", pom.getValue("modelVersion")); assertEquals("org.apache.maven.its.mng", pom.getValue("groupId")); diff --git a/impl/maven-core/src/test/java/org/apache/maven/project/ProjectModelResolverTest.java b/impl/maven-core/src/test/java/org/apache/maven/project/ProjectModelResolverTest.java index 522fc58e0326..66ce39fba78d 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/project/ProjectModelResolverTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/project/ProjectModelResolverTest.java @@ -22,7 +22,6 @@ import java.util.Collections; import java.util.List; -import org.apache.maven.artifact.InvalidRepositoryException; import org.apache.maven.bridge.MavenRepositorySystem; import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; @@ -200,7 +199,7 @@ private ModelResolver newModelResolver() throws Exception { null); } - private List getRemoteRepositories() throws InvalidRepositoryException { + private List getRemoteRepositories() { final File repoDir = new File(getBasedir(), "src/test/remote-repo").getAbsoluteFile(); final RemoteRepository remoteRepository = new RemoteRepository.Builder( MavenRepositorySystem.DEFAULT_REMOTE_REPO_ID, diff --git a/impl/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java b/impl/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java index d42bcc078a35..2caed8536f24 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java @@ -34,7 +34,7 @@ class DefaultProjectArtifactsCacheTest { private ProjectArtifactsCache cache; @BeforeEach - void setUp() throws Exception { + void setUp() { cache = new DefaultProjectArtifactsCache(); } diff --git a/impl/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java b/impl/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java index ae1ee942cfd0..8fd9bc263766 100644 --- a/impl/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java +++ b/impl/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java @@ -67,7 +67,7 @@ class PomConstructionWithSettingsTest { private File testDirectory; @BeforeEach - void setUp() throws Exception { + void setUp() { testDirectory = new File(getBasedir(), BASE_POM_DIR); } diff --git a/impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultDependencyResolverResult.java b/impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultDependencyResolverResult.java index fa7ace6e0d05..645488e203ff 100644 --- a/impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultDependencyResolverResult.java +++ b/impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultDependencyResolverResult.java @@ -333,7 +333,7 @@ private boolean containsModule(String moduleName) throws IOException { * @param artifact the artifact identifier to search * @return path to the desired artifact, or {@code null} if not found */ - private Path findArtifactPath(String group, String artifact) throws IOException { + private Path findArtifactPath(String group, String artifact) { for (Map.Entry entry : dependencies.entrySet()) { Dependency dep = entry.getKey(); if (group.equals(dep.getGroupId()) && artifact.equals(dep.getArtifactId())) { diff --git a/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelProcessor.java b/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelProcessor.java index bcd0a191f8c3..e839e8ebb692 100644 --- a/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelProcessor.java +++ b/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelProcessor.java @@ -100,27 +100,15 @@ public Model read(XmlReaderRequest request) throws IOException { Path pomFile = request.getPath(); if (pomFile != null) { Path projectDirectory = pomFile.getParent(); - List exceptions = new ArrayList<>(); for (ModelParser parser : modelParsers) { - try { - Optional model = - parser.locateAndParse(projectDirectory, Map.of(ModelParser.STRICT, request.isStrict())); - if (model.isPresent()) { - return model.get().withPomFile(pomFile); - } - } catch (ModelParserException e) { - exceptions.add(e); + Optional model = + parser.locateAndParse(projectDirectory, Map.of(ModelParser.STRICT, request.isStrict())); + if (model.isPresent()) { + return model.get().withPomFile(pomFile); } } - try { - return doRead(request); - } catch (IOException e) { - exceptions.forEach(e::addSuppressed); - throw e; - } - } else { - return doRead(request); } + return doRead(request); } private Path doLocateExistingPom(Path project) { @@ -137,7 +125,7 @@ private Path doLocateExistingPom(Path project) { } } - private Model doRead(XmlReaderRequest request) throws IOException { + private Model doRead(XmlReaderRequest request) { return modelXmlFactory.read(request); } } diff --git a/impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultSettingsValidatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultSettingsValidatorTest.java index f604fe6bb3af..3ed7b4c2cd5a 100644 --- a/impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultSettingsValidatorTest.java +++ b/impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultSettingsValidatorTest.java @@ -38,7 +38,7 @@ class DefaultSettingsValidatorTest { private SettingsBuilder validator; @BeforeEach - void setUp() throws Exception { + void setUp() { validator = new DefaultSettingsBuilder(new DefaultSettingsXmlFactory(), new DefaultInterpolator(), Map.of()); } diff --git a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelInterpolatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelInterpolatorTest.java index 7afe7a82e2de..df9b90c76239 100644 --- a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelInterpolatorTest.java +++ b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelInterpolatorTest.java @@ -164,7 +164,7 @@ public void testDefaultBuildTimestampFormatWithLocalTimeZoneMidnightRollover() { } @Test - public void testShouldNotThrowExceptionOnReferenceToNonExistentValue() throws Exception { + public void testShouldNotThrowExceptionOnReferenceToNonExistentValue() { Scm scm = Scm.newBuilder().connection("${test}/somepath").build(); Model model = Model.newBuilder().scm(scm).build(); @@ -177,7 +177,7 @@ public void testShouldNotThrowExceptionOnReferenceToNonExistentValue() throws Ex } @Test - public void testShouldThrowExceptionOnRecursiveScmConnectionReference() throws Exception { + public void testShouldThrowExceptionOnRecursiveScmConnectionReference() { Scm scm = Scm.newBuilder() .connection("${project.scm.connection}/somepath") .build(); @@ -190,7 +190,7 @@ public void testShouldThrowExceptionOnRecursiveScmConnectionReference() throws E } @Test - public void testShouldNotThrowExceptionOnReferenceToValueContainingNakedExpression() throws Exception { + public void testShouldNotThrowExceptionOnReferenceToValueContainingNakedExpression() { Scm scm = Scm.newBuilder().connection("${test}/somepath").build(); Map props = new HashMap<>(); props.put("test", "test"); @@ -206,7 +206,7 @@ public void testShouldNotThrowExceptionOnReferenceToValueContainingNakedExpressi } @Test - void shouldInterpolateOrganizationNameCorrectly() throws Exception { + void shouldInterpolateOrganizationNameCorrectly() { String orgName = "MyCo"; Model model = Model.newBuilder() @@ -221,7 +221,7 @@ void shouldInterpolateOrganizationNameCorrectly() throws Exception { } @Test - public void shouldInterpolateDependencyVersionToSetSameAsProjectVersion() throws Exception { + public void shouldInterpolateDependencyVersionToSetSameAsProjectVersion() { Model model = Model.newBuilder() .version("3.8.1") .dependencies(Collections.singletonList( @@ -237,7 +237,7 @@ public void shouldInterpolateDependencyVersionToSetSameAsProjectVersion() throws } @Test - public void testShouldNotInterpolateDependencyVersionWithInvalidReference() throws Exception { + public void testShouldNotInterpolateDependencyVersionWithInvalidReference() { Model model = Model.newBuilder() .version("3.8.1") .dependencies(Collections.singletonList( @@ -253,7 +253,7 @@ public void testShouldNotInterpolateDependencyVersionWithInvalidReference() thro } @Test - public void testTwoReferences() throws Exception { + public void testTwoReferences() { Model model = Model.newBuilder() .version("3.8.1") .artifactId("foo") @@ -271,7 +271,7 @@ public void testTwoReferences() throws Exception { } @Test - public void testProperty() throws Exception { + public void testProperty() { Model model = Model.newBuilder() .version("3.8.1") .artifactId("foo") @@ -294,7 +294,7 @@ public void testProperty() throws Exception { } @Test - public void testBasedirUnx() throws Exception { + public void testBasedirUnx() { FileSystem fs = Jimfs.newFileSystem(Configuration.unix()); Path projectBasedir = fs.getPath("projectBasedir"); @@ -316,7 +316,7 @@ public void testBasedirUnx() throws Exception { } @Test - public void testBasedirWin() throws Exception { + public void testBasedirWin() { FileSystem fs = Jimfs.newFileSystem(Configuration.windows()); Path projectBasedir = fs.getPath("projectBasedir"); @@ -338,7 +338,7 @@ public void testBasedirWin() throws Exception { } @Test - public void testBaseUri() throws Exception { + public void testBaseUri() { Path projectBasedir = Paths.get("projectBasedir"); Model model = Model.newBuilder() @@ -360,7 +360,7 @@ public void testBaseUri() throws Exception { } @Test - void testRootDirectory() throws Exception { + void testRootDirectory() { Path rootDirectory = Paths.get("myRootDirectory"); Model model = Model.newBuilder() @@ -380,7 +380,7 @@ void testRootDirectory() throws Exception { } @Test - void testRootDirectoryWithUri() throws Exception { + void testRootDirectoryWithUri() { Path rootDirectory = Paths.get("myRootDirectory"); Model model = Model.newBuilder() @@ -402,7 +402,7 @@ void testRootDirectoryWithUri() throws Exception { } @Test - void testRootDirectoryWithNull() throws Exception { + void testRootDirectoryWithNull() { Path projectDirectory = Paths.get("myProjectDirectory"); this.rootDirectory = new AtomicReference<>(null); @@ -427,7 +427,7 @@ void testRootDirectoryWithNull() throws Exception { } @Test - public void testEnvars() throws Exception { + public void testEnvars() { context.put("env.HOME", "/path/to/home"); Map modelProperties = new HashMap<>(); @@ -444,7 +444,7 @@ public void testEnvars() throws Exception { } @Test - public void envarExpressionThatEvaluatesToNullReturnsTheLiteralString() throws Exception { + public void envarExpressionThatEvaluatesToNullReturnsTheLiteralString() { Map modelProperties = new HashMap<>(); modelProperties.put("outputDirectory", "${env.DOES_NOT_EXIST}"); @@ -460,7 +460,7 @@ public void envarExpressionThatEvaluatesToNullReturnsTheLiteralString() throws E } @Test - public void expressionThatEvaluatesToNullReturnsTheLiteralString() throws Exception { + public void expressionThatEvaluatesToNullReturnsTheLiteralString() { Map modelProperties = new HashMap<>(); modelProperties.put("outputDirectory", "${DOES_NOT_EXIST}"); @@ -475,7 +475,7 @@ public void expressionThatEvaluatesToNullReturnsTheLiteralString() throws Except } @Test - public void shouldInterpolateSourceDirectoryReferencedFromResourceDirectoryCorrectly() throws Exception { + public void shouldInterpolateSourceDirectoryReferencedFromResourceDirectoryCorrectly() { Model model = Model.newBuilder() .build(Build.newBuilder() .sourceDirectory("correct") @@ -497,7 +497,7 @@ public void shouldInterpolateSourceDirectoryReferencedFromResourceDirectoryCorre } @Test - public void shouldInterpolateUnprefixedBasedirExpression() throws Exception { + public void shouldInterpolateUnprefixedBasedirExpression() { Path basedir = Paths.get("/test/path"); Model model = Model.newBuilder() .dependencies(Collections.singletonList(Dependency.newBuilder() @@ -519,7 +519,7 @@ public void shouldInterpolateUnprefixedBasedirExpression() throws Exception { } @Test - public void testRecursiveExpressionCycleNPE() throws Exception { + public void testRecursiveExpressionCycleNPE() { Map props = new HashMap<>(); props.put("aa", "${bb}"); props.put("bb", "${aa}"); @@ -537,7 +537,7 @@ public void testRecursiveExpressionCycleNPE() throws Exception { @Disabled("per def cannot be recursive: ${basedir} is immediately going for project.basedir") @Test - public void testRecursiveExpressionCycleBaseDir() throws Exception { + public void testRecursiveExpressionCycleBaseDir() { Map props = new HashMap<>(); props.put("basedir", "${basedir}"); ModelBuilderRequest request = createModelBuildingRequest(Map.of()).build(); @@ -554,7 +554,7 @@ public void testRecursiveExpressionCycleBaseDir() throws Exception { } @Test - void shouldIgnorePropertiesWithPomPrefix() throws Exception { + void shouldIgnorePropertiesWithPomPrefix() { final String orgName = "MyCo"; final String uninterpolatedName = "${pom.organization.name} Tools"; diff --git a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelValidatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelValidatorTest.java index 06947221f3b5..8dedc2f11f1d 100644 --- a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelValidatorTest.java +++ b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelValidatorTest.java @@ -88,12 +88,12 @@ private void assertContains(String msg, String substring) { } @BeforeEach - void setUp() throws Exception { + void setUp() { validator = new DefaultModelValidator(); } @AfterEach - void tearDown() throws Exception { + void tearDown() { this.validator = null; } diff --git a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/AbstractProfileActivatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/AbstractProfileActivatorTest.java index 3829f03e49ad..119525fea4de 100644 --- a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/AbstractProfileActivatorTest.java +++ b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/AbstractProfileActivatorTest.java @@ -53,7 +53,7 @@ protected boolean isRootDirectory(Path dir) { abstract void setUp() throws Exception; @AfterEach - void tearDown() throws Exception { + void tearDown() { activator = null; } diff --git a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/ConditionProfileActivatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/ConditionProfileActivatorTest.java index 5d371c2fc3cc..7a484cd74231 100644 --- a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/ConditionProfileActivatorTest.java +++ b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/ConditionProfileActivatorTest.java @@ -75,7 +75,7 @@ private Map newJdkProperties(String javaVersion) { } @Test - void testNullSafe() throws Exception { + void testNullSafe() { Profile p = Profile.newInstance(); assertActivation(false, p, newContext(null, null)); @@ -86,7 +86,7 @@ void testNullSafe() throws Exception { } @Test - void testJdkPrefix() throws Exception { + void testJdkPrefix() { Profile profile = newProfile("inrange(${java.version}, '[1.4,1.5)')"); assertActivation(true, profile, newContext(null, newJdkProperties("1.4"))); @@ -100,7 +100,7 @@ void testJdkPrefix() throws Exception { } @Test - void testJdkPrefixNegated() throws Exception { + void testJdkPrefixNegated() { Profile profile = newProfile("not(inrange(${java.version}, '[1.4,1.5)'))"); assertActivation(false, profile, newContext(null, newJdkProperties("1.4"))); @@ -114,7 +114,7 @@ void testJdkPrefixNegated() throws Exception { } @Test - void testJdkVersionRangeInclusiveBounds() throws Exception { + void testJdkVersionRangeInclusiveBounds() { Profile profile = newProfile("inrange(${java.version}, '[1.5,1.6.1]')"); assertActivation(false, profile, newContext(null, newJdkProperties("1.4"))); @@ -135,7 +135,7 @@ void testJdkVersionRangeInclusiveBounds() throws Exception { } @Test - void testJdkVersionRangeExclusiveBounds() throws Exception { + void testJdkVersionRangeExclusiveBounds() { Profile profile = newProfile("inrange(${java.version}, '[1.3.1,1.6)')"); assertActivation(false, profile, newContext(null, newJdkProperties("1.3"))); @@ -157,7 +157,7 @@ void testJdkVersionRangeExclusiveBounds() throws Exception { } @Test - void testJdkVersionRangeInclusiveLowerBound() throws Exception { + void testJdkVersionRangeInclusiveLowerBound() { Profile profile = newProfile("inrange(${java.version}, '[1.5,)')"); assertActivation(false, profile, newContext(null, newJdkProperties("1.4"))); @@ -178,7 +178,7 @@ void testJdkVersionRangeInclusiveLowerBound() throws Exception { } @Test - void testJdkVersionRangeExclusiveUpperBound() throws Exception { + void testJdkVersionRangeExclusiveUpperBound() { Profile profile = newProfile("inrange(${java.version}, '(,1.6)')"); assertActivation(true, profile, newContext(null, newJdkProperties("1.5"))); @@ -222,7 +222,7 @@ private Map newOsProperties(String osName, String osVersion, Str } @Test - void testOsVersionStringComparison() throws Exception { + void testOsVersionStringComparison() { Profile profile = newProfile("inrange(${os.version}, '[6.5.0-1014-aws,6.6)')"); assertActivation(true, profile, newContext(null, newOsProperties("linux", "6.5.0-1014-aws", "amd64"))); @@ -232,7 +232,7 @@ void testOsVersionStringComparison() throws Exception { } @Test - void testOsVersionRegexMatching() throws Exception { + void testOsVersionRegexMatching() { Profile profile = newProfile("matches(${os.version}, '.*aws')"); assertActivation(true, profile, newContext(null, newOsProperties("linux", "6.5.0-1014-aws", "amd64"))); @@ -299,7 +299,7 @@ private Map newPropProperties(String key, String value) { } @Test - void testPropWithNameOnlyUserProperty() throws Exception { + void testPropWithNameOnlyUserProperty() { Profile profile = newProfile("${prop}"); assertActivation(true, profile, newContext(newPropProperties("prop", "value"), null)); @@ -308,7 +308,7 @@ void testPropWithNameOnlyUserProperty() throws Exception { } @Test - void testPropWithNameOnlySystemProperty() throws Exception { + void testPropWithNameOnlySystemProperty() { Profile profile = newProfile("${prop}"); assertActivation(true, profile, newContext(null, newPropProperties("prop", "value"))); @@ -317,7 +317,7 @@ void testPropWithNameOnlySystemProperty() throws Exception { } @Test - void testPropWithNegatedNameOnlyUserProperty() throws Exception { + void testPropWithNegatedNameOnlyUserProperty() { Profile profile = newProfile("not(${prop})"); assertActivation(false, profile, newContext(newPropProperties("prop", "value"), null)); @@ -326,7 +326,7 @@ void testPropWithNegatedNameOnlyUserProperty() throws Exception { } @Test - void testPropWithNegatedNameOnlySystemProperty() throws Exception { + void testPropWithNegatedNameOnlySystemProperty() { Profile profile = newProfile("not(${prop})"); assertActivation(false, profile, newContext(null, newPropProperties("prop", "value"))); @@ -335,7 +335,7 @@ void testPropWithNegatedNameOnlySystemProperty() throws Exception { } @Test - void testPropWithValueUserProperty() throws Exception { + void testPropWithValueUserProperty() { Profile profile = newProfile("${prop} == 'value'"); assertActivation(true, profile, newContext(newPropProperties("prop", "value"), null)); @@ -344,7 +344,7 @@ void testPropWithValueUserProperty() throws Exception { } @Test - void testPropWithValueSystemProperty() throws Exception { + void testPropWithValueSystemProperty() { Profile profile = newProfile("${prop} == 'value'"); assertActivation(true, profile, newContext(null, newPropProperties("prop", "value"))); @@ -353,7 +353,7 @@ void testPropWithValueSystemProperty() throws Exception { } @Test - void testPropWithNegatedValueUserProperty() throws Exception { + void testPropWithNegatedValueUserProperty() { Profile profile = newProfile("${prop} != 'value'"); assertActivation(false, profile, newContext(newPropProperties("prop", "value"), null)); @@ -362,7 +362,7 @@ void testPropWithNegatedValueUserProperty() throws Exception { } @Test - void testPropWithNegatedValueSystemProperty() throws Exception { + void testPropWithNegatedValueSystemProperty() { Profile profile = newProfile("${prop} != 'value'"); assertActivation(false, profile, newContext(null, newPropProperties("prop", "value"))); @@ -371,7 +371,7 @@ void testPropWithNegatedValueSystemProperty() throws Exception { } @Test - void testPropWithValueUserPropertyDominantOverSystemProperty() throws Exception { + void testPropWithValueUserPropertyDominantOverSystemProperty() { Profile profile = newProfile("${prop} == 'value'"); Map props1 = newPropProperties("prop", "value"); diff --git a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/JdkVersionProfileActivatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/JdkVersionProfileActivatorTest.java index 9f72bee87af1..3e473bb135e6 100644 --- a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/JdkVersionProfileActivatorTest.java +++ b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/JdkVersionProfileActivatorTest.java @@ -55,7 +55,7 @@ private Map newProperties(String javaVersion) { } @Test - void testNullSafe() throws Exception { + void testNullSafe() { Profile p = Profile.newInstance(); assertActivation(false, p, newContext(null, null)); @@ -66,7 +66,7 @@ void testNullSafe() throws Exception { } @Test - void testPrefix() throws Exception { + void testPrefix() { Profile profile = newProfile("1.4"); assertActivation(true, profile, newContext(null, newProperties("1.4"))); @@ -80,7 +80,7 @@ void testPrefix() throws Exception { } @Test - void testPrefixNegated() throws Exception { + void testPrefixNegated() { Profile profile = newProfile("!1.4"); assertActivation(false, profile, newContext(null, newProperties("1.4"))); @@ -94,7 +94,7 @@ void testPrefixNegated() throws Exception { } @Test - void testVersionRangeInclusiveBounds() throws Exception { + void testVersionRangeInclusiveBounds() { Profile profile = newProfile("[1.5,1.6]"); assertActivation(false, profile, newContext(null, newProperties("1.4"))); @@ -115,7 +115,7 @@ void testVersionRangeInclusiveBounds() throws Exception { } @Test - void testVersionRangeExclusiveBounds() throws Exception { + void testVersionRangeExclusiveBounds() { Profile profile = newProfile("(1.3,1.6)"); assertActivation(false, profile, newContext(null, newProperties("1.3"))); @@ -137,7 +137,7 @@ void testVersionRangeExclusiveBounds() throws Exception { } @Test - void testVersionRangeInclusiveLowerBound() throws Exception { + void testVersionRangeInclusiveLowerBound() { Profile profile = newProfile("[1.5,)"); assertActivation(false, profile, newContext(null, newProperties("1.4"))); @@ -158,7 +158,7 @@ void testVersionRangeInclusiveLowerBound() throws Exception { } @Test - void testVersionRangeExclusiveUpperBound() throws Exception { + void testVersionRangeExclusiveUpperBound() { Profile profile = newProfile("(,1.6)"); assertActivation(true, profile, newContext(null, newProperties("1.5"))); diff --git a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/OperatingSystemProfileActivatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/OperatingSystemProfileActivatorTest.java index 4f228a5f1495..8325214dba44 100644 --- a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/OperatingSystemProfileActivatorTest.java +++ b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/OperatingSystemProfileActivatorTest.java @@ -51,7 +51,7 @@ private Map newProperties(String osName, String osVersion, Strin } @Test - void testVersionStringComparison() throws Exception { + void testVersionStringComparison() { Profile profile = newProfile(ActivationOS.newBuilder().version("6.5.0-1014-aws")); assertActivation(true, profile, newContext(null, newProperties("linux", "6.5.0-1014-aws", "amd64"))); @@ -61,7 +61,7 @@ void testVersionStringComparison() throws Exception { } @Test - void testVersionRegexMatching() throws Exception { + void testVersionRegexMatching() { Profile profile = newProfile(ActivationOS.newBuilder().version("regex:.*aws")); assertActivation(true, profile, newContext(null, newProperties("linux", "6.5.0-1014-aws", "amd64"))); diff --git a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/PropertyProfileActivatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/PropertyProfileActivatorTest.java index 0f193614b20f..e5f569e26034 100644 --- a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/PropertyProfileActivatorTest.java +++ b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/profile/PropertyProfileActivatorTest.java @@ -54,7 +54,7 @@ private Map newProperties(String key, String value) { } @Test - void testNullSafe() throws Exception { + void testNullSafe() { Profile p = Profile.newInstance(); assertActivation(false, p, newContext(null, null)); @@ -65,7 +65,7 @@ void testNullSafe() throws Exception { } @Test - void testWithNameOnlyUserProperty() throws Exception { + void testWithNameOnlyUserProperty() { Profile profile = newProfile("prop", null); assertActivation(true, profile, newContext(newProperties("prop", "value"), null)); @@ -76,7 +76,7 @@ void testWithNameOnlyUserProperty() throws Exception { } @Test - void testWithNameOnlySystemProperty() throws Exception { + void testWithNameOnlySystemProperty() { Profile profile = newProfile("prop", null); assertActivation(true, profile, newContext(null, newProperties("prop", "value"))); @@ -87,7 +87,7 @@ void testWithNameOnlySystemProperty() throws Exception { } @Test - void testWithNegatedNameOnlyUserProperty() throws Exception { + void testWithNegatedNameOnlyUserProperty() { Profile profile = newProfile("!prop", null); assertActivation(false, profile, newContext(newProperties("prop", "value"), null)); @@ -98,7 +98,7 @@ void testWithNegatedNameOnlyUserProperty() throws Exception { } @Test - void testWithNegatedNameOnlySystemProperty() throws Exception { + void testWithNegatedNameOnlySystemProperty() { Profile profile = newProfile("!prop", null); assertActivation(false, profile, newContext(null, newProperties("prop", "value"))); @@ -109,7 +109,7 @@ void testWithNegatedNameOnlySystemProperty() throws Exception { } @Test - void testWithValueUserProperty() throws Exception { + void testWithValueUserProperty() { Profile profile = newProfile("prop", "value"); assertActivation(true, profile, newContext(newProperties("prop", "value"), null)); @@ -120,7 +120,7 @@ void testWithValueUserProperty() throws Exception { } @Test - void testWithValueSystemProperty() throws Exception { + void testWithValueSystemProperty() { Profile profile = newProfile("prop", "value"); assertActivation(true, profile, newContext(null, newProperties("prop", "value"))); @@ -131,7 +131,7 @@ void testWithValueSystemProperty() throws Exception { } @Test - void testWithNegatedValueUserProperty() throws Exception { + void testWithNegatedValueUserProperty() { Profile profile = newProfile("prop", "!value"); assertActivation(false, profile, newContext(newProperties("prop", "value"), null)); @@ -142,7 +142,7 @@ void testWithNegatedValueUserProperty() throws Exception { } @Test - void testWithNegatedValueSystemProperty() throws Exception { + void testWithNegatedValueSystemProperty() { Profile profile = newProfile("prop", "!value"); assertActivation(false, profile, newContext(null, newProperties("prop", "value"))); @@ -153,7 +153,7 @@ void testWithNegatedValueSystemProperty() throws Exception { } @Test - void testWithValueUserPropertyDominantOverSystemProperty() throws Exception { + void testWithValueUserPropertyDominantOverSystemProperty() { Profile profile = newProfile("prop", "value"); Map props1 = newProperties("prop", "value"); diff --git a/impl/maven-impl/src/test/java/org/apache/maven/impl/resolver/DefaultModelResolverTest.java b/impl/maven-impl/src/test/java/org/apache/maven/impl/resolver/DefaultModelResolverTest.java index e680267895ad..4f3777ed033d 100644 --- a/impl/maven-impl/src/test/java/org/apache/maven/impl/resolver/DefaultModelResolverTest.java +++ b/impl/maven-impl/src/test/java/org/apache/maven/impl/resolver/DefaultModelResolverTest.java @@ -209,7 +209,7 @@ void testResolveDependencySuccessfullyResolvesExistingDependencyUsingHighestVers assertEquals("1", modified.get().getVersion()); } - private ModelResolver newModelResolver() throws Exception { + private ModelResolver newModelResolver() { return new DefaultModelResolver(); } diff --git a/impl/maven-testing/src/main/java/org/apache/maven/api/plugin/testing/MojoExtension.java b/impl/maven-testing/src/main/java/org/apache/maven/api/plugin/testing/MojoExtension.java index e06ea7c58e7d..7a71b6f4c6d9 100644 --- a/impl/maven-testing/src/main/java/org/apache/maven/api/plugin/testing/MojoExtension.java +++ b/impl/maven-testing/src/main/java/org/apache/maven/api/plugin/testing/MojoExtension.java @@ -305,7 +305,7 @@ public Object resolveParameter(ParameterContext parameterContext, ExtensionConte * so we need to actually read the class file with ASM to find the annotation and * the goal. */ - private static String getGoalFromMojoImplementationClass(Class cl) throws IOException { + private static String getGoalFromMojoImplementationClass(Class cl) { return cl.getAnnotation(Named.class).value(); } diff --git a/impl/maven-xml/src/test/java/org/apache/maven/internal/xml/XmlNodeImplTest.java b/impl/maven-xml/src/test/java/org/apache/maven/internal/xml/XmlNodeImplTest.java index af2fcd3dbab7..94a7d9a85dc8 100644 --- a/impl/maven-xml/src/test/java/org/apache/maven/internal/xml/XmlNodeImplTest.java +++ b/impl/maven-xml/src/test/java/org/apache/maven/internal/xml/XmlNodeImplTest.java @@ -281,7 +281,7 @@ void testCombineKeys() throws Exception { } @Test - void testPreserveDominantBlankValue() throws XMLStreamException, IOException { + void testPreserveDominantBlankValue() throws XMLStreamException { String lhs = " "; String rhs = "recessive"; @@ -294,7 +294,7 @@ void testPreserveDominantBlankValue() throws XMLStreamException, IOException { } @Test - void testPreserveDominantEmptyNode() throws XMLStreamException, IOException { + void testPreserveDominantEmptyNode() throws XMLStreamException { String lhs = ""; String rhs = "recessive"; @@ -307,7 +307,7 @@ void testPreserveDominantEmptyNode() throws XMLStreamException, IOException { } @Test - void testPreserveDominantEmptyNode2() throws XMLStreamException, IOException { + void testPreserveDominantEmptyNode2() throws XMLStreamException { String lhs = ""; String rhs = "recessive"; @@ -690,7 +690,7 @@ private static XmlNode toXmlNode(Reader reader) throws XMLStreamException, IOExc } private static XmlNode toXmlNode(Reader reader, XmlService.InputLocationBuilder locationBuilder) - throws XMLStreamException, IOException { + throws XMLStreamException { return XmlService.read(reader, locationBuilder); } diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/HttpServer.java b/its/core-it-suite/src/test/java/org/apache/maven/it/HttpServer.java index 085e48c50fcd..fe5636a371be 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/HttpServer.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/HttpServer.java @@ -80,7 +80,7 @@ public HttpServer(int port, String username, String password, StreamSource sourc this.server = server(port); } - public void start() throws Exception { + public void start() { server.start(); // server.join(); } @@ -89,11 +89,11 @@ public boolean isFailed() { return server.isFailed(); } - public void stop() throws Exception { + public void stop() { server.stop(); } - public void join() throws Exception { + public void join() { server.join(); } diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0108SnapshotUpdateTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0108SnapshotUpdateTest.java index cbd4c4a972be..f930b0ac93c2 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0108SnapshotUpdateTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0108SnapshotUpdateTest.java @@ -222,7 +222,7 @@ private static File getLocalRepoFile(Verifier verifier) { return new File(verifier.getArtifactPath("org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar")); } - private static void recreateRemoteRepository(File repository) throws IOException { + private static void recreateRemoteRepository(File repository) { // create a repository (TODO: into verifier) FileUtils.deleteDirectory(repository); assertFalse(repository.exists()); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java index 0d4aa63e6585..38cb8f8f1094 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java @@ -46,7 +46,7 @@ public MavenIT0146InstallerSnapshotNaming() throws IOException { } @BeforeEach - protected void setUp() throws Exception { + protected void setUp() { ResourceHandler resourceHandler = new ResourceHandler(); resourceHandler.setResourceBase(new File(testDir, "repo").getAbsolutePath()); HandlerList handlers = new HandlerList(); @@ -63,7 +63,7 @@ protected void setUp() throws Exception { } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java index aaee06396b54..25c387e890ee 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java @@ -98,7 +98,7 @@ protected void setUp() throws Exception { } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0768OfflineModeTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0768OfflineModeTest.java index 01c457873601..642ed9bbad23 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0768OfflineModeTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0768OfflineModeTest.java @@ -22,7 +22,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; @@ -63,8 +62,7 @@ public void testitMNG768() throws Exception { Handler repoHandler = new AbstractHandler() { public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { + String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); requestedUris.add(request.getRequestURI()); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2305MultipleProxiesTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2305MultipleProxiesTest.java index adc45a1bcd4b..d2537b1de7b5 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2305MultipleProxiesTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2305MultipleProxiesTest.java @@ -22,7 +22,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.io.IOException; import java.io.PrintWriter; import java.util.List; import java.util.Map; @@ -137,8 +136,7 @@ private void addHttpsConnector(Server server, String keyStorePath, String keySto } static class RepoHandler extends AbstractHandler { - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { + public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { PrintWriter writer = response.getWriter(); String uri = request.getRequestURI(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2362DeployedPomEncodingTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2362DeployedPomEncodingTest.java index 6b611aa86147..5133ee232444 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2362DeployedPomEncodingTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2362DeployedPomEncodingTest.java @@ -83,7 +83,7 @@ private void assertPomLatin1(File pomFile) throws Exception { assertPom(pomFile, pom, chars); } - private void assertPom(File pomFile, String pom, String chars) throws Exception { + private void assertPom(File pomFile, String pom, String chars) { String prefix = "TEST-CHARS: "; int pos = pom.indexOf(prefix); assertTrue( diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java index 046dc1131432..0bf1df1fd10e 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java @@ -89,7 +89,7 @@ protected void setUp() throws Exception { } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2820PomCommentsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2820PomCommentsTest.java index 91db4f5e2cc6..0375df24053b 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2820PomCommentsTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2820PomCommentsTest.java @@ -72,7 +72,7 @@ private void assertPomComments(File pomFile) throws Exception { assertPomComment(pom, "INLINE-COMMENT-3"); } - private void assertPomComment(String pom, String comment) throws Exception { + private void assertPomComment(String pom, String comment) { assertTrue(pom.contains(comment), "Missing comment: " + comment); } } diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2972OverridePluginDependencyTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2972OverridePluginDependencyTest.java index 70bad20dea81..2ed89518d113 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2972OverridePluginDependencyTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2972OverridePluginDependencyTest.java @@ -92,7 +92,7 @@ public void testitCommandLineInvocation() throws Exception { verify(pclProps); } - private void verify(Properties pclProps) throws Exception { + private void verify(Properties pclProps) { assertNotNull(pclProps.getProperty("org.apache.maven.its.mng2972.MNG2972")); assertNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassA")); assertNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassB")); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3461MirrorMatchingTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3461MirrorMatchingTest.java index ec316ddc1454..ebd1044e8293 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3461MirrorMatchingTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3461MirrorMatchingTest.java @@ -22,7 +22,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.io.IOException; import java.util.Map; import org.eclipse.jetty.server.Handler; @@ -82,8 +81,7 @@ public void testitExternalWildcard() throws Exception { Handler repoHandler = new AbstractHandler() { @Override public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { + String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); if (request.getRequestURI().endsWith("/b-0.1.jar")) { diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3599useHttpProxyForWebDAVMk2Test.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3599useHttpProxyForWebDAVMk2Test.java index e771a99e3519..1f3dd10b5b34 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3599useHttpProxyForWebDAVMk2Test.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3599useHttpProxyForWebDAVMk2Test.java @@ -22,7 +22,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.io.IOException; import java.nio.file.Files; import org.codehaus.plexus.util.StringUtils; @@ -64,11 +63,10 @@ public MavenITmng3599useHttpProxyForWebDAVMk2Test() { } @BeforeEach - protected void setUp() throws Exception { + protected void setUp() { Handler handler = new AbstractHandler() { public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { + String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { System.out.println("Got request for URL: '" + request.getRequestURL() + "'"); System.out.flush(); @@ -123,7 +121,7 @@ else if (request.getRequestURI().startsWith("/org/apache/maven/its/mng3599/test- } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3652UserAgentHeaderTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3652UserAgentHeaderTest.java index 5bd2b5d35ee8..4fe513fb0f2c 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3652UserAgentHeaderTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3652UserAgentHeaderTest.java @@ -22,7 +22,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.io.IOException; import java.util.List; import org.eclipse.jetty.server.Handler; @@ -56,12 +55,11 @@ class MavenITmng3652UserAgentHeaderTest extends AbstractMavenIntegrationTestCase } @BeforeEach - protected void setUp() throws Exception { + protected void setUp() { Handler handler = new AbstractHandler() { @Override public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { + String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { System.out.println("Handling URL: '" + request.getRequestURL() + "'"); userAgent = request.getHeader("User-Agent"); @@ -90,7 +88,7 @@ public void handle( } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3953AuthenticatedDeploymentTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3953AuthenticatedDeploymentTest.java index 703ec311f422..17c65a7321f9 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3953AuthenticatedDeploymentTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3953AuthenticatedDeploymentTest.java @@ -60,7 +60,7 @@ public MavenITmng3953AuthenticatedDeploymentTest() { } @BeforeEach - protected void setUp() throws Exception { + protected void setUp() { Handler repoHandler = new AbstractHandler() { @Override public void handle( @@ -113,7 +113,7 @@ public void handle( } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4068AuthenticatedMirrorTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4068AuthenticatedMirrorTest.java index cf15514aa899..fbd1b4e2efe9 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4068AuthenticatedMirrorTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4068AuthenticatedMirrorTest.java @@ -99,7 +99,7 @@ protected void setUp() throws Exception { } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4235HttpAuthDeploymentChecksumsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4235HttpAuthDeploymentChecksumsTest.java index 6c500ba21751..35a56941ae61 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4235HttpAuthDeploymentChecksumsTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4235HttpAuthDeploymentChecksumsTest.java @@ -113,7 +113,7 @@ protected void setUp() throws Exception { } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest.java index 1ea9298444fb..706b3a3ae1ee 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest.java @@ -22,7 +22,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.io.IOException; import java.io.PrintWriter; import java.util.Date; import java.util.Deque; @@ -75,8 +74,7 @@ public void testit() throws Exception { Handler repoHandler = new AbstractHandler() { @Override public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { + String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { PrintWriter writer = response.getWriter(); String uri = request.getRequestURI(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4343MissingReleaseUpdatePolicyTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4343MissingReleaseUpdatePolicyTest.java index 5b7466ea5396..360377ee6f5b 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4343MissingReleaseUpdatePolicyTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4343MissingReleaseUpdatePolicyTest.java @@ -22,7 +22,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.io.IOException; import java.io.PrintWriter; import java.util.Deque; import java.util.Map; @@ -59,12 +58,11 @@ public MavenITmng4343MissingReleaseUpdatePolicyTest() { } @BeforeEach - protected void setUp() throws Exception { + protected void setUp() { Handler repoHandler = new AbstractHandler() { @Override public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { + String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); if (request.getRequestURI().startsWith("/org/apache/maven/its/mng4343")) { @@ -109,7 +107,7 @@ public void handle( } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4360WebDavSupportTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4360WebDavSupportTest.java index 15a4d1c2be01..bd2b99bbf8b2 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4360WebDavSupportTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4360WebDavSupportTest.java @@ -22,7 +22,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.io.IOException; import java.io.PrintWriter; import java.util.List; import java.util.Map; @@ -80,8 +79,7 @@ private void test(String project) throws Exception { Handler repoHandler = new AbstractHandler() { @Override public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { + String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); PrintWriter writer = response.getWriter(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4428FollowHttpRedirectTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4428FollowHttpRedirectTest.java index a6416cf4dcc8..f7644f26115f 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4428FollowHttpRedirectTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4428FollowHttpRedirectTest.java @@ -22,7 +22,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.io.IOException; import java.io.PrintWriter; import java.util.List; import java.util.Map; @@ -167,8 +166,7 @@ static class RedirectHandler extends AbstractHandler { this.connector = connector; } - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { + public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); PrintWriter writer = response.getWriter(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4469AuthenticatedDeploymentToCustomRepoTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4469AuthenticatedDeploymentToCustomRepoTest.java index 9b826794605e..7649b94f2e21 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4469AuthenticatedDeploymentToCustomRepoTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4469AuthenticatedDeploymentToCustomRepoTest.java @@ -60,7 +60,7 @@ public MavenITmng4469AuthenticatedDeploymentToCustomRepoTest() { } @BeforeEach - protected void setUp() throws Exception { + protected void setUp() { Handler repoHandler = new AbstractHandler() { @Override public void handle( @@ -113,7 +113,7 @@ public void handle( } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4470AuthenticatedDeploymentToProxyTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4470AuthenticatedDeploymentToProxyTest.java index e3c1e4ea09a4..c34f64f9e649 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4470AuthenticatedDeploymentToProxyTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4470AuthenticatedDeploymentToProxyTest.java @@ -69,7 +69,7 @@ public MavenITmng4470AuthenticatedDeploymentToProxyTest() { } @BeforeEach - protected void setUp() throws Exception { + protected void setUp() { Handler proxyHandler = new AbstractHandler() { @Override public void handle( @@ -166,7 +166,7 @@ public void handle( } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4781DeploymentToNexusStagingRepoTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4781DeploymentToNexusStagingRepoTest.java index a70fc297496a..961d826cba23 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4781DeploymentToNexusStagingRepoTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4781DeploymentToNexusStagingRepoTest.java @@ -56,7 +56,7 @@ public MavenITmng4781DeploymentToNexusStagingRepoTest() { } @BeforeEach - public void setUp() throws Exception { + public void setUp() { Handler repoHandler = new AbstractHandler() { private volatile boolean putSeen; @@ -94,7 +94,7 @@ public void handle( } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5175WagonHttpTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5175WagonHttpTest.java index 89ab0311d24f..7334d3f26725 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5175WagonHttpTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5175WagonHttpTest.java @@ -84,7 +84,7 @@ public void handle( } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5280SettingsProfilesRepositoriesOrderTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5280SettingsProfilesRepositoriesOrderTest.java index fe5f6d302553..761599029689 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5280SettingsProfilesRepositoriesOrderTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5280SettingsProfilesRepositoriesOrderTest.java @@ -60,7 +60,7 @@ protected void setUp() throws Exception { } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); @@ -140,8 +140,7 @@ private static final class RepoHandler extends AbstractHandler { private volatile boolean artifactRequestedFromRepo2; - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { + public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { String uri = request.getRequestURI(); if (uri.startsWith("/repo1/org/apache/maven/its/mng5280/fake-artifact/1.0/")) { diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5868NoDuplicateAttachedArtifacts.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5868NoDuplicateAttachedArtifacts.java index ae2e0fdccb6e..2dab39ff7894 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5868NoDuplicateAttachedArtifacts.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5868NoDuplicateAttachedArtifacts.java @@ -96,7 +96,7 @@ public void handle( } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7819FileLockingWithSnapshotsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7819FileLockingWithSnapshotsTest.java index 35d4235893e9..5a764d49dc10 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7819FileLockingWithSnapshotsTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7819FileLockingWithSnapshotsTest.java @@ -63,7 +63,7 @@ protected void setUp() throws Exception { } @AfterEach - protected void tearDown() throws Exception { + protected void tearDown() { if (server != null) { server.stop(); server.join(); diff --git a/its/core-it-suite/src/test/resources/mng-0624/parentBadPath/main/src/test/java/mng0624/HelloTest.java b/its/core-it-suite/src/test/resources/mng-0624/parentBadPath/main/src/test/java/mng0624/HelloTest.java index 70f6064c7058..36473c39d705 100644 --- a/its/core-it-suite/src/test/resources/mng-0624/parentBadPath/main/src/test/java/mng0624/HelloTest.java +++ b/its/core-it-suite/src/test/resources/mng-0624/parentBadPath/main/src/test/java/mng0624/HelloTest.java @@ -21,7 +21,7 @@ import junit.framework.TestCase; public class HelloTest extends TestCase { - public void testHello() throws Exception { + public void testHello() { Hello hello = new Hello(); hello.helloWorld(); } diff --git a/its/core-it-suite/src/test/resources/mng-5208/spy/src/main/java/mng5208/EventLoggerSpy.java b/its/core-it-suite/src/test/resources/mng-5208/spy/src/main/java/mng5208/EventLoggerSpy.java index 43e5f774fcf3..29c196308c50 100644 --- a/its/core-it-suite/src/test/resources/mng-5208/spy/src/main/java/mng5208/EventLoggerSpy.java +++ b/its/core-it-suite/src/test/resources/mng-5208/spy/src/main/java/mng5208/EventLoggerSpy.java @@ -27,10 +27,10 @@ public class EventLoggerSpy extends AbstractEventSpy { @Override - public void init(Context context) throws Exception {} + public void init(Context context) {} @Override - public void onEvent(Object event) throws Exception { + public void onEvent(Object event) { if (event instanceof ExecutionEvent) { ExecutionEvent executionEvent = (ExecutionEvent) event; diff --git a/its/core-it-suite/src/test/resources/mng-5774-configuration-processors/configuration-processor-one/src/main/java/org/apache/maven/its/configuration_processors/ConfigurationProcessorOne.java b/its/core-it-suite/src/test/resources/mng-5774-configuration-processors/configuration-processor-one/src/main/java/org/apache/maven/its/configuration_processors/ConfigurationProcessorOne.java index d22c13123e40..7666bf317e8f 100644 --- a/its/core-it-suite/src/test/resources/mng-5774-configuration-processors/configuration-processor-one/src/main/java/org/apache/maven/its/configuration_processors/ConfigurationProcessorOne.java +++ b/its/core-it-suite/src/test/resources/mng-5774-configuration-processors/configuration-processor-one/src/main/java/org/apache/maven/its/configuration_processors/ConfigurationProcessorOne.java @@ -28,7 +28,7 @@ public class ConfigurationProcessorOne implements ConfigurationProcessor { private Logger logger = LoggerFactory.getLogger(ConfigurationProcessorOne.class); - public void process(CliRequest request) throws Exception { + public void process(CliRequest request) { logger.info("ConfigurationProcessorOne.process()"); request.getUserProperties().put("answer", "yes"); } diff --git a/its/core-it-suite/src/test/resources/mng-5774-configuration-processors/configuration-processor-two/src/main/java/org/apache/maven/its/configuration_processors/ConfigurationProcessorTwo.java b/its/core-it-suite/src/test/resources/mng-5774-configuration-processors/configuration-processor-two/src/main/java/org/apache/maven/its/configuration_processors/ConfigurationProcessorTwo.java index 773ef3511090..81c6ca550a95 100644 --- a/its/core-it-suite/src/test/resources/mng-5774-configuration-processors/configuration-processor-two/src/main/java/org/apache/maven/its/configuration_processors/ConfigurationProcessorTwo.java +++ b/its/core-it-suite/src/test/resources/mng-5774-configuration-processors/configuration-processor-two/src/main/java/org/apache/maven/its/configuration_processors/ConfigurationProcessorTwo.java @@ -24,5 +24,5 @@ @Component(role = ConfigurationProcessor.class, hint = "maven-core-it-two") public class ConfigurationProcessorTwo implements ConfigurationProcessor { - public void process(CliRequest request) throws Exception {} + public void process(CliRequest request) {} } diff --git a/its/core-it-suite/src/test/resources/mng-7587-jsr330/plugin/src/test/MyMojoTest.java b/its/core-it-suite/src/test/resources/mng-7587-jsr330/plugin/src/test/MyMojoTest.java index 07172cab3e7f..a6d13f73248b 100644 --- a/its/core-it-suite/src/test/resources/mng-7587-jsr330/plugin/src/test/MyMojoTest.java +++ b/its/core-it-suite/src/test/resources/mng-7587-jsr330/plugin/src/test/MyMojoTest.java @@ -15,7 +15,7 @@ public class MyMojoTest public MojoRule rule = new MojoRule() { @Override - protected void before() throws Throwable + protected void before() { } diff --git a/its/core-it-suite/src/test/resources/mng-7836-alternative-pom-syntax/maven-hocon-extension/src/test/java/org/apache/maven/hocon/ParsingTest.java b/its/core-it-suite/src/test/resources/mng-7836-alternative-pom-syntax/maven-hocon-extension/src/test/java/org/apache/maven/hocon/ParsingTest.java index 6f611af0f198..db23b6606ab0 100644 --- a/its/core-it-suite/src/test/resources/mng-7836-alternative-pom-syntax/maven-hocon-extension/src/test/java/org/apache/maven/hocon/ParsingTest.java +++ b/its/core-it-suite/src/test/resources/mng-7836-alternative-pom-syntax/maven-hocon-extension/src/test/java/org/apache/maven/hocon/ParsingTest.java @@ -30,7 +30,7 @@ class ParsingTest { @Test - void testParse() throws Exception { + void testParse() { Config config = ConfigFactory.parseFile(new File("src/test/resources/pom.hocon")); Model model = new HoconReader().parseModel(config.root()); diff --git a/its/core-it-suite/src/test/resources/mng-8461/extension/src/main/java/org/example/SimpleEventSpy.java b/its/core-it-suite/src/test/resources/mng-8461/extension/src/main/java/org/example/SimpleEventSpy.java index d2ca3d3893b4..57fd85cc56db 100644 --- a/its/core-it-suite/src/test/resources/mng-8461/extension/src/main/java/org/example/SimpleEventSpy.java +++ b/its/core-it-suite/src/test/resources/mng-8461/extension/src/main/java/org/example/SimpleEventSpy.java @@ -36,17 +36,17 @@ public class SimpleEventSpy implements EventSpy { private final List events = new ArrayList<>(); @Override - public void init(Context context) throws Exception { + public void init(Context context) { System.out.println("Initializing Simple Event Spy"); } @Override - public void onEvent(Object o) throws Exception { + public void onEvent(Object o) { events.add(o); } @Override - public void close() throws Exception { + public void close() { System.out.println("Closing Simple Event Spy, checking events"); checkEvent(SettingsBuilderRequest.class); checkEvent(SettingsBuilderResult.class); diff --git a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java index 744dcfd8c6d7..72713467a31f 100644 --- a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java +++ b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java @@ -239,7 +239,7 @@ ArtifactVersion removePattern(ArtifactVersion version) { return version; } - protected File extractResources(String resourcePath) throws IOException { + protected File extractResources(String resourcePath) { return new File( new File(System.getProperty("maven.test.tmpdir", System.getProperty("java.io.tmpdir"))), resourcePath) diff --git a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java index 0b0dd2a1edb9..608e08b004b4 100644 --- a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java +++ b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java @@ -170,7 +170,7 @@ public void setExecutable(String executable) { this.executable = requireNonNull(executable); } - public void execute() throws VerificationException { + public void execute() { List args = new ArrayList<>(defaultCliArguments); for (String cliArgument : cliArguments) { args.add(cliArgument.replace("${basedir}", getBasedir())); @@ -257,7 +257,7 @@ public void execute() throws VerificationException { } } - public String getMavenVersion() throws VerificationException { + public String getMavenVersion() { return executorHelper.mavenVersion(); } @@ -809,7 +809,7 @@ public String getArtifactMetadataPath(String gid, String aid) { return getArtifactMetadataPath(gid, aid, null); } - public void deleteArtifact(String org, String name, String version, String ext) throws IOException { + public void deleteArtifact(String org, String name, String version, String ext) { List files = getArtifactFileNameList(org, name, version, ext); for (String fileName : files) { FileUtils.forceDelete(new File(fileName)); diff --git a/its/core-it-support/maven-it-sample-archetype/src/main/resources/archetype-resources/src/test/java/MavenITmngXXXXDescriptionOfProblemTest.java b/its/core-it-support/maven-it-sample-archetype/src/main/resources/archetype-resources/src/test/java/MavenITmngXXXXDescriptionOfProblemTest.java index 5538d59f90eb..0606dc53b27f 100644 --- a/its/core-it-support/maven-it-sample-archetype/src/main/resources/archetype-resources/src/test/java/MavenITmngXXXXDescriptionOfProblemTest.java +++ b/its/core-it-support/maven-it-sample-archetype/src/main/resources/archetype-resources/src/test/java/MavenITmngXXXXDescriptionOfProblemTest.java @@ -57,7 +57,6 @@ public MavenITmngXXXXDescriptionOfProblemTest() @Test public void testitMNGxxxx () - throws Exception { // The testdir is computed from the location of this diff --git a/src/mdo/java/WrapperList.java b/src/mdo/java/WrapperList.java index 8de3ef32bdcc..8411a5bc03f2 100644 --- a/src/mdo/java/WrapperList.java +++ b/src/mdo/java/WrapperList.java @@ -18,7 +18,6 @@ */ package ${package}; -import java.io.ObjectStreamException; import java.io.Serializable; import java.util.AbstractList; import java.util.ArrayList; @@ -105,7 +104,7 @@ public T remove(int index) { } } - private Object writeReplace() throws ObjectStreamException { + private Object writeReplace() { return new ArrayList(this); } } diff --git a/src/mdo/java/WrapperProperties.java b/src/mdo/java/WrapperProperties.java index 4a8641a8b992..38cf9d11c628 100644 --- a/src/mdo/java/WrapperProperties.java +++ b/src/mdo/java/WrapperProperties.java @@ -372,7 +372,7 @@ public void storeToXML(OutputStream os, String comment, String encoding) throws } - private Object writeReplace() throws java.io.ObjectStreamException { + private Object writeReplace() { Properties props = new Properties(); props.putAll(getter.get()); return props;