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