Skip to content

Commit

Permalink
About #5. Created separate module for producing the runnable jar - se…
Browse files Browse the repository at this point in the history
…rver
  • Loading branch information
enridaga committed Jun 12, 2015
1 parent c73ee58 commit b295493
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 68 deletions.
84 changes: 16 additions & 68 deletions basil/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
<version>0.2.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<groupId>basil</groupId>
<artifactId>basil</artifactId>
<version>0.2.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>BASIL</name>
Expand Down Expand Up @@ -157,72 +155,22 @@
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.0.M1</version>
<configuration>
<scanIntervalSeconds>5</scanIntervalSeconds>
<systemProperties>
<systemProperty>
<name>log4j.configurationFile</name>
<value>${project.basedir}/src/test/resources/log4j2-jetty.xml</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>uk.ac.open.kmi.basil.server.Standalone</mainClass>
</manifest>
</archive>
<finalName>basil-server-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.0.M1</version>
<configuration>
<scanIntervalSeconds>5</scanIntervalSeconds>
<systemProperties>
<systemProperty>
<name>log4j.configurationFile</name>
<value>${project.basedir}/src/test/resources/log4j2-jetty.xml</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
</project>

3 changes: 3 additions & 0 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<log4j.version>2.1</log4j.version>
<!-- jetty -->
<org.eclipse.jetty.version>9.2.3.v20140905</org.eclipse.jetty.version>

<!-- basil version -->
<basil.version>0.2.0-SNAPSHOT</basil.version>
</properties>

<dependencyManagement>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<modules>
<module>parent</module>
<module>basil</module>
<module>server</module>
</modules>
</project>

84 changes: 84 additions & 0 deletions server/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>

<parent>
<groupId>basil</groupId>
<artifactId>parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<artifactId>basil-server</artifactId>
<packaging>jar</packaging>

<name>BASIL :: Server</name>

<description>Server</description>

<dependencies>
<dependency>
<groupId>basil</groupId>
<artifactId>basil</artifactId>
<version>${basil.version}</version>
</dependency>


</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>uk.ac.open.kmi.basil.server.Standalone</mainClass>
</manifest>
</archive>
<finalName>basil-server-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
</build>
</project>

15 changes: 15 additions & 0 deletions server/src/test/resources/log4j2-jetty.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<!-- PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/ -->
<PatternLayout pattern="[%-5p] %d %F:%L - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="org.apache.log4j.xml" level="info"/>
<Root level="info">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
15 changes: 15 additions & 0 deletions server/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<!-- PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/ -->
<PatternLayout pattern="[%-5p] %F:%L - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="org.apache.log4j.xml" level="info"/>
<Root level="info">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>

0 comments on commit b295493

Please sign in to comment.