0

I can download & start a usefully configured activeMQ broker with this:

mvn org.apache.activemq.tooling:maven-activemq-plugin:5.7.0:run

Which is amazing, but also quite a mouthful, and easy to forget or misspell. I could wrap this in a shell script, but I would prefer to keep the file-count low, so I concocted this:

<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>
    <groupId>com.pushtechnology.example</groupId>
    <artifactId>jms-broker</artifactId>
    <version>0.0.1-SNAPSHOT</version>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.5.0</version>
        <executions>
          <execution>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <executable>mvn</executable>
          <arguments>
            <argument>org.apache.activemq.tooling:maven-activemq-plugin:5.7.0:run</argument>
          </arguments>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

... so now I need only remember mvn exec:exec however this comes with the expense of a child process with it's own JVM and copy of Maven. It works, but it feels like a hammer to crack an egg. Is there a more idiomatic means to starting ActiveMQ with a pithy command line involving only Maven?

Martin Cowie
  • 2,788
  • 7
  • 38
  • 74
  • Check this http://stackoverflow.com/a/40206597/1743880 The plugin prefix resolution is what you're looking for. – Tunaki Nov 25 '16 at 09:53
  • Are you trying to start ActiveMQ standalone? Or specifically ActiveMQ within Maven? Is this for a unit test or to run as a service? Also-- be sure to upgrade. 5.7.0 is really dated. – Matt Pavlovich Nov 26 '16 at 02:38

0 Answers0