use of org.wildfly.swarm.undertow.WARArchive in project wildfly-swarm by wildfly-swarm.
the class JAXRSArchiveTest method testDetectJAXRSness_isNot.
@Test
public void testDetectJAXRSness_isNot() {
WARArchive archive = ShrinkWrap.create(WARArchive.class);
archive.addClass(MyRandomClass.class);
assertThat(JAXRSArchive.isJAXRS(archive)).isFalse();
}
use of org.wildfly.swarm.undertow.WARArchive in project wildfly-swarm by wildfly-swarm.
the class InstallMonitorFilter method process.
@Override
public void process() throws Exception {
WARArchive warArchive = archive.as(WARArchive.class);
warArchive.addDependency("org.wildfly.swarm:health-api:jar:" + SwarmInfo.VERSION);
warArchive.findWebXmlAsset().setContextParam("resteasy.scan", "true");
}
use of org.wildfly.swarm.undertow.WARArchive in project wildfly-swarm by wildfly-swarm.
the class SwaggerWebAppDeploymentProducer method swaggerWebApp.
@Produces
public Archive swaggerWebApp() throws ModuleLoadException, IOException {
// Load the swagger-ui webjars.
Module module = Module.getBootModuleLoader().loadModule("org.webjars.swagger-ui");
URL resource = module.getExportedResource("swagger-ui.jar");
JARArchive webJar = ShrinkWrap.create(JARArchive.class);
webJar.as(ZipImporter.class).importFrom(resource.openStream());
JARArchive relocatedJar = ShrinkWrap.create(JARArchive.class);
Map<ArchivePath, Node> content = webJar.getContent();
for (ArchivePath path : content.keySet()) {
Node node = content.get(path);
Asset asset = node.getAsset();
if (asset != null) {
Matcher matcher = PATTERN.matcher(path.get());
if (matcher.matches()) {
MatchResult result = matcher.toMatchResult();
String newPath = "/META-INF/resources/" + result.group(2);
relocatedJar.add(asset, newPath);
}
}
}
WARArchive war = ShrinkWrap.create(WARArchive.class, "swagger-ui.war").addAsLibrary(relocatedJar).setContextRoot(this.fraction.getContext());
war.addClass(SwaggerDefaultUrlChangerServlet.class);
// If any user content has been provided, merge that with the swagger-ui bits
Archive<?> userContent = this.fraction.getWebContent();
if (userContent != null) {
war.merge(userContent);
}
return war;
}
use of org.wildfly.swarm.undertow.WARArchive in project wildfly-swarm by wildfly-swarm.
the class JAXPOverrideTest method createDeployment.
@Deployment
public static Archive createDeployment() throws Exception {
WARArchive deployment = ShrinkWrap.create(WARArchive.class, "services.war");
deployment.addAsLibraries(Maven.resolver().resolve("saxon:saxon:8.7").withTransitivity().asFile());
deployment.addClass(ServicesServlet.class);
deployment.addClass(TransformerServlet.class);
return deployment;
}
use of org.wildfly.swarm.undertow.WARArchive in project wildfly-swarm by wildfly-swarm.
the class StaticContentWarSubdirTest method createDeployment.
@Deployment
public static Archive createDeployment() throws Exception {
WARArchive deployment = ShrinkWrap.create(WARArchive.class);
deployment.staticContent("foo");
// Make sure we're testing from contents inside the jar only
deployment.delete("WEB-INF/undertow-external-mounts.conf");
return deployment;
}
Aggregations