jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r720524 - in /jackrabbit/trunk/jackrabbit-standalone: pom.xml src/main/java/org/apache/jackrabbit/standalone/Main.java
Date Tue, 25 Nov 2008 16:13:00 GMT
Author: jukka
Date: Tue Nov 25 08:13:00 2008
New Revision: 720524

URL: http://svn.apache.org/viewvc?rev=720524&view=rev
Log:
JCR-1357: Create "quick start" developer bundles for model 1,2,3 deployment

Use the maven-dependency-plugin instead of the maven-assembly-plugin to generate the standalone
jar file. This way we only get one build artifact.

Set the Main-Class attribute in the manifest.

Automatically detect the location of the jar file using Class.getProtectionDomain().

Modified:
    jackrabbit/trunk/jackrabbit-standalone/pom.xml
    jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java

Modified: jackrabbit/trunk/jackrabbit-standalone/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-standalone/pom.xml?rev=720524&r1=720523&r2=720524&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-standalone/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-standalone/pom.xml Tue Nov 25 08:13:00 2008
@@ -39,13 +39,36 @@
   <build>
     <plugins>
       <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
+        <artifactId>maven-jar-plugin</artifactId>
         <configuration>
-          <descriptorRefs>
-            <descriptorRef>jar-with-dependencies</descriptorRef>
-          </descriptorRefs>
+          <archive>
+            <manifest>
+              <mainClass>org.apache.jackrabbit.standalone.Main</mainClass>
+            </manifest>
+          </archive>
         </configuration>
       </plugin>
+      <plugin>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>unpack-dependencies</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>unpack-dependencies</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${project.build.directory}/classes</outputDirectory>
+              <excludes>
+                LICENSE*, NOTICE*, META-INF/LICENSE*, META-INF/NOTICE*,
+                license, license/**/*, test, test/**/*,
+                WEB-INF/lib, WEB-INF/lib/**/*,
+                WEB-INF/classes, WEB-INF/classes/**/*
+              </excludes>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 
@@ -54,6 +77,7 @@
       <groupId>javax.jcr</groupId>
       <artifactId>jcr</artifactId>
       <version>1.0</version>
+      <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.jackrabbit</groupId>
@@ -62,6 +86,12 @@
       <type>war</type>
     </dependency>
     <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-webapp</artifactId>
+      <version>${project.version}</version>
+      <type>jar</type>
+    </dependency>
+    <dependency>
       <groupId>org.mortbay.jetty</groupId>
       <artifactId>jetty</artifactId>
       <version>6.1.11</version>
@@ -71,11 +101,6 @@
       <artifactId>jsp-2.1</artifactId>
       <version>6.1.11</version>
     </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-      <version>1.3.0</version>
-    </dependency>
   </dependencies>
 
 </project>

Modified: jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java?rev=720524&r1=720523&r2=720524&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java
(original)
+++ jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java
Tue Nov 25 08:13:00 2008
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.standalone;
 
 import java.io.File;
+import java.net.URL;
 
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.webapp.WebAppContext;
@@ -30,17 +31,21 @@
      * @param args
      */
     public static void main(String[] argv) throws Exception {
+        URL location =
+            Main.class.getProtectionDomain().getCodeSource().getLocation();
+
         File jackrabbit = new File("jackrabbit");
         jackrabbit.mkdirs();
 
         WebAppContext webapp = new WebAppContext();
         webapp.setContextPath("/");
-        webapp.setWar("target/jackrabbit-standalone-SNAPSHOT-jar-with-dependencies.jar");
+        webapp.setWar(location.toURI().toString());
         webapp.setExtractWAR(false);
         webapp.setTempDirectory(new File(jackrabbit, "jetty"));
 
-        Server server = new Server(8080);
+        Server server = new Server(1234);
         server.setHandler(webapp);
+        server.setStopAtShutdown(true);
         server.start();
         server.join();
     }



Mime
View raw message