@Test(expected = MojoExecutionException.class) public void testEmpty() throws Exception { Initialization initialization = new Initialization(); initialization.entryPoint = ""; initialization.getEntryPoint(classLoaderResolver, BAR, QUX, BAZ, JAR); }
@SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Applies Maven exception wrapper") public EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, String groupId, String artifactId, String version, String packaging) throws MojoExecutionException { if (entryPoint == null || entryPoint.length() == 0) { throw new MojoExecutionException("Entry point name is not defined"); } for (EntryPoint.Default entryPoint : EntryPoint.Default.values()) { if (this.entryPoint.equals(entryPoint.name())) { return entryPoint; } } try { return (EntryPoint) Class.forName(entryPoint, false, classLoaderResolver.resolve(asCoordinate(groupId, artifactId, version, packaging))) .getDeclaredConstructor() .newInstance(); } catch (Exception exception) { throw new MojoExecutionException("Cannot create entry point: " + entryPoint, exception); } }
Initialization extends CoordinateConfiguration { @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Applies Maven exception wrapper") public EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, String groupId, String artifactId, String version, String packaging) throws MojoExecutionException { if (entryPoint == null || entryPoint.length() == 0) { throw new MojoExecutionException("Entry point name is not defined"); } for (EntryPoint.Default entryPoint : EntryPoint.Default.values()) { if (this.entryPoint.equals(entryPoint.name())) { return entryPoint; } } try { return (EntryPoint) Class.forName(entryPoint, false, classLoaderResolver.resolve(asCoordinate(groupId, artifactId, version, packaging))) .getDeclaredConstructor() .newInstance(); } catch (Exception exception) { throw new MojoExecutionException("Cannot create entry point: " + entryPoint, exception); } } }
Initialization extends CoordinateConfiguration { @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Applies Maven exception wrapper") public EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, String groupId, String artifactId, String version, String packaging) throws MojoExecutionException { if (entryPoint == null || entryPoint.length() == 0) { throw new MojoExecutionException("Entry point name is not defined"); } for (EntryPoint.Default entryPoint : EntryPoint.Default.values()) { if (this.entryPoint.equals(entryPoint.name())) { return entryPoint; } } try { return (EntryPoint) Class.forName(entryPoint, false, classLoaderResolver.resolve(asCoordinate(groupId, artifactId, version, packaging))) .getDeclaredConstructor() .newInstance(); } catch (Exception exception) { throw new MojoExecutionException("Cannot create entry point: " + entryPoint, exception); } }  }
Initialization extends CoordinateConfiguration { @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Applies Maven exception wrapper") public EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, String groupId, String artifactId, String version, String packaging) throws MojoExecutionException { if (entryPoint == null || entryPoint.length() == 0) { throw new MojoExecutionException("Entry point name is not defined"); } for (EntryPoint.Default entryPoint : EntryPoint.Default.values()) { if (this.entryPoint.equals(entryPoint.name())) { return entryPoint; } } try { return (EntryPoint) Class.forName(entryPoint, false, classLoaderResolver.resolve(asCoordinate(groupId, artifactId, version, packaging))) .getDeclaredConstructor() .newInstance(); } catch (Exception exception) { throw new MojoExecutionException("Cannot create entry point: " + entryPoint, exception); } }  static Initialization makeDefault(); @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Applies Maven exception wrapper") EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, String groupId, String artifactId, String version, String packaging); }
Initialization extends CoordinateConfiguration { @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Applies Maven exception wrapper") public EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, String groupId, String artifactId, String version, String packaging) throws MojoExecutionException { if (entryPoint == null || entryPoint.length() == 0) { throw new MojoExecutionException("Entry point name is not defined"); } for (EntryPoint.Default entryPoint : EntryPoint.Default.values()) { if (this.entryPoint.equals(entryPoint.name())) { return entryPoint; } } try { return (EntryPoint) Class.forName(entryPoint, false, classLoaderResolver.resolve(asCoordinate(groupId, artifactId, version, packaging))) .getDeclaredConstructor() .newInstance(); } catch (Exception exception) { throw new MojoExecutionException("Cannot create entry point: " + entryPoint, exception); } }  static Initialization makeDefault(); @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Applies Maven exception wrapper") EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, String groupId, String artifactId, String version, String packaging); public String entryPoint; }