-
-
Save bbrowning/69568d527d363f9c1549 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public BuildTool projectArtifact(String groupId, String artifactId, String version, String packaging, File file) { | |
System.err.println("!!! PROJECT ARTIFACT " + artifactId); | |
Archive ogArchive = ShrinkWrap.create(JavaArchive.class); | |
try { | |
ogArchive.as(ZipImporter.class).importFrom(new JarFile(file)); | |
Path webResources = Paths.get(System.getProperty("user.dir"), "src", "main", "webapp"); | |
System.err.println("!!! LOOKING FOR " + webResources); | |
if (Files.exists(webResources)) { | |
System.err.println("!!! ADDING WEB RESOURCES BUDDY"); | |
ogArchive.as(ExplodedImporter.class).importDirectory(webResources.toFile()); | |
} | |
} catch (Exception e) { | |
System.err.println("!!! oops"); | |
e.printStackTrace(); | |
} | |
this.projectAsset = new ArchiveAsset(ogArchive); | |
// this.projectAsset = new ArtifactAsset(new ArtifactSpec(null, groupId, artifactId, version, packaging, null, file)); | |
return this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment