Skip to content

For the Gradle case, consider defining app name/location similar to how we do for Maven. #160

@scottkurz

Description

@scottkurz

There's an opportunity for the starter to add more consistency across the Gradle/Maven cases, which would be to define a common server.xml config.

In the Maven case we explicitly generate this via the server.xml template:

    <!-- Configures the application on a specified context root -->
    <webApplication contextRoot="/app-name" location="app-name.war" />

whereas in the Gradle case we do not have an application element, but rather rely on the ability of Liberty Gradle Plugin to generate an application config in config dropins.

One detail that the Maven case handles, to make this happen, is removing the version name from the location (generated WAR file name) via this element in pom.xml:

  <finalName>app-name</finalName>

It seems we could do the equivalent in Gradle with something like this:

war {
    archiveName = "${baseName}.${extension}"
}

As long as this is not bad or weird from some broader, more general Gradle user's perspective, this would be an option.

Why do this?

I'm not sure consistency purely for the sake of consistency is that compelling. Most users will only be interested in using one of Maven vs. Gradle at a time.

However, I think there is a case to be made for having the explicit config in server.xml as opposed to the generated config dropins entry.

The latter isn't as transparent...it's kind of "magic". We have had bugs in this area within the Maven/Gradle plugins (though I would guess we've fixed most or all??? of them).

I think we kind of went down a similar path in the discussion here:
#5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    In Design/Discussion

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions