Created
June 25, 2013 08:45
-
-
Save tremes/5856961 to your computer and use it in GitHub Desktop.
Deployments.java
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
package org.jboss.seam.example.booking.test; | |
import java.io.File; | |
import org.jboss.seam.example.booking.Booking; | |
import org.jboss.shrinkwrap.api.ShrinkWrap; | |
import org.jboss.shrinkwrap.api.spec.WebArchive; | |
import org.jboss.shrinkwrap.resolver.api.maven.Maven; | |
public class Deployments { | |
public static WebArchive bookingDeployment() { | |
File[] libs = Maven.resolver().loadPomFromFile("pom.xml") | |
.importCompileAndRuntimeDependencies() | |
// force resolve jboss-seam, because it is provided-scoped in the pom, but we need it bundled in the WAR | |
.resolve("org.jboss.seam:jboss-seam") | |
.withTransitivity().asFile(); | |
return ShrinkWrap.create(WebArchive.class, "seam-booking.war") | |
.addPackage(Booking.class.getPackage()) | |
.addAsWebInfResource("META-INF/ejb-jar.xml", "ejb-jar.xml") | |
.addAsResource("import.sql") | |
.addAsResource("persistence.xml", "META-INF/persistence.xml") | |
.addAsWebInfResource("components.xml") | |
.addAsWebInfResource("jboss-deployment-structure.xml") | |
.addAsResource("seam.properties") | |
.addAsWebInfResource("web.xml") | |
.addAsLibraries(libs); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment