You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ja...@apache.org on 2014/03/19 16:52:47 UTC
[1/2] git commit: 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
Repository: marmotta
Updated Branches:
refs/heads/develop b9f7df36a -> 06fd91aae
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/develop
Commit: 06fd91aaeef1a2b838014f20d752859fe5adb19b
Parents: d6cebf9
Author: Jakob Frank <ja...@apache.org>
Authored: Wed Mar 19 16:12:31 2014 +0100
Committer: Jakob Frank <ja...@apache.org>
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
[2/2] git commit: MARMOTTA-395: fixed and updated Marmotta-Module
Archetype: - added Logging - added ExceptionMapper example - fixed generation
errors - fixed compile warnings in the generated code
Posted by ja...@apache.org.
MARMOTTA-395: fixed and updated Marmotta-Module Archetype:
- added Logging
- added ExceptionMapper example
- fixed generation errors
- fixed compile warnings in the generated code
Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/d6cebf97
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/d6cebf97
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/d6cebf97
Branch: refs/heads/develop
Commit: d6cebf97d9c97bef6c9f579b0d5ffcfd84f48474
Parents: b9f7df3
Author: Jakob Frank <ja...@apache.org>
Authored: Wed Mar 19 11:39:29 2014 +0100
Committer: Jakob Frank <ja...@apache.org>
Committed: Wed Mar 19 16:47:32 2014 +0100
----------------------------------------------------------------------
.../marmotta-archetype-module/pom.xml | 17 +++++
.../META-INF/maven/archetype-metadata.xml | 4 +-
.../main/resources/archetype-resources/pom.xml | 56 ++++++++++----
.../src/main/java/api/MyService.java | 2 +-
.../main/java/exceptions/DoThisException.java | 38 ++++++++++
.../main/java/jaxrs/DoThisExceptionMapper.java | 39 ++++++++++
.../java/logging/MyServiceLoggingModule.java | 76 +++++++++++++++++++
.../src/main/java/services/MyServiceImpl.java | 2 +-
.../src/main/java/webservices/MyWebService.java | 16 +++-
.../src/main/resources/META-INF/beans.xml | 6 +-
.../src/test/java/services/MyServiceTest.java | 4 +-
.../test/java/webservices/MyWebServiceTest.java | 80 +++++++++++---------
.../projects/basic/archetype.properties | 2 +-
.../src/test/resources/projects/basic/goal.txt | 1 +
.../HttpErrorExceptionMapper.java | 1 -
15 files changed, 280 insertions(+), 64 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/pom.xml b/build/archetypes/marmotta-archetype-module/pom.xml
index eb8a49b..0b9a2fd 100644
--- a/build/archetypes/marmotta-archetype-module/pom.xml
+++ b/build/archetypes/marmotta-archetype-module/pom.xml
@@ -33,13 +33,24 @@
<properties>
<marmottaVersion>${project.version}</marmottaVersion>
+ <sesameVersion>${sesame.version}</sesameVersion>
+
<junitVersion>${junit.version}</junitVersion>
+ <weldVersion>${weld.version}</weldVersion>
<weldCoreVersion>${weld.core.version}</weldCoreVersion>
<h2Version>${h2.version}</h2Version>
<restAssuredVersion>${rest.assured.version}</restAssuredVersion>
<hamcrestVersion>${hamcrest.version}</hamcrestVersion>
<tempusFugitVersion>${tempus.fugit.version}</tempusFugitVersion>
<jatlVersion>${jatl.version}</jatlVersion>
+ <servletApiVersion>${servlet.api.version}</servletApiVersion>
+ <javax-elVersion>${javax.el.version}</javax-elVersion>
+ <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>
@@ -83,6 +94,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/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/META-INF/maven/archetype-metadata.xml b/build/archetypes/marmotta-archetype-module/src/main/resources/META-INF/maven/archetype-metadata.xml
index b34231e..135f8e4 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -19,7 +19,7 @@
-->
<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
-http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 " name="LMF Module"
+http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 " name="Apache Marmotta Module"
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
@@ -27,7 +27,7 @@ http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.
<requiredProperty key="moduleKey" />
<requiredProperty key="moduleName" />
</requiredProperties>
-
+
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml
index 6c11e80..1185ee5 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml
@@ -18,12 +18,35 @@
<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>
<name>Marmotta Module: ${moduleName}</name>
- <description></description>
- <version>${version}</version>
+ <description>The ${moduleName} Module</description>
+ <version>\${version}</version>
+
+ <properties>
+ <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>
<plugins>
@@ -34,6 +57,7 @@
<configuration>
<source>1.7</source>
<target>1.7</target>
+ <encoding>utf-8</encoding>
</configuration>
</plugin>
<plugin>
@@ -52,76 +76,76 @@
<dependency>
<groupId>org.apache.marmotta</groupId>
<artifactId>marmotta-core</artifactId>
- <version>${marmottaVersion}</version>
+ <version>\${marmotta.version}</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.apache.marmotta</groupId>
<artifactId>marmotta-core</artifactId>
- <version>${marmottaVersion}</version>
+ <version>\${marmotta.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
- <version>9.0.3.v20130506</version>
+ <version>\${jetty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
- <version>9.0.3.v20130506</version>
+ <version>\${jetty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>${junitVersion}</version>
+ <version>\${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
- <version>${weldCoreVersion}</version>
+ <version>\${weld.core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
- <version>${h2Version}</version>
+ <version>\${h2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>rest-assured</artifactId>
- <version>${restAssuredVersion}</version>
+ <version>\${rest.assured.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
- <version>${hamcrestVersion}</version>
+ <version>\${hamcrest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
- <version>${hamcrestVersion}</version>
+ <version>\${hamcrest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.tempus-fugit</groupId>
<artifactId>tempus-fugit</artifactId>
- <version>${tempusFugitVersion}</version>
+ <version>\${tempus.fugit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.googlecode.jatl</groupId>
<artifactId>jatl</artifactId>
- <version>${jatlVersion}</version>
+ <version>\${jatl.version}</version>
<scope>test</scope>
</dependency>
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/api/MyService.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/api/MyService.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/api/MyService.java
index 21ec9c1..b6c0e30 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/api/MyService.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/api/MyService.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/exceptions/DoThisException.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/exceptions/DoThisException.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/exceptions/DoThisException.java
new file mode 100644
index 0000000..a260d19
--- /dev/null
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/exceptions/DoThisException.java
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package ${package}.exceptions;
+
+
+public class DoThisException extends Exception {
+
+ public DoThisException() {
+ super();
+ }
+
+ public DoThisException(String message) {
+ super(message);
+ }
+
+ public DoThisException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public DoThisException(Throwable cause) {
+ super(cause);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/jaxrs/DoThisExceptionMapper.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/jaxrs/DoThisExceptionMapper.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/jaxrs/DoThisExceptionMapper.java
new file mode 100644
index 0000000..b16ab71
--- /dev/null
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/jaxrs/DoThisExceptionMapper.java
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+package ${package}.jaxrs;
+
+import org.apache.marmotta.platform.core.jaxrs.exceptionmappers.CDIExceptionMapper;
+
+import javax.enterprise.context.Dependent;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
+import ${package}.exceptions.DoThisException;
+
+/**
+ * Map DoThisException to a HTTP Response
+ */
+@Provider
+@Dependent
+public class DoThisExceptionMapper implements CDIExceptionMapper<DoThisException> {
+
+ @Override
+ public Response toResponse(DoThisException exception) {
+ return Response.status(444).entity(exception.getMessage()).build();
+ }
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/logging/MyServiceLoggingModule.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/logging/MyServiceLoggingModule.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/logging/MyServiceLoggingModule.java
new file mode 100644
index 0000000..bc8dd66
--- /dev/null
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/logging/MyServiceLoggingModule.java
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ */
+package ${package}.logging;
+
+import ch.qos.logback.classic.Level;
+import org.apache.marmotta.platform.core.logging.BaseLoggingModule;
+
+import javax.enterprise.context.ApplicationScoped;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * Configure Logging for the MyService Module
+ */
+@ApplicationScoped
+public class MyServiceLoggingModule extends BaseLoggingModule {
+
+ /**
+ * Return the default (logback) level used by this logging module. Should in most cases be INFO or WARN.
+ *
+ * @return
+ */
+ @Override
+ public Level getDefaultLevel() {
+ return Level.INFO;
+ }
+
+ /**
+ * Return a unique identifier for this logging module. This identifier will e.g. be used in the configuration file
+ * to store the configuration for this module. For this reason it should only consist of alpha-numeric characters
+ * plus _ and _.
+ *
+ * @return a unique identifier for the module, suitable for use in the configuration file
+ */
+ @Override
+ public String getId() {
+ return "${moduleKey}";
+ }
+
+ /**
+ * Return a human-readable name for this logging module. This name is used for displaying information about the
+ * module to the user, e.g. in a configuration interface.
+ *
+ * @return a human-readable name for the module, suitable for displaying in a user interface
+ */
+ @Override
+ public String getName() {
+ return "${moduleName}";
+ }
+
+ /**
+ * Return a collection of packages covered by this logging module. This method should be used to group together
+ * those packages that conceptually make up the functionality described by the logging module (e.g. "SPARQL").
+ *
+ * @return a collection of package names
+ */
+ @Override
+ public Collection<String> getPackages() {
+ return Collections.singleton("${package}");
+ }
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/services/MyServiceImpl.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/services/MyServiceImpl.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/services/MyServiceImpl.java
index 062b053..31e85eb 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/services/MyServiceImpl.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/services/MyServiceImpl.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
index c0b0358..8c7a0e2 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -19,6 +19,8 @@ package ${package}.webservices;
import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.ws.rs.*;
@@ -26,28 +28,38 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import ${package}.api.MyService;
+import ${package}.exceptions.DoThisException;
@Path("/${moduleKey}")
@ApplicationScoped
public class MyWebService {
@Inject
+ private Logger log;
+
+ @Inject
private MyService myService;
@GET
@Produces("text/html")
public Response hello(@QueryParam("name") String name) {
if (StringUtils.isEmpty(name)) {
+ log.warn("No name given");
// No name given? Invalid request.
return Response.status(Status.BAD_REQUEST).entity("Missing Parameter 'name'").build();
}
+ log.debug("Sending regards to {}", name);
// Return the greeting.
return Response.ok(myService.helloWorld(name)).build();
}
@POST
- public Response doThis(@QueryParam("turns") @DefaultValue("2") int turns) {
+ public Response doThis(@FormParam("turns") @DefaultValue("2") int turns) throws DoThisException {
+ log.debug("Request to doThis {} times", turns);
+ if (turns > 100) throw new DoThisException("At max, 100 turns are allowed");
+ if (turns < 0) throw new DoThisException("Can't undo 'This'");
+
myService.doThis(turns);
return Response.ok().build();
}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
index e8a7070..3d26e8f 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
@@ -1,6 +1,3 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
<?xml version="1.0" encoding="UTF-8"?>
<!--
@@ -21,6 +18,9 @@
limitations under the License.
-->
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
<beans
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/services/MyServiceTest.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/services/MyServiceTest.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/services/MyServiceTest.java
index 73a1ae3..77472a4 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/services/MyServiceTest.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/services/MyServiceTest.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -17,9 +17,9 @@
*/
package ${package}.services;
-import junit.framework.Assert;
import org.apache.marmotta.platform.core.test.base.EmbeddedMarmotta;
import org.junit.AfterClass;
+import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java
index f505f07..715d218 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -57,25 +57,25 @@ public class MyWebServiceTest {
/*
* GET ?name=<xxx>
*/
- given()
- .param("name", "Steve")
- .expect()
- .content(containsString("Hello Steve"))
- .when()
- .get("/${moduleKey}");
-
- given()
- .contentType(ContentType.HTML)
- .param("name", "Jürgen")
- .expect()
- .content(containsString("Hello Jürgen"))
- .when()
- .get("/${moduleKey}");
-
- expect()
- .statusCode(400)
- .when()
- .get("/${moduleKey}");
+ RestAssured.given()
+ .param("name", "Steve")
+ .expect()
+ .content(containsString("Hello Steve"))
+ .when()
+ .get("/${moduleKey}");
+
+ RestAssured.given()
+ .contentType(ContentType.HTML)
+ .param("name", "Jürgen")
+ .expect()
+ .content(containsString("Hello Jürgen"))
+ .when()
+ .get("/${moduleKey}");
+
+ RestAssured.expect()
+ .statusCode(400)
+ .when()
+ .get("/${moduleKey}");
}
@Test
@@ -83,21 +83,31 @@ public class MyWebServiceTest {
/*
* POST ?turns=i default 2
*/
- given()
- .param("turns", 1)
- .expect().statusCode(200)
- .when()
- .post("/${moduleKey}");
-
- given()
- .param("turns", 10)
- .expect().statusCode(200)
- .when()
- .post("/${moduleKey}");
-
- expect().statusCode(200)
- .when()
- .post("/${moduleKey}");
+ RestAssured.given()
+ .param("turns", 1)
+ .expect()
+ .statusCode(200)
+ .when()
+ .post("/${moduleKey}");
+
+ RestAssured.given()
+ .param("turns", 10)
+ .expect()
+ .statusCode(200)
+ .when()
+ .post("/${moduleKey}");
+
+ RestAssured.expect()
+ .statusCode(200)
+ .when()
+ .post("/${moduleKey}");
+
+ RestAssured.given()
+ .param("turns", 123)
+ .expect()
+ .statusCode(444)
+ .when()
+ .post("/${moduleKey}");
}
}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/archetype.properties b/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/archetype.properties
index d915b82..d5fd71c 100644
--- a/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/archetype.properties
+++ b/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/archetype.properties
@@ -19,6 +19,6 @@
package=it.pkg
version=0.1-SNAPSHOT
groupId=archetype.it
-artifactId=basic
+artifactId=my-marmotta-module
moduleKey=mymodule
moduleName=My Module
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/goal.txt
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/goal.txt b/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/goal.txt
index e69de29..597acc7 100644
--- a/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/goal.txt
+++ b/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/goal.txt
@@ -0,0 +1 @@
+package
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java
index 86f680d..99adeba 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.marmotta.platform.core.jaxrs.exceptionmappers;
import freemarker.template.TemplateException;