[Lada-commits] [PATCH 1 of 2] Added antlr4 dependencies to pom.xml and war archive in tests
Wald Commits
scm-commit at wald.intevation.org
Thu Oct 27 11:50:11 CEST 2016
# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1477561733 -7200
# Node ID de7184e1370dd5c9d934de67b2bb03a00001b47b
# Parent d9d57a1074781110895c0f79a166390cb7ea8011
Added antlr4 dependencies to pom.xml and war archive in tests.
diff -r d9d57a107478 -r de7184e1370d pom.xml
--- a/pom.xml Wed Oct 26 16:52:45 2016 +0200
+++ b/pom.xml Thu Oct 27 11:48:53 2016 +0200
@@ -176,6 +176,11 @@
<version>1.0.0.Alpha7</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
@@ -245,6 +250,21 @@
</compilerArguments>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr4-maven-plugin</artifactId>
+ <version>4.5</version>
+ <configuration>
+ <outputDirectory>${basedir}/src/main/java</outputDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>antlr4</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<dependencies>
diff -r d9d57a107478 -r de7184e1370d src/test/java/de/intevation/lada/BaseTest.java
--- a/src/test/java/de/intevation/lada/BaseTest.java Wed Oct 26 16:52:45 2016 +0200
+++ b/src/test/java/de/intevation/lada/BaseTest.java Thu Oct 27 11:48:53 2016 +0200
@@ -7,13 +7,16 @@
*/
package de.intevation.lada;
+import java.io.File;
import java.util.List;
import org.apache.log4j.Logger;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.junit.After;
import org.junit.AfterClass;
@@ -41,11 +44,21 @@
*/
@Deployment(testable=true)
public static WebArchive createDeployment() throws Exception {
+ File[] files = Maven.resolver().loadPomFromFile("pom.xml")
+ .importRuntimeAndTestDependencies().resolve().withTransitivity().asFile();
+ File antlr = null;
+ for (File f : files) {
+ logger.debug(f.getName());
+ if (f.getName().contains("antlr4")) {
+ antlr = f;
+ }
+ }
WebArchive archive = ShrinkWrap.create(WebArchive.class, ARCHIVE_NAME)
.addPackages(true, Package.getPackage("de.intevation.lada"))
.addAsResource("log4j.properties", "log4j.properties")
.addAsResource("shibboleth.properties", "shibboleth.properties")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
+ .addAsLibrary(antlr)
.addAsResource("META-INF/test-persistence.xml",
"META-INF/persistence.xml");
return archive;
More information about the Lada-commits
mailing list