Artifact (Artifact rootArtifact, Project project) { for (PackagingElement<?> element : rootArtifact.getRootElement().getChildren()) { if (element instanceof ArtifactPackagingElement) { final Artifact artifact = ((ArtifactPackagingElement)element) .findArtifact(ArtifactManager.getInstance(project).getResolvingContext()); if (artifact != null && artifact.getArtifactType() instanceof JavaFxPreloaderArtifactType) { return artifact; } } } return null; }