activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From foco...@apache.org
Subject svn commit: r412955 - in /incubator/activemq/trunk: ./ assembly/ tooling/maven-activemq-memtest-plugin/ tooling/maven-activemq-plugin/ tooling/maven-activemq-plugin/src/ tooling/maven-activemq-plugin/src/main/ tooling/maven-activemq-plugin/src/main/jav...
Date Fri, 09 Jun 2006 06:54:32 GMT
Author: foconer
Date: Thu Jun  8 23:54:32 2006
New Revision: 412955

URL: http://svn.apache.org/viewvc?rev=412955&view=rev
Log:
Updates:
1. Added plugin that will start Broker
2. Updated assembly pom to include the new plugin but still commented out.
3. Updated memtest plugin dependency version config.
4. Updated root pom.xml to use https on scm connection.

Added:
    incubator/activemq/trunk/tooling/maven-activemq-plugin/
    incubator/activemq/trunk/tooling/maven-activemq-plugin/pom.xml
    incubator/activemq/trunk/tooling/maven-activemq-plugin/src/
    incubator/activemq/trunk/tooling/maven-activemq-plugin/src/main/
    incubator/activemq/trunk/tooling/maven-activemq-plugin/src/main/java/
    incubator/activemq/trunk/tooling/maven-activemq-plugin/src/main/java/org/
    incubator/activemq/trunk/tooling/maven-activemq-plugin/src/main/java/org/apache/
    incubator/activemq/trunk/tooling/maven-activemq-plugin/src/main/java/org/apache/activemq/
    incubator/activemq/trunk/tooling/maven-activemq-plugin/src/main/java/org/apache/activemq/maven/
    incubator/activemq/trunk/tooling/maven-activemq-plugin/src/main/java/org/apache/activemq/maven/BrokerMojo.java
Modified:
    incubator/activemq/trunk/assembly/pom.xml
    incubator/activemq/trunk/pom.xml
    incubator/activemq/trunk/tooling/maven-activemq-memtest-plugin/pom.xml

Modified: incubator/activemq/trunk/assembly/pom.xml
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/assembly/pom.xml?rev=412955&r1=412954&r2=412955&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/pom.xml (original)
+++ incubator/activemq/trunk/assembly/pom.xml Thu Jun  8 23:54:32 2006
@@ -302,7 +302,16 @@
           </execution>
         </executions>
       </plugin>
+      <!-- plugin>
+        <groupId>incubator-activemq</groupId>
+        <artifactId>maven-activemq-plugin</artifactId>
+        <version>${pom.version}</version>
+        <configuration>
+          <configFile>${basedir}/src/release/conf/activemq.xml</configFile>
+          <!-- url>broker:(tcp://localhost:61616)?useJmx=false</url -->
+        <!--/configuration>
+      </plugin -->
     </plugins>
   </build>
 
-</project>
+</project>
\ No newline at end of file

Modified: incubator/activemq/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/pom.xml?rev=412955&r1=412954&r2=412955&view=diff
==============================================================================
--- incubator/activemq/trunk/pom.xml (original)
+++ incubator/activemq/trunk/pom.xml Thu Jun  8 23:54:32 2006
@@ -145,8 +145,8 @@
   </modules> 
 
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/activemq/trunk</connection>
-    <developerConnection>scm:svn:http://svn.apache.org/repos/asf/incubator/activemq/trunk</developerConnection>
+    <connection>scm:svn:https://svn.apache.org/repos/asf/incubator/activemq/trunk</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/activemq/trunk</developerConnection>
     <url>http://svn.apache.org/viewcvs.cgi/incubator/activemq/trunk/</url>
   </scm>
 
@@ -907,4 +907,4 @@
     <xmlpull-version>1.1.3.4d_b4_min</xmlpull-version>
     <xstream-version>1.1.2</xstream-version>
   </properties>
-</project>
+</project>
\ No newline at end of file

Modified: incubator/activemq/trunk/tooling/maven-activemq-memtest-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-memtest-plugin/pom.xml?rev=412955&r1=412954&r2=412955&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-memtest-plugin/pom.xml (original)
+++ incubator/activemq/trunk/tooling/maven-activemq-memtest-plugin/pom.xml Thu Jun  8 23:54:32
2006
@@ -6,7 +6,7 @@
     <parent>
         <groupId>incubator-activemq</groupId>
         <artifactId>activemq-parent</artifactId>
-        <version>4.0-SNAPSHOT</version>
+        <version>4.1-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -25,42 +25,34 @@
         <dependency>
             <groupId>incubator-activemq</groupId>
             <artifactId>activemq-core</artifactId>
-            <version>4.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>incubator-activemq</groupId>
             <artifactId>activemq-console</artifactId>
-            <version>4.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>incubator-activemq</groupId>
             <artifactId>activeio-core</artifactId>
-            <version>3.0-beta2</version>
         </dependency>
         <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derby</artifactId>
-            <version>10.1.1.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derbynet</artifactId>
-            <version>10.1.1.0</version>
         </dependency>
         <dependency>
             <groupId>backport-util-concurrent</groupId>
             <artifactId>backport-util-concurrent</artifactId>
-            <version>2.1</version>
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jms_1.1_spec</artifactId>
-            <version>1.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-j2ee-management_1.0_spec</artifactId>
-            <version>1.0</version>
         </dependency>
     </dependencies>
 </project>

Added: incubator/activemq/trunk/tooling/maven-activemq-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-plugin/pom.xml?rev=412955&view=auto
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-plugin/pom.xml (added)
+++ incubator/activemq/trunk/tooling/maven-activemq-plugin/pom.xml Thu Jun  8 23:54:32 2006
@@ -0,0 +1,58 @@
+<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/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>incubator-activemq</groupId>
+        <artifactId>activemq-parent</artifactId>
+        <version>4.1-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+
+    <groupId>incubator-activemq</groupId>
+    <artifactId>maven-activemq-plugin</artifactId>
+    <packaging>maven-plugin</packaging>
+    <name>ActiveMQ :: StartUp Plugin</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-plugin-api</artifactId>
+            <version>2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>incubator-activemq</groupId>
+            <artifactId>activemq-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>incubator-activemq</groupId>
+            <artifactId>activemq-console</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>incubator-activemq</groupId>
+            <artifactId>activeio-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbynet</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>backport-util-concurrent</groupId>
+            <artifactId>backport-util-concurrent</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jms_1.1_spec</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-j2ee-management_1.0_spec</artifactId>
+        </dependency>
+    </dependencies>
+</project>

Added: incubator/activemq/trunk/tooling/maven-activemq-plugin/src/main/java/org/apache/activemq/maven/BrokerMojo.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-plugin/src/main/java/org/apache/activemq/maven/BrokerMojo.java?rev=412955&view=auto
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-plugin/src/main/java/org/apache/activemq/maven/BrokerMojo.java
(added)
+++ incubator/activemq/trunk/tooling/maven-activemq-plugin/src/main/java/org/apache/activemq/maven/BrokerMojo.java
Thu Jun  8 23:54:32 2006
@@ -0,0 +1,116 @@
+package org.apache.activemq.maven;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+import org.apache.activemq.console.Main;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
+
+/**
+ * Goal which starts activemq broker.
+ *
+ * @goal run
+ * @phase process-sources
+ */
+public class BrokerMojo
+        extends AbstractMojo {
+    /**
+     * Location of the output directory. Defaults to target.
+     *
+     * @parameter expression="${project.build.directory}"
+     * @required
+     */
+    private File outputDirectory;
+
+    /**
+     * Location of activemq xml config file.
+     *
+     * @parameter expression="${configFile}"
+     */
+    private File configFile;
+
+    /**
+     * Broker URL.
+     *
+     * @parameter expression="${url}" default-value="broker:(tcp://localhost:61616)?useJmx=false"
+     */
+    private String url;
+
+    public void execute()
+            throws MojoExecutionException {
+
+        File out = outputDirectory;
+
+        // Create output directory if it doesn't exist.
+        if (!out.exists()) {
+            out.mkdirs();
+        }
+
+        String[] args = new String[2];
+        if (configFile != null) {
+            File config;
+            try {
+                config = copy(configFile);
+            } catch (IOException e) {
+                throw new MojoExecutionException(e.getMessage());
+            }
+
+            args[0] = "start";
+            args[1] = "xbean:" + (config.toURI()).toString();
+        } else {
+            args[0] = "start";
+            args[1] = url;
+        }
+
+        Main.main(args);
+    }
+
+    /**
+     * Copy activemq configuration file to output directory.
+     *
+     * @param source
+     * @return
+     * @throws java.io.IOException
+     */
+    public File copy(File source) throws IOException {
+        FileChannel in = null, out = null;
+        File dest = new File(outputDirectory.getAbsolutePath() + File.separator + source.getName());
+
+        try {
+            in = new FileInputStream(source).getChannel();
+            out = new FileOutputStream(dest).getChannel();
+
+            long size = in.size();
+            MappedByteBuffer buf = in.map(FileChannel.MapMode.READ_ONLY, 0, size);
+
+            out.write(buf);
+
+        } finally {
+            if (in != null) in.close();
+            if (out != null) out.close();
+        }
+
+        return dest;
+    }
+}
\ No newline at end of file



Mime
View raw message