Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gastaldi/shrinkwrap-extensions
A ShrinkWrap archive implementation for Maven projects
https://github.com/gastaldi/shrinkwrap-extensions
Last synced: 5 days ago
JSON representation
A ShrinkWrap archive implementation for Maven projects
- Host: GitHub
- URL: https://github.com/gastaldi/shrinkwrap-extensions
- Owner: gastaldi
- Created: 2016-10-31T18:40:48.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-08T20:47:01.000Z (about 8 years ago)
- Last Synced: 2024-11-08T09:47:36.386Z (about 2 months ago)
- Language: Java
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.asciidoc
Awesome Lists containing this project
README
ShrinkWrap Maven Project
========================This shrinkwrap implementation allows you to model a Maven project including its sources as a ShrinkWrap archive. It uses https://github.com/forge/roaster[Roaster] and the Apache Maven Model API.
== Usage Example
[source,java]
----
// This would create an Archive representation of the project
MavenProjectArchive archive = ShrinkWrap.create(MavenProjectArchive.class);// Set the pom.xml using a org.apache.maven.model.Model instance
Model model = new Model();
model.setGroupId("org.example");
model.setArtifactId("foo");
model.setVersion("1.0.0-SNAPSHOT");
archive.setPom(mavenModel);// Add a class to src/main/java
archive.add(Roaster.create(JavaClassSource.class).setName("Foo").setPackage("com.example.demo"));// Add a class to src/test/java
MavenTestProjectArchive testArchive = archive.as(MavenTestProjectArchive.class);
testArchive.add(Roaster.create(JavaClassSource.class).setName("FooTest").setPackage("com.example.demo"));// We can export this to a ZIP file
archive.as(ZipExporter.class).exportTo(new File("project.zip"), true);// Or we can explode in a specified location
archive.as(ExplodedExporter.class).exportExplodedInto(new File("/tmp/demo"));
----