|
25 | 25 | import java.net.URL;
|
26 | 26 | import java.net.URLClassLoader;
|
27 | 27 | import java.util.ArrayList;
|
28 |
| -import java.util.Arrays; |
29 |
| -import java.util.HashSet; |
30 | 28 | import java.util.Properties;
|
31 | 29 |
|
32 | 30 | import org.apache.maven.artifact.DependencyResolutionRequiredException;
|
33 | 31 | import org.apache.maven.plugin.AbstractMojo;
|
| 32 | +import org.apache.maven.plugin.MojoFailureException; |
34 | 33 | import org.apache.maven.plugins.annotations.Parameter;
|
35 | 34 | import org.apache.maven.project.MavenProject;
|
36 |
| -import org.apache.tools.ant.BuildException; |
37 | 35 | import org.hibernate.tool.api.metadata.MetadataDescriptor;
|
38 | 36 | import org.hibernate.tool.api.metadata.MetadataDescriptorFactory;
|
39 | 37 | import org.hibernate.tool.api.metadata.MetadataConstants;
|
@@ -92,7 +90,7 @@ public abstract class AbstractGenerationMojo extends AbstractMojo {
|
92 | 90 | @Parameter(defaultValue = "${project}", readonly = true, required = true)
|
93 | 91 | private MavenProject project;
|
94 | 92 |
|
95 |
| - public void execute() { |
| 93 | + public void execute() throws MojoFailureException { |
96 | 94 | ClassLoader original = Thread.currentThread().getContextClassLoader();
|
97 | 95 | try {
|
98 | 96 | Thread.currentThread().setContextClassLoader(createExporterClassLoader(original));
|
@@ -130,15 +128,15 @@ private RevengStrategy setupReverseEngineeringStrategy() {
|
130 | 128 | return strategy;
|
131 | 129 | }
|
132 | 130 |
|
133 |
| - private Properties loadPropertiesFile() { |
| 131 | + private Properties loadPropertiesFile() throws MojoFailureException { |
134 | 132 | try (FileInputStream is = new FileInputStream(propertyFile)) {
|
135 | 133 | Properties result = new Properties();
|
136 | 134 | result.load(is);
|
137 | 135 | return result;
|
138 | 136 | } catch (FileNotFoundException e) {
|
139 |
| - throw new BuildException(propertyFile + " not found.", e); |
| 137 | + throw new MojoFailureException(propertyFile + " not found.", e); |
140 | 138 | } catch (IOException e) {
|
141 |
| - throw new BuildException("Problem while loading " + propertyFile, e); |
| 139 | + throw new MojoFailureException("Problem while loading " + propertyFile, e); |
142 | 140 | }
|
143 | 141 | }
|
144 | 142 |
|
|
0 commit comments