Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.tools.ant.BuildException;
import org.hibernate.cfg.reveng.OverrideRepository;
import org.hibernate.cfg.reveng.ReverseEngineeringSettings;
import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
Expand Down Expand Up @@ -72,7 +72,7 @@ public abstract class AbstractHbm2xMojo extends AbstractMojo {
@Parameter(defaultValue = "${project}", readonly = true, required = true)
private MavenProject project;

public void execute() {
public void execute() throws MojoFailureException {
ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(createExporterClassLoader(original));
Expand All @@ -89,12 +89,12 @@ public void execute() {
}
}

private ReverseEngineeringStrategy setupReverseEngineeringStrategy() {
private ReverseEngineeringStrategy setupReverseEngineeringStrategy() throws MojoFailureException {
ReverseEngineeringStrategy strategy;
try {
strategy = ReverseEngineeringStrategy.class.cast(Class.forName(revengStrategy).newInstance());
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException | ClassCastException e) {
throw new BuildException(revengStrategy + " not instanced.", e);
throw new MojoFailureException(revengStrategy + " not instanced.", e);
}

if (revengFile != null) {
Expand All @@ -116,15 +116,15 @@ private ReverseEngineeringStrategy setupReverseEngineeringStrategy() {
return strategy;
}

private Properties loadPropertiesFile() {
private Properties loadPropertiesFile() throws MojoFailureException {
try (FileInputStream is = new FileInputStream(propertyFile)) {
Properties result = new Properties();
result.load(is);
return result;
} catch (FileNotFoundException e) {
throw new BuildException(propertyFile + " not found.", e);
throw new MojoFailureException(propertyFile + " not found.", e);
} catch (IOException e) {
throw new BuildException("Problem while loading " + propertyFile, e);
throw new MojoFailureException("Problem while loading " + propertyFile, e);
}
}

Expand Down