Add serialVersionUID to API exceptions

This commit is contained in:
Guillaume Nodet 2024-10-02 13:02:00 +02:00
parent 1062d05cb0
commit 5c981cdef0
18 changed files with 85 additions and 0 deletions

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Experimental;
/**
@ -31,6 +33,7 @@ public class ArtifactDeployerException extends MavenException {
/**
*
*/
@Serial
private static final long serialVersionUID = 7421964724059077698L;
/**

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Experimental;
/**
@ -29,6 +31,7 @@ public class ArtifactInstallerException extends MavenException {
/**
*
*/
@Serial
private static final long serialVersionUID = 3652561971360586373L;
/**

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Experimental;
/**
@ -28,6 +30,7 @@ import org.apache.maven.api.annotations.Experimental;
@Experimental
public class ArtifactResolverException extends MavenException {
@Serial
private static final long serialVersionUID = 7252294837746943917L;
/**

View File

@ -18,11 +18,14 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Experimental;
@Experimental
public class ChecksumAlgorithmServiceException extends MavenException {
@Serial
private static final long serialVersionUID = 1201171469179367694L;
public ChecksumAlgorithmServiceException(String message, Throwable cause) {

View File

@ -18,11 +18,14 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Experimental;
@Experimental
public class DependencyResolverException extends MavenException {
@Serial
private static final long serialVersionUID = 1101171569179057614L;
public DependencyResolverException(String message, Throwable cause) {

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Experimental;
/**
@ -28,6 +30,9 @@ import org.apache.maven.api.annotations.Experimental;
@Experimental
public class LookupException extends MavenException {
@Serial
private static final long serialVersionUID = -6259322450070320286L;
public LookupException(String message) {
super(message);
}

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Experimental;
/**
@ -27,6 +29,10 @@ import org.apache.maven.api.annotations.Experimental;
*/
@Experimental
public class MavenException extends RuntimeException {
@Serial
private static final long serialVersionUID = 9027638326336093132L;
public MavenException() {}
public MavenException(String message) {

View File

@ -18,6 +18,7 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import java.util.Collections;
import java.util.List;
@ -31,6 +32,9 @@ import org.apache.maven.api.annotations.Experimental;
@Experimental
public class ModelBuilderException extends MavenException {
@Serial
private static final long serialVersionUID = -1865447022070650896L;
private final ModelBuilderResult result;
/**

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Experimental;
/**
@ -27,6 +29,10 @@ import org.apache.maven.api.annotations.Experimental;
*/
@Experimental
public class ProjectBuilderException extends MavenException {
@Serial
private static final long serialVersionUID = -7629871850875943799L;
/**
* @param message the message to give
* @param e the {@link Exception}

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Experimental;
/**
@ -27,6 +29,10 @@ import org.apache.maven.api.annotations.Experimental;
*/
@Experimental
public class PrompterException extends MavenException {
@Serial
private static final long serialVersionUID = -3505070928479515081L;
/**
* @param message the message to give
* @param e the {@link Exception}

View File

@ -18,6 +18,7 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import java.util.List;
import java.util.stream.Collectors;
@ -31,6 +32,9 @@ import org.apache.maven.api.annotations.Experimental;
@Experimental
public class SettingsBuilderException extends MavenException {
@Serial
private static final long serialVersionUID = 4714858598345418083L;
private final List<BuilderProblem> problems;
/**

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
/**
* Exceptions thrown by the {@link SuperPomProvider} service.
*
@ -25,6 +27,9 @@ package org.apache.maven.api.services;
*/
public class SuperPomProviderException extends MavenException {
@Serial
private static final long serialVersionUID = -8659892034004509331L;
public SuperPomProviderException() {
super();
}

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Experimental;
/**
@ -27,6 +29,10 @@ import org.apache.maven.api.annotations.Experimental;
*/
@Experimental
public class ToolchainManagerException extends MavenException {
@Serial
private static final long serialVersionUID = -9465854226608498L;
/**
* @param message the message to give
* @param e the {@link Exception}

View File

@ -18,6 +18,7 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import java.util.List;
import java.util.stream.Collectors;
@ -31,6 +32,9 @@ import org.apache.maven.api.annotations.Experimental;
@Experimental
public class ToolchainsBuilderException extends MavenException {
@Serial
private static final long serialVersionUID = 7899871809665729349L;
private final List<BuilderProblem> problems;
/**

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Consumer;
import org.apache.maven.api.annotations.Experimental;
@ -27,6 +29,10 @@ import org.apache.maven.api.annotations.Experimental;
@Experimental
@Consumer
public class TransportProviderException extends MavenException {
@Serial
private static final long serialVersionUID = -6066070072576465969L;
public TransportProviderException(String message, Throwable cause) {
super(message, cause);
}

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Experimental;
/**
@ -27,6 +29,10 @@ import org.apache.maven.api.annotations.Experimental;
*/
@Experimental
public class VersionParserException extends MavenException {
@Serial
private static final long serialVersionUID = 1504740189114877333L;
/**
* @param message the message to give
* @param e the {@link Exception}

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Consumer;
import org.apache.maven.api.annotations.Experimental;
@ -27,6 +29,10 @@ import org.apache.maven.api.annotations.Experimental;
@Experimental
@Consumer
public class VersionRangeResolverException extends MavenException {
@Serial
private static final long serialVersionUID = 4455478418692494141L;
public VersionRangeResolverException(String message, Throwable cause) {
super(message, cause);
}

View File

@ -18,6 +18,8 @@
*/
package org.apache.maven.api.services;
import java.io.Serial;
import org.apache.maven.api.annotations.Consumer;
import org.apache.maven.api.annotations.Experimental;
@ -27,6 +29,10 @@ import org.apache.maven.api.annotations.Experimental;
@Experimental
@Consumer
public class VersionResolverException extends MavenException {
@Serial
private static final long serialVersionUID = -2105433586719466573L;
public VersionResolverException(String message, Throwable cause) {
super(message, cause);
}