OpenLiberty / ci.gradle

Gradle plugins for managing Liberty profile servers #devops
Apache License 2.0
48 stars 51 forks source link

Unable to deploy a single war from multi-war project #460

Open cmuchinsky opened 4 years ago

cmuchinsky commented 4 years ago

When multiple war files are produced by a single gradle project, you cannot choose just one to bundle with liberty. Using the following configuration to select just one of the war task:

liberty {
  server {
    deploy {
      apps = [libertyWar]
    }
}

Results in the following message:

At least one application is not defined in the server configuration but the build file indicates it should be installed in the apps folder. Application configuration is being added to the target server configuration dropins folder by the plug-in.

And an installed_apps_XXXXXXXXXX.xml config file generated under configDropins/defaults which interferes with the intended configuration.

cherylking commented 4 years ago

What is getting added to the installed_apps_xxx.xml file? All the war files or just the libertyWar one specified in the apps attribute? Is the libertyWar application configured in your server.xml?

cmuchinsky commented 4 years ago

In generated install_apps_configuration_xxx.xml file contains

<?xml version="1.0" encoding="UTF-8"?>
<server>
    <webApplication id="foo-app" location="foo-app.war" name="foo-app"/>
    <webApplication id="foo-app" location="foo-app.war" name="foo-app"/>
</server>

The source server.xml contains

<?xml version="1.0" encoding="UTF-8"?>
<server description="foo-server">
    <application name="foo" context-root="/" location="foo.war" type="war"/>
</server>

The libertyWar war task produces foo.war

cherylking commented 4 years ago

Can you provide the rest of the build.gradle file? Or a sample test project for us to reproduce?

cherylking commented 3 years ago

@cmuchinsky Is this issue still a problem for you? If so, can you provide a sample test project so we can recreate the issue?

cmuchinsky commented 3 years ago

I believe this is still a bug, but have since refactored my build to work around it by not having more than one war file produced from a single gradle build.