Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE_REQ] Support pre-definition for Spring Apps maven plugin #2296

Open
moarychan opened this issue May 18, 2023 · 1 comment
Open

[FEATURE_REQ] Support pre-definition for Spring Apps maven plugin #2296

moarychan opened this issue May 18, 2023 · 1 comment

Comments

@moarychan
Copy link
Member

Plugin name and version

azure-spring-apps-maven-plugin, 1.17.0

Plugin configuration in your pom.xml

<plugin>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-spring-apps-maven-plugin</artifactId>
    <version>1.17.0</version>
    <configuration>
        <appName>customers-service</appName>
        <isPublic>false</isPublic>
        <deployment>
            <cpu>1</cpu>
            <memoryInGB>1</memoryInGB>
            <instanceCount>1</instanceCount>
            <runtimeVersion>Java 17</runtimeVersion>
        </deployment>
    </configuration>
</plugin>

Expected behavior

The node configuration of the maven plugin azure-spring-apps-maven-plugin .

The configuration of the Maven plugin can define default configuration items or deployment items. When executing xxx:config, if the user does not want to use the default value, give a new value, such as <appName>customers-service</appName>, <runtimeVersion>Java 17</runtimeVersion>, etc. When saving into the POM file, all configured configurations will be merged into the maven plugin configuration node.

Actual behavior

Will skip config the module if there's a pre-definition for the Spring apps maven plugin.

Steps to reproduce the problem

  • Clone code https://github.com/Azure-Samples/spring-petclinic-microservices

  • Navigate to the sample project directory, and add the below plugin for the customer module:

    <plugin>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure-spring-apps-maven-plugin</artifactId>
        <version>1.17.0</version>
        <configuration>
            <appName>customers-service</appName>
            <isPublic>false</isPublic>
            <deployment>
                <cpu>1</cpu>
                <memoryInGB>1</memoryInGB>
                <instanceCount>1</instanceCount>
                <runtimeVersion>Java 17</runtimeVersion>
            </deployment>
        </configuration>
    </plugin>
  • Execute mvnw com.microsoft.azure:azure-spring-apps-maven-plugin:1.17.0:config to configure all the sub-modules to ASA, it will skip the module customer.
    image

@Flanker32
Copy link
Member

@moarychan Thanks for your report and sorry for the late response, currently spring apps maven plugin does not support modify existing configuration, but if you want to set cpu/memory during config, you may add -DadvancedOptions, here is the screen shot

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants