Search code examples
javamavenopen-liberty

OpenLiberty Maven Plugin cannot set looseaplication to false


I'm doing practise openliberty.io multimodules with following that guide ( URL ). It's works fine as defaults.

But I want to use skinnyWars structure, i got errors when i run liberty:run or liberty:dev goals and couldn't resolve it.

Process steps;

I set skinnyWars parameter to true;

            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-ear-plugin</artifactId>
            <version>3.0.2</version>
            <configuration>
                <modules>
                    <!-- tag::jarModule[] -->
                    <jarModule>
                        <groupId>io.openliberty.guides</groupId>
                        <artifactId>guide-maven-multimodules-jar</artifactId>
                        <uri>/guide-maven-multimodules-jar-1.0-SNAPSHOT.jar</uri>
                    </jarModule>
                    <!-- end::jarModule[] -->
                    <!-- tag::webModule[] -->
                    <webModule>
                        <groupId>io.openliberty.guides</groupId>
                        <artifactId>guide-maven-multimodules-war</artifactId>
                        <uri>/guide-maven-multimodules-war-1.0-SNAPSHOT.war</uri>
                        <!-- Set custom context root -->
                        <!-- tag::contextRoot[] -->
                        <contextRoot>/converter</contextRoot>
                        <!-- end::contextRoot[] -->
                    </webModule>
                    <!-- end::webModule[] -->
                </modules>
                <skinnyWars>true</skinnyWars>
            </configuration>

I got that Error

[ERROR] Failed to execute goal io.openliberty.tools:liberty-maven-plugin:3.2:dev (default-cli) on project guide-maven-multimodules-ear: Unable to create loose configuration for the EAR application with skinnyWars package from io.openliberty.guides:guide-maven-multimodules-war:1.0-SNAPSHOT. Please set the looseApplication configuration parameter to false and try again. -> [Help 1]

Then as it told me, i set looseApplication parameter to false;

        <plugin>
            <groupId>io.openliberty.tools</groupId>
            <artifactId>liberty-maven-plugin</artifactId>
            <version>3.2</version>
            <configuration>
                <looseApplication>false</looseApplication>
            </configuration>
        </plugin>

mvn liberty:run -f finish/ear/pom.xml

I got It is not possible to start two applications called guide-maven-multimodules-ear. error. Application started at different contextRoot.

[AUDIT   ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT   ] CWWKG0093A: Processing configuration drop-ins resource: /home/user/git/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer/configDropins/defaults/install_apps_configuration_1491924271.xml
[AUDIT   ] CWWKG0093A: Processing configuration drop-ins resource: /home/user/git/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer/configDropins/overrides/liberty-plugin-variable-config.xml
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[ERROR   ] CWWKZ0013E: It is not possible to start two applications called guide-maven-multimodules-ear.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.1.33:9080/guide-maven-multimodules-ear/
[AUDIT   ] CWWKZ0001I: Application guide-maven-multimodules-ear started in 0.299 seconds.
[AUDIT   ] CWWKF0012I: The server installed the following features: [el-3.0, jsp-2.3, localConnector-1.0, servlet-3.1].
[AUDIT   ] CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 1.500 seconds.

mvn liberty:dev -f finish/ear/pom.xml

It seems like cannot set "looseApplication" to "false"

[WARNING] Overriding liberty plugin pararmeter, "looseApplication" to "true" and deploying application in looseApplication format
.
.
[ERROR] Failed to execute goal io.openliberty.tools:liberty-maven-plugin:3.2:dev (default-cli) on project guide-maven-multimodules-ear: Unable to create loose configuration for the EAR application with skinnyWars package from io.openliberty.guides:guide-maven-multimodules-war:1.0-SNAPSHOT. Please set the looseApplication configuration parameter to false and try again. -> [Help 1]

What should i do for these situations? I wish your helps.

Thanks,

Best Regards,


Solution

  • For liberty:run, an issue has been opened here: https://github.com/OpenLiberty/ci.maven/issues/1054

    liberty:dev currently does not support multi module projects. That will be addressed by https://github.com/OpenLiberty/ci.maven/issues/697