changeset 1108:de7184e1370d

Added antlr4 dependencies to pom.xml and war archive in tests.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 27 Oct 2016 11:48:53 +0200
parents d9d57a107478
children 5bc1260b55f1
files pom.xml src/test/java/de/intevation/lada/BaseTest.java
diffstat 2 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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>
--- 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;
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)