MARMOTTA-395: fixed and updated Marmotta-Webapp Archetype: - updated dependencies - added profiles for different backend/caching modules - updated web.xml - addd integration test for the archetype
Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/06fd91aa Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/06fd91aa Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/06fd91aa Branch: refs/heads/ldp Commit: 06fd91aaeef1a2b838014f20d752859fe5adb19b Parents: d6cebf9 Author: Jakob Frank <[email protected]> Authored: Wed Mar 19 16:12:31 2014 +0100 Committer: Jakob Frank <[email protected]> Committed: Wed Mar 19 16:47:32 2014 +0100 ---------------------------------------------------------------------- .../marmotta-archetype-webapp/pom.xml | 21 +- .../META-INF/maven/archetype-metadata.xml | 13 +- .../main/resources/archetype-resources/pom.xml | 403 ++++++++++++++++--- .../src/main/resources/logback.xml | 16 +- .../src/main/webapp/META-INF/context.xml | 7 + .../src/main/webapp/WEB-INF/web.xml | 70 ++++ .../src/main/webapp/index.jsp | 2 +- .../src/test/resources/logback.xml | 12 +- .../src/test/resources/verification.xml | 31 ++ .../projects/basic/archetype.properties | 2 +- .../src/test/resources/projects/basic/goal.txt | 1 + 11 files changed, 499 insertions(+), 79 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/marmotta/blob/06fd91aa/build/archetypes/marmotta-archetype-webapp/pom.xml ---------------------------------------------------------------------- diff --git a/build/archetypes/marmotta-archetype-webapp/pom.xml b/build/archetypes/marmotta-archetype-webapp/pom.xml index 553cafd..c4065ee 100644 --- a/build/archetypes/marmotta-archetype-webapp/pom.xml +++ b/build/archetypes/marmotta-archetype-webapp/pom.xml @@ -33,13 +33,24 @@ <properties> <marmottaVersion>${project.version}</marmottaVersion> + <sesameVersion>${sesame.version}</sesameVersion> + + <junitVersion>${junit.version}</junitVersion> <servletApiVersion>${servlet.api.version}</servletApiVersion> - <javaxElVersion>${javax.el.version}</javaxElVersion> - <weldVersion>${weld.version}</weldVersion> + <javax-elVersion>${javax.el.version}</javax-elVersion> + <weldVersion>${weld.version}</weldVersion> <weldCoreVersion>${weld.core.version}</weldCoreVersion> + <restAssuredVersion>${rest.assured.version}</restAssuredVersion> + <hamcrestVersion>${hamcrest.version}</hamcrestVersion> + <tempusFugitVersion>${tempus.fugit.version}</tempusFugitVersion> + <jatlVersion>${jatl.version}</jatlVersion> <h2Version>${h2.version}</h2Version> <postgresqlVersion>${postgresql.version}</postgresqlVersion> <mysqlVersion>${mysql.version}</mysqlVersion> + <jettyVersion>${jetty.version}</jettyVersion> + <resteasyVersion>${resteasy.version}</resteasyVersion> + <jacksonVersion>${jackson.version}</jacksonVersion> + <titanVersion>${titan.version}</titanVersion> </properties> <build> @@ -80,6 +91,12 @@ <plugins> <plugin> + <artifactId>maven-resources-plugin</artifactId> + <configuration> + <escapeString>\</escapeString> + </configuration> + </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <configuration> http://git-wip-us.apache.org/repos/asf/marmotta/blob/06fd91aa/build/archetypes/marmotta-archetype-webapp/src/main/resources/META-INF/maven/archetype-metadata.xml ---------------------------------------------------------------------- diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/META-INF/maven/archetype-metadata.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/META-INF/maven/archetype-metadata.xml index 30c1678..caeb409 100644 --- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -21,7 +21,11 @@ <archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - name="marmotta-webapp"> + name="Apache Marmotta Webapp"> + + <requiredProperties> + <requiredProperty key="appName" /> + </requiredProperties> <fileSets> <fileSet filtered="true" encoding="UTF-8"> @@ -43,7 +47,6 @@ <fileSet encoding="UTF-8"> <directory>src/main/webapp</directory> <includes> - <include>**/*.xsl</include> <include>**/*.png</include> <include>**/*.js</include> <include>**/*.ftl</include> @@ -58,12 +61,6 @@ <include>**/*.properties</include> </includes> </fileSet> - <fileSet filtered="true" encoding="UTF-8"> - <directory>src/test</directory> - <includes> - <include>**/*.groovy</include> - </includes> - </fileSet> </fileSets> </archetype-descriptor> http://git-wip-us.apache.org/repos/asf/marmotta/blob/06fd91aa/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml ---------------------------------------------------------------------- diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml index 941ed2d..1ad47bd 100644 --- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml +++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml @@ -18,18 +18,41 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - <groupId>${groupId}</groupId> - <artifactId>${artifactId}</artifactId> + <groupId>\${groupId}</groupId> + <artifactId>\${artifactId}</artifactId> <packaging>war</packaging> - <name>Marmotta Web Application</name> - <description>Marmotta Web Bundle (WAR)</description> - <version>${version}</version> + <name>${appName}</name> + <description>The ${appName} WAR bundle</description> + <version>\${version}</version> + <properties> - <marmotta.home>${java.io.tmpdir}${file.separator}marmotta</marmotta.home> + <marmotta.home>\${java.io.tmpdir}\${file.separator}${appName}</marmotta.home> <marmotta.context>/</marmotta.context> <marmotta.port>8080</marmotta.port> + <marmotta.backend>kiwi</marmotta.backend> + + <project.build.sourceEncoding>utf-8</project.build.sourceEncoding> + + <marmotta.version>${marmottaVersion}</marmotta.version> + <sesame.version>${sesameVersion}</sesame.version> + <junit.version>${junitVersion}</junit.version> + <weld.version>${weldVersion}</weld.version> + <weld.core.version>${weldCoreVersion}</weld.core.version> + <rest.assured.version>${restAssuredVersion}</rest.assured.version> + <hamcrest.version>${hamcrestVersion}</hamcrest.version> + <tempus.fugit.version>${tempusFugitVersion}</tempus.fugit.version> + <jatl.version>${jatlVersion}</jatl.version> + <servlet.api.version>${servletApiVersion}</servlet.api.version> + <javax.el.version>${javax-elVersion}</javax.el.version> + <h2.version>${h2Version}</h2.version> + <postgresql.version>${postgresqlVersion}</postgresql.version> + <mysql.version>${mysqlVersion}</mysql.version> + <jetty.version>${jettyVersion}</jetty.version> + <resteasy.version>${resteasyVersion}</resteasy.version> + <jackson.version>${jacksonVersion}</jackson.version> + <titan.version>${titanVersion}</titan.version> </properties> <build> @@ -67,14 +90,6 @@ <archiveClasses>false</archiveClasses> </configuration> </plugin> - <plugin> <!-- generate JRebel Configuration --> - <groupId>org.zeroturnaround</groupId> - <artifactId>jrebel-maven-plugin</artifactId> - <configuration> - <relativePath>../</relativePath> - <rootPath>${rebel.root}</rootPath> - </configuration> - </plugin> <plugin> <artifactId>maven-deploy-plugin</artifactId> <version>2.7</version> @@ -85,12 +100,13 @@ <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> - <version>2.0</version> + <version>2.2</version> <configuration> - <path>${marmotta.context}</path> - <port>${marmotta.port}</port> + <contextFile>src/main/webapp/META-INF/context.xml</contextFile> + <path>\${marmotta.context}</path> + <port>\${marmotta.port}</port> <systemProperties> - <marmotta.home>${marmotta.home}</marmotta.home> + <marmotta.home>\${marmotta.home}</marmotta.home> </systemProperties> <!-- <contextReloadable>true</contextReloadable> --> <!-- <backgroundProcessorDelay>10</backgroundProcessorDelay> --> @@ -116,6 +132,70 @@ <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> + <executions> + <execution> + <id>tomcat-run</id> + <phase>pre-integration-test</phase> + <goals><goal>run-war-only</goal></goals> + <configuration> + <fork>true</fork> + </configuration> + </execution> + <execution> + <id>shutdown</id> + <phase>post-integration-test</phase> + <goals><goal>shutdown</goal></goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>com.googlecode.maven-download-plugin</groupId> + <artifactId>maven-download-plugin</artifactId> + <version>1.1.0</version> + <executions> + <execution> + <id>fetch-indexjsp</id> + <phase>integration-test</phase> + <goals> + <goal>wget</goal> + </goals> + <configuration> + <url>http://localhost:\${marmotta.port}\${marmotta.context}index.jsp</url> + <outputFileName>index.html</outputFileName> + <outputDirectory>\${project.build.directory}/it/</outputDirectory> + <skipCache>true</skipCache> + </configuration> + </execution> + <execution> + <id>fetch-config</id> + <phase>integration-test</phase> + <goals> + <goal>wget</goal> + </goals> + <configuration> + <url>http://localhost:\${marmotta.port}\${marmotta.context}config/list</url> + <outputFileName>config.json</outputFileName> + <outputDirectory>\${project.build.directory}/it/</outputDirectory> + <skipCache>true</skipCache> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-verifier-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <id>check-files</id> + <phase>integration-test</phase> + <goals><goal>verify</goal></goals> + <configuration> + <basedir>\${project.build.directory}/it/</basedir> + <verificationFile>\${basedir}/src/test/resources/verification.xml</verificationFile> + <failOnError>true</failOnError> + </configuration> + </execution> + </executions> </plugin> <plugin> <artifactId>maven-dependency-plugin</artifactId> @@ -124,6 +204,210 @@ </build> <profiles> + + <!-- backend profiles --> + + <profile> + <id>kiwi</id> + <activation> + <activeByDefault>true</activeByDefault> + <property> + <name>marmotta.backend</name> + <value>kiwi</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>marmotta-backend-kiwi</artifactId> + <version>\${marmotta.version}</version> + </dependency> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>marmotta-ldcache-kiwi</artifactId> + <version>\${marmotta.version}</version> + </dependency> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>marmotta-reasoner-kiwi</artifactId> + <version>\${marmotta.version}</version> + </dependency> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>marmotta-versioning-kiwi</artifactId> + <version>\${marmotta.version}</version> + </dependency> + </dependencies> + </profile> + + <profile> + <id>titan-berkeleydb</id> + <activation> + <property> + <name>marmotta.backend</name> + <value>titan-berkeleydb</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>marmotta-backend-titan</artifactId> + <version>\${marmotta.version}</version> + </dependency> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>marmotta-ldcache-file</artifactId> + <version>\${marmotta.version}</version> + </dependency> + <dependency> + <groupId>com.thinkaurelius.titan</groupId> + <artifactId>titan-berkeleyje</artifactId> + <version>\${titan.version}</version> + </dependency> + </dependencies> + </profile> + + <profile> + <id>titan-hbase</id> + <activation> + <property> + <name>marmotta.backend</name> + <value>titan-hbase</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>marmotta-backend-titan</artifactId> + <version>\${marmotta.version}</version> + </dependency> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>marmotta-ldcache-file</artifactId> + <version>\${marmotta.version}</version> + </dependency> + <dependency> + <groupId>com.thinkaurelius.titan</groupId> + <artifactId>titan-hbase</artifactId> + <version>\${titan.version}</version> + + <exclusions> + <exclusion> + <groupId>org.mortbay.jetty</groupId> + <artifactId>servlet-api</artifactId> + </exclusion> + <exclusion> + <groupId>org.mortbay.jetty</groupId> + <artifactId>servlet-api-2.5</artifactId> + </exclusion> + <exclusion> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jsp-2.1</artifactId> + </exclusion> + <exclusion> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jsp-api-2.1</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </profile> + + <profile> + <id>bigdata</id> + <activation> + <property> + <name>marmotta.backend</name> + <value>bigdata</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>marmotta-backend-bigdata</artifactId> + <version>\${marmotta.version}</version> + </dependency> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>marmotta-ldcache-file</artifactId> + <version>\${marmotta.version}</version> + </dependency> + </dependencies> + </profile> + + + <!-- Caching Backends for KiWi --> + + <profile> + <id>infinispan</id> + <activation> + <property> + <name>marmotta.caching</name> + <value>infinispan</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>kiwi-caching-infinispan</artifactId> + <version>\${marmotta.version}</version> + </dependency> + </dependencies> + </profile> + + <profile> + <id>hazelcast</id> + <activation> + <property> + <name>marmotta.caching</name> + <value>hazelcast</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>kiwi-caching-hazelcast</artifactId> + <version>\${marmotta.version}</version> + </dependency> + </dependencies> + </profile> + + <profile> + <id>ehcache</id> + <activation> + <property> + <name>marmotta.caching</name> + <value>ehcache</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>kiwi-caching-ehcache</artifactId> + <version>\${marmotta.version}</version> + </dependency> + </dependencies> + </profile> + + <profile> + <id>zookeeper</id> + <dependencies> + <dependency> + <groupId>org.apache.marmotta</groupId> + <artifactId>marmotta-zookeeper</artifactId> + <version>\${marmotta.version}</version> + </dependency> + </dependencies> + </profile> + <profile> <id>cleanall</id> <build> @@ -134,7 +418,7 @@ <configuration> <filesets> <fileset> - <directory>${marmotta.home}</directory> + <directory>\${marmotta.home}</directory> <followSymlinks>true</followSymlinks> </fileset> </filesets> @@ -150,85 +434,114 @@ <dependency> <groupId>org.apache.marmotta</groupId> <artifactId>marmotta-core</artifactId> - <version>${marmottaVersion}</version> + <version>\${marmotta.version}</version> </dependency> <dependency> <groupId>org.apache.marmotta</groupId> - <artifactId>marmotta-ldpath</artifactId> - <version>${marmottaVersion}</version> + <artifactId>marmotta-sparql</artifactId> + <version>\${marmotta.version}</version> </dependency> <dependency> <groupId>org.apache.marmotta</groupId> - <artifactId>marmotta-ldcache</artifactId> - <version>${marmottaVersion}</version> + <artifactId>marmotta-ldpath</artifactId> + <version>\${marmotta.version}</version> </dependency> <dependency> <groupId>org.apache.marmotta</groupId> - <artifactId>marmotta-reasoner</artifactId> - <version>${marmottaVersion}</version> + <artifactId>marmotta-ldcache-common</artifactId> + <version>\${marmotta.version}</version> </dependency> <dependency> <groupId>org.apache.marmotta</groupId> - <artifactId>marmotta-sparql</artifactId> - <version>${marmottaVersion}</version> + <artifactId>marmotta-versioning-common</artifactId> + <version>\${marmotta.version}</version> </dependency> <dependency> <groupId>org.apache.marmotta</groupId> - <artifactId>marmotta-security</artifactId> - <version>${marmottaVersion}</version> - </dependency> - <dependency> - <groupId>org.apache.marmotta</groupId> - <artifactId>marmotta-versioning</artifactId> - <version>${marmottaVersion}</version> + <artifactId>marmotta-user</artifactId> + <version>\${marmotta.version}</version> </dependency> <dependency> <groupId>org.apache.marmotta</groupId> - <artifactId>marmotta-user</artifactId> - <version>${marmottaVersion}</version> + <artifactId>marmotta-security</artifactId> + <version>\${marmotta.version}</version> </dependency> - <!-- Servlet / CDI Environment --> + <!-- JavaEE / Servlet / CDI Environment --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> - <version>3.0.1</version> + <version>\${servlet.api.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.el</groupId> <artifactId>javax.el-api</artifactId> - <version>${javaxElVersion}</version> + <version>\${javax.el.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.weld.servlet</groupId> <artifactId>weld-servlet-core</artifactId> - <version>${weldCoreVersion}</version> + <version>\${weld.core.version}</version> + <scope>runtime</scope> + <exclusions> + <exclusion> + <groupId>javax.el</groupId> + <artifactId>el-api</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.spec.javax.el</groupId> + <artifactId>jboss-el-api_3.0_spec</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.jboss.weld</groupId> <artifactId>weld-core</artifactId> - <version>${weldCoreVersion}</version> + <version>\${weld.core.version}</version> + <scope>runtime</scope> + <exclusions> + <exclusion> + <groupId>org.javassist</groupId> + <artifactId>javassist</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.spec.javax.el</groupId> + <artifactId>jboss-el-api_3.0_spec</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> - <version>${h2Version}</version> + <version>\${h2.version}</version> </dependency> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> - <version>${postgresqlVersion}</version> + <version>\${postgresql.version}</version> </dependency> <!-- enable for MySQL support; note that the MySQL driver is GPL licensed --> <!-- <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> - <version>${mysqlVersion}</version> + <version>\${mysql.version}</version> </dependency> --> + <dependency> + <groupId>com.thetransactioncompany</groupId> + <artifactId>cors-filter</artifactId> + <version>1.9</version> + <exclusions> + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> </project> http://git-wip-us.apache.org/repos/asf/marmotta/blob/06fd91aa/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/resources/logback.xml ---------------------------------------------------------------------- diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/resources/logback.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/resources/logback.xml index 1fab29a..9c8d662 100644 --- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/resources/logback.xml +++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/resources/logback.xml @@ -1,6 +1,3 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) <?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more @@ -18,16 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. --> +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) <configuration> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> - <!-- encoders are assigned the type - ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> <encoder> -<!-- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> --> <pattern>%d{HH:mm:ss.SSS} %-5level - %msg%n</pattern> -<!-- <pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern> --> </encoder> </appender> @@ -36,11 +32,7 @@ <logger name="org.apache.marmotta.platform.reasoner" level="INFO" /> - <logger name="org.hibernate" level="WARN" /> - - <logger name="org.apache.solr" level="WARN" /> - - <logger name="org.quartz" level="WARN" /> + <logger name="${package}" level="DEBUG" /> <root level="info"> <appender-ref ref="STDOUT" /> http://git-wip-us.apache.org/repos/asf/marmotta/blob/06fd91aa/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/META-INF/context.xml ---------------------------------------------------------------------- diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/META-INF/context.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/META-INF/context.xml new file mode 100644 index 0000000..619f257 --- /dev/null +++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/META-INF/context.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Context> + <Resource name="BeanManager" + auth="Container" + type="javax.enterprise.inject.spi.BeanManager" + factory="org.jboss.weld.resources.ManagerObjectFactory"/> +</Context> http://git-wip-us.apache.org/repos/asf/marmotta/blob/06fd91aa/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml index f4d8824..98b377d 100644 --- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml +++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml @@ -23,11 +23,21 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> + <!-- enable custom JNDI implementation --> + <listener> + <listener-class>org.apache.marmotta.platform.core.jndi.MarmottaJndiListener</listener-class> + </listener> + <!-- enable CDI / Weld for dependency injection --> <listener> <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class> </listener> + <!-- Initialise the KiWi system --> + <listener> + <listener-class>org.apache.marmotta.platform.core.servlet.MarmottaPreStartupListener</listener-class> + </listener> + <!-- RESTeasy Webservices --> <listener> <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class> @@ -39,26 +49,73 @@ <param-value>/tmp/marmotta</param-value> </context-param> + <!-- handle OPTIONS requests --> + <filter> + <filter-name>MarmottaOptionsFilter</filter-name> + <filter-class>org.apache.marmotta.platform.core.servlet.MarmottaOptionsFilter</filter-class> + </filter> + <filter-mapping> + <filter-name>MarmottaOptionsFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + <!-- enables a CORS filter and maps it to any request --> <!-- for more fine grained configuration have a look at http://software.dzhuvinov.com/cors-filter-configuration.html --> <filter> <!-- The CORS filter with parameters --> <filter-name>CORS</filter-name> <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class> + <init-param> <param-name>cors.supportedMethods</param-name> <param-value>GET, HEAD, POST, PUT, DELETE, OPTIONS</param-value> </init-param> + <init-param> <param-name>cors.supportedHeaders</param-name> <param-value>Origin, Accept, Content-Type</param-value> </init-param> + </filter> <filter-mapping> <filter-name>CORS</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> + <!-- this filter performs startup configurations for first installation --> + <filter> + <filter-name>MarmottaPreStartupFilter</filter-name> + <filter-class>org.apache.marmotta.platform.core.servlet.MarmottaPreStartupFilter</filter-class> + </filter> + <filter-mapping> + <filter-name>MarmottaPreStartupFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <!-- Serve static resources from file system and from .jar files of the respective modules --> + <filter> + <filter-name>MarmottaResourceFilter</filter-name> + <filter-class>org.apache.marmotta.platform.core.servlet.MarmottaResourceFilter</filter-class> + <init-param> + <!-- cache resources loaded from module jar files? --> + <param-name>kiwi.resourceCaching</param-name> + <param-value>true</param-value> + </init-param> + </filter> + <filter-mapping> + <filter-name>MarmottaResourceFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <!-- H2 Configuration --> + <filter> + <filter-name>MarmottaH2ConsoleFilter</filter-name> + <filter-class>org.apache.marmotta.platform.core.servlet.MarmottaH2ConsoleFilter</filter-class> + </filter> + <filter-mapping> + <filter-name>MarmottaH2ConsoleFilter</filter-name> + <url-pattern>/database/*</url-pattern> + </filter-mapping> <servlet> <servlet-name>H2Console</servlet-name> <servlet-class>org.h2.server.web.WebServlet</servlet-class> @@ -81,6 +138,7 @@ <servlet-name>ViewStatusMessages</servlet-name> <servlet-class>ch.qos.logback.classic.ViewStatusMessagesServlet</servlet-class> </servlet> + <servlet-mapping> <servlet-name>ViewStatusMessages</servlet-name> <url-pattern>/logging/status</url-pattern> @@ -94,6 +152,7 @@ <param-value>org.apache.marmotta.platform.core.webservices.CoreApplication</param-value> </init-param> </filter> + <filter-mapping> <filter-name>MarmottaWebservices</filter-name> <url-pattern>/*</url-pattern> @@ -104,4 +163,15 @@ <param-value>org.jboss.resteasy.cdi.CdiInjectorFactory</param-value> </context-param> + <filter> + <filter-name>MarmottaPostStartupFilter</filter-name> + <filter-class> + org.apache.marmotta.platform.core.servlet.MarmottaPostStartupFilter + </filter-class> + </filter> + <filter-mapping> + <filter-name>MarmottaPostStartupFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + </web-app> http://git-wip-us.apache.org/repos/asf/marmotta/blob/06fd91aa/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/index.jsp ---------------------------------------------------------------------- diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/index.jsp b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/index.jsp index 3b9b26c..7d472a2 100644 --- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/index.jsp +++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/index.jsp @@ -24,5 +24,5 @@ <%@ page import="org.apache.marmotta.platform.core.util.CDIContext" %> <% ConfigurationService configurationService = CDIContext.getInstance(ConfigurationService.class); - response.sendRedirect(configurationService.getBaseUri()+configurationService.getStringConfiguration("kiwi.pages.startup")); + response.sendRedirect(configurationService.getServerUri()+configurationService.getStringConfiguration("kiwi.pages.startup")); %> http://git-wip-us.apache.org/repos/asf/marmotta/blob/06fd91aa/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/logback.xml ---------------------------------------------------------------------- diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/logback.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/logback.xml index 126540a..9c8c9b7 100644 --- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/logback.xml +++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/logback.xml @@ -22,15 +22,13 @@ <configuration> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> - <!-- encoders are assigned the type - ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> </encoder> </appender> <appender name="FILE" class="ch.qos.logback.core.FileAppender"> - <file>kiwi-test.log</file> + <file>marmotta-test.log</file> <append>true</append> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> @@ -58,14 +56,8 @@ <logger name="org.apache.marmotta.platform.core" level="DEBUG" /> <logger name="kiwi.test" level="DEBUG" /> - <logger name="org.hibernate" level="INFO" /> - <logger name="org.hibernate.SQL" level="DEBUG" /> - <logger name="org.hibernate.pretty" level="DEBUG" /> - - <logger name="org.apache.solr" level="INFO" /> - - <root level="debug"> <appender-ref ref="FILE" /> + <appender-ref ref="STDOUT" /> </root> </configuration> http://git-wip-us.apache.org/repos/asf/marmotta/blob/06fd91aa/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/verification.xml ---------------------------------------------------------------------- diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/verification.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/verification.xml new file mode 100644 index 0000000..504912c --- /dev/null +++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/verification.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<verifications xmlns="http://maven.apache.org/verifications/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/verifications/1.0.0 http://maven.apache.org/xsd/verifications-1.0.0.xsd"> + <files> + <file> + <location>index.html</location> + <contains>var _SERVER_URL</contains> + </file> + <file> + <location>config.json</location> + <contains>\Q"kiwi.version":{"value":"${marmottaVersion}"\E</contains> + </file> + </files> +</verifications> http://git-wip-us.apache.org/repos/asf/marmotta/blob/06fd91aa/build/archetypes/marmotta-archetype-webapp/src/test/resources/projects/basic/archetype.properties ---------------------------------------------------------------------- diff --git a/build/archetypes/marmotta-archetype-webapp/src/test/resources/projects/basic/archetype.properties b/build/archetypes/marmotta-archetype-webapp/src/test/resources/projects/basic/archetype.properties index fb180dd..b3dab9d 100644 --- a/build/archetypes/marmotta-archetype-webapp/src/test/resources/projects/basic/archetype.properties +++ b/build/archetypes/marmotta-archetype-webapp/src/test/resources/projects/basic/archetype.properties @@ -19,4 +19,4 @@ package=it.pkg version=1.0-SNAPSHOT groupId=it.archetype artifactId=test - +appName=MyWebApp http://git-wip-us.apache.org/repos/asf/marmotta/blob/06fd91aa/build/archetypes/marmotta-archetype-webapp/src/test/resources/projects/basic/goal.txt ---------------------------------------------------------------------- diff --git a/build/archetypes/marmotta-archetype-webapp/src/test/resources/projects/basic/goal.txt b/build/archetypes/marmotta-archetype-webapp/src/test/resources/projects/basic/goal.txt index e69de29..4b8caad 100644 --- a/build/archetypes/marmotta-archetype-webapp/src/test/resources/projects/basic/goal.txt +++ b/build/archetypes/marmotta-archetype-webapp/src/test/resources/projects/basic/goal.txt @@ -0,0 +1 @@ +package verify \ No newline at end of file
