mirror of https://github.com/apache/activemq.git
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. git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@412955 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
37e3387bed
commit
a1ba6e0325
|
@ -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>
|
6
pom.xml
6
pom.xml
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue