Skip to content

Commit

Permalink
springside#32 嵌入式的Jetty实现Executable War, 可用 java -jar xxxx.war 运行,用Ma…
Browse files Browse the repository at this point in the history
…ven Assembly插件打包.
  • Loading branch information
calvin1978 committed Apr 9, 2012
1 parent e3d70ce commit 909c895
Show file tree
Hide file tree
Showing 6 changed files with 200 additions and 62 deletions.
33 changes: 17 additions & 16 deletions examples/mini-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@

<!-- spring data access -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
</dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
Expand Down Expand Up @@ -134,7 +134,7 @@
<artifactId>ehcache-core</artifactId>
</dependency>

<!-- SECURITY begin-->
<!-- SECURITY begin -->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
Expand Down Expand Up @@ -168,11 +168,11 @@
</dependency>
<dependency>
<groupId>log4jdbc</groupId>
<artifactId>log4jdbc4</artifactId>
</dependency>
<artifactId>log4jdbc4</artifactId>
</dependency>
<!-- LOGGING end -->

<!-- GENERAL UTILS begin-->
<!-- GENERAL UTILS begin -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down Expand Up @@ -277,10 +277,9 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx256M</argLine>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<!-- cobertura插件, 设置不需要计算覆盖率的类 -->
<!-- cobertura插件, 设置不需要计算覆盖率的类 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
Expand All @@ -306,7 +305,7 @@
</configuration>
</plugin>

<!-- jetty插件, 设定端口与context path-->
<!-- jetty插件, 设定端口与context path -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
Expand All @@ -333,11 +332,12 @@
<includes>
<include>**/*IT.java</include>
</includes>
<useSystemClassLoader>false</useSystemClassLoader>
<systemPropertyVariables>
<selenium.driver>${selenium.driver}</selenium.driver>
</systemPropertyVariables>
</configuration>
</plugin>
</plugin>
</plugins>
</build>
</profile>
Expand All @@ -354,11 +354,12 @@
<includes>
<include>**/*IT.java</include>
</includes>
<useSystemClassLoader>false</useSystemClassLoader>
<systemPropertyVariables>
<selenium.driver>${selenium.driver}</selenium.driver>
</systemPropertyVariables>
</configuration>
</plugin>
</plugin>
</plugins>
</build>
</profile>
Expand All @@ -381,9 +382,9 @@

<echo>Waiting for the h2 server start...</echo>
<waitfor maxwait="500" maxwaitunit="second">
<and>
<socket server="localhost" port="9092"/>
</and>
<and>
<socket server="localhost" port="9092"/>
</and>
</waitfor>
<echo>The h2 server started.</echo>
<sql driver="${jdbc.driver}" url="${jdbc.url}" userid="${jdbc.username}" password="${jdbc.password}" src="src/main/resources/sql/${sql.type}/schema.sql" onerror="continue">
Expand All @@ -396,7 +397,7 @@
</dbconfig>
<classpath refid="maven.test.classpath" />
<operation type="CLEAN_INSERT" src="src/test/resources/data/sample-data.xml" format="flat" transaction="true"/>
</dbunit>
</dbunit>
</target>
</configuration>
</plugin>
Expand Down
42 changes: 42 additions & 0 deletions examples/showcase/assembly-standalone.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>standalone</id>
<formats>
<format>war</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>

<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<includes>
<include>org.eclipse.jetty*:*</include>
</includes>
<scope>provided</scope>
<unpack>true</unpack>
<unpackOptions>
<excludes>
<exclude>META-INF/*</exclude>
</excludes>
</unpackOptions>
</dependencySet>
</dependencySets>

<fileSets>
<fileSet>
<directory>${project.basedir}/target/${project.build.finalName}</directory>
<outputDirectory>/</outputDirectory>
<excludes>
<exclude>META-INF/**/*</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${project.basedir}/target/classes</directory>
<includes>
<include>**/*/Main.class</include>
</includes>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
</assembly>
Loading

0 comments on commit 909c895

Please sign in to comment.