0
votes

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>
1
How are you integrating ActiveMQ Artemis and Tomcat together? What pom are you referring to? As far as I'm aware there is no automated integration so you should have full control on how everything is deployed.Justin Bertram
We use Apache Maven WAR plugin using Spring Framework (not boot). <groupId>org.apache.activemq</groupId><artifactId>apache-artemis</artifactId> <version>2.17.0</version>. The WAR file ends up with a file named index.html in the web apps directory. The page is actually blank but if I look at the code contents it has the title "ActiveMQ Artemis Console".Artesran
I tried excluding artifactid artemis-console but then another index.html file gets added to the WAR file this one says "hawtio-activemq-branding" with really nothing in it. In theory I guess I can remove the index.html file but my logging somehow broke after the upgrade also (that I still need to research). Maybe too big a jump from 1.5.6 to 2.17Artesran
Can you include your full pom.xml in your question? Are you embedding ActiveMQ Artemis in Tomcat via a WAR file? Please elaborate more fully on your use-case in the question.Justin Bertram
It is a little big. Let me see if I can create a modified version without internal nexus repositories, etc...Artesran

1 Answers

0
votes

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:

  • artemis-console
  • activemq-branding
  • artemis-plugin

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>