Beispiel #1
0
 private String findMainClass(SourceSet main) {
   if (main == null) {
     return null;
   }
   getLogger().info("Looking for main in: " + main.getOutput().getClassesDir());
   try {
     return MainClassFinder.findMainClass(main.getOutput().getClassesDir());
   } catch (IOException ex) {
     throw new IllegalStateException("Cannot find main class", ex);
   }
 }
 private String getStartClass() throws MojoExecutionException {
   String mainClass = this.mainClass;
   if (mainClass == null) {
     try {
       mainClass = MainClassFinder.findSingleMainClass(this.classesDirectory);
     } catch (IOException ex) {
       throw new MojoExecutionException(ex.getMessage(), ex);
     }
   }
   if (mainClass == null) {
     throw new MojoExecutionException(
         "Unable to find a suitable main class, " + "please add a 'mainClass' property");
   }
   return mainClass;
 }