@@ -87,7 +87,7 @@ public class RunMojo extends AbstractMojo {
87
87
* the archive.
88
88
*/
89
89
@ Parameter (defaultValue = "${project.build.outputDirectory}" , required = true )
90
- private File classesDirectrory ;
90
+ private File classesDirectory ;
91
91
92
92
@ Override
93
93
public void execute () throws MojoExecutionException , MojoFailureException {
@@ -105,7 +105,7 @@ private final String getStartClass() throws MojoExecutionException {
105
105
String mainClass = this .mainClass ;
106
106
if (mainClass == null ) {
107
107
try {
108
- mainClass = MainClassFinder .findMainClass (this .classesDirectrory );
108
+ mainClass = MainClassFinder .findMainClass (this .classesDirectory );
109
109
}
110
110
catch (IOException ex ) {
111
111
throw new MojoExecutionException (ex .getMessage (), ex );
@@ -150,11 +150,17 @@ private void addResources(List<URL> urls) throws MalformedURLException {
150
150
for (Resource resource : this .project .getResources ()) {
151
151
urls .add (new File (resource .getDirectory ()).toURI ().toURL ());
152
152
}
153
+ // Special case: this file causes logback to worry that it has been configured
154
+ // twice, so remove it from the target directory...
155
+ File logback = new File (this .classesDirectory , "logback.xml" );
156
+ if (logback .exists () && logback .canWrite ()) {
157
+ logback .delete ();
158
+ }
153
159
}
154
160
}
155
161
156
162
private void addProjectClasses (List <URL > urls ) throws MalformedURLException {
157
- urls .add (this .classesDirectrory .toURI ().toURL ());
163
+ urls .add (this .classesDirectory .toURI ().toURL ());
158
164
}
159
165
160
166
private void addDependencies (List <URL > urls ) throws MalformedURLException {
0 commit comments