activemq-artemishawtio

Issues with Hawtio after upgrading ActiveMQ Artemis


I upgraded an ActiveMQ Artemis 1.5 project to 2.17, and some things started breaking. Is there any recommended way to force the exclusion of the automatic loading of a file called index.html from? I don't want the Hawtio interface but the pom seems to include it automatically in my Tomcat's webapps directory. It is interrupting the load of my regular index page. Excluding for example artemis-console from the pom will still add another different index file this time from artemis-hawtio branding also called index.html.

This one will create it. There is several html files created and some other stuff.

<?xml version="1.0" encoding="UTF-8"?>
<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>artemis.playgroud.fake</groupId>
    <artifactId>ArtemisPlayground</artifactId>
    <packaging>war</packaging>
    <name>Fake Webapp</name>
    <description>Fake interproduct communication.</description>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <java.naming.factory.initial>org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory</java.naming.factory.initial>
        <compiler.version>2.5.1</compiler.version>
        <org.springframework.version>5.2.3.RELEASE</org.springframework.version>
        <org.spring-security.version>5.2.3.RELEASE</org.spring-security.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>5.2.3.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${org.springframework.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-expression</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aop</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>apache-artemis</artifactId>
            <version>2.17.0</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>artemis-jms-client</artifactId>
            <version>2.17.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>artemis-core-client</artifactId>
       <!--     <version>1.5.6</version>  -->
            <version>2.17.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>artemis-junit</artifactId>
            <version>2.17.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.jms</groupId>
            <artifactId>jms</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>5.2.3.RELEASE</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>fake-service</finalName>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.4.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${compiler.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <index>true</index>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                            <Build-timestamp>${maven.build.timestamp}</Build-timestamp>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Solution

  • The org.apache.activemq:apache-artemis dependency which you are using is a pom dependency type, i.e.:

            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>apache-artemis</artifactId>
                <version>2.17.0</version>
                <type>pom</type>
            </dependency>
    

    For your purposes (i.e. building a WAR) this means that Maven will scan all the modules in apache-artemis and include any which use <packaging>war</packaging>. In ActiveMQ Artemis version 2.17.0 this includes:

    You can see Maven's war plugin process these when you run mvn install on your example pom.xml, e.g.:

    [INFO] --- maven-war-plugin:2.1:war (default-war) @ ArtemisPlayground ---
    [INFO] Packaging webapp
    [INFO] Assembling webapp [ArtemisPlayground] in [/path/to/fake-service/target/fake-service]
    [INFO] Processing war project
    [INFO] Processing overlay [ id org.apache.activemq:artemis-console]
    [INFO] Processing overlay [ id org.apache.activemq:activemq-branding]
    [INFO] Processing overlay [ id org.apache.activemq:artemis-plugin]
    [INFO] Webapp assembled in [285 msecs]
    [INFO] Building war: /path/to/fake-service/target/fake-service.war
    

    To be clear, none of these modules existed in ActiveMQ Artemis 1.5.0 which you were using previously. You can exclude these from your pom.xml, e.g.:

            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>apache-artemis</artifactId>
                <version>2.17.0</version>
                <type>pom</type>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.activemq</groupId>
                        <artifactId>artemis-console</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.activemq</groupId>
                        <artifactId>activemq-branding</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.activemq</groupId>
                        <artifactId>artemis-plugin</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
    

    That said, I'm not sure you actually need to configure this specific dependency in the first place. If all you really need to do is embed the broker you can probably just use this:

          <dependency>
             <groupId>org.apache.activemq</groupId>
             <artifactId>artemis-server</artifactId>
             <version>2.17.0</version>
          </dependency>