azure-maven-plugins icon indicating copy to clipboard operation
azure-maven-plugins copied to clipboard

[WebApp] Allow to explicitly set which artifact (JAR, WAR, etc) file to deploy

Open brunoborges opened this issue 5 years ago • 1 comments

The plugin should allow the configuration of the exact name of the artifact to be deployed, and therefore, renamed to app.jar right before upload.

Here's an example of how it should behave:

<deployment>
    <deployFile>target/myproject-custom-artifact-runner.jar</deployFile>
    <resources>
        <resource>
            <directory>${project.basedir}/target</directory>
            <includes>
                <include>**/*.jar</include>
            </includes>
        </resource>
    </resources>
</deployment>

This would allow the deployment of a JAR application that may contain other JARs and files that user may not want or may not be able to shade into an uber JAR.

The plugin currently tries to guess which JAR to deploy, while still supporting the upload of multiple files. Sometimes the runnable JAR is not ${project.build.finalName}.jar due to how other plugins the user may have in its pom.xml.

brunoborges avatar Jun 22 '19 08:06 brunoborges

Important: the element <resources> should be optional, as well as <deployFile>

If deployFile is not set, then defaults to the artifact that Maven produces. If deployFile is set, then it uses that as the target deployable artifact. If <resources> is not set, then only the main Maven project artifact is deployed. If <resources> is set, then any other file that is included should also be uploaded during deployment.

The element name deployFile is a suggestion. Other suggestions are: targetArtifact, deployArtifact.

brunoborges avatar Jun 27 '19 19:06 brunoborges

supported.

wangmingliang-ms avatar Sep 02 '22 06:09 wangmingliang-ms