Azure-pipelines-tasks: Make help:effective-pom command configurable

Created on 28 Jul 2017  路  9Comments  路  Source: microsoft/azure-pipelines-tasks

We do have a big maven project with dozens of modules which we build separately in parallel. Since you added hardcoded help:effective-pom command, build time of each module increased from 2.5m to 10-12m, because most of the time build just printing the whole root pom content with all dependent modules, doing all substitutions etc. Please make it configurable at least, so we can disable this.

CrossPlatform

Most helpful comment

Why is this bug report closed?
We wan't to authenticate maven feeds from ado without using jwt maven stream tokens which expire.
I don' get anyway why the effective-pom:help comes together mandatory with this feature.
It clutters the console with useless info i don't want, and even raises the build time. Can you please remove "effective-pom:help param from command line`or make is optional ?
@lkillgore "we need the effective-pom for this feature". Do you really need the console log out for the feature? Could you maybe hide it from azure devops console, even if its printed system out by maven exe? Or run a prekob which collects the effective pom necesarry info before hand (if thta doesn't make the runtme even worse?)

All 9 comments

Hi @vglafirov, we didn't realize that it would balloon the build times up that much (in my testing it's only added ~10-30 seconds to the build). We're taking your suggestion, and I'm working on adding an option to suppress that step.

If it's alright, could you please give me some details about your build setup? How many builds / pom.xmls do you use? Does the effective pom take ~9 minutes to generate? Are you using our 'Hosted' build agents or are you using your own agents?

It is not only the build time, but it also bloats the logs.
We have a 50+ nested multi module maven setup, and it now starts to spit out 47000+ lines of logging/data before it is doing / showing something useful...

Besides, if I want to see the effective pom, I can add the help:effective-pom myself

So please remove the help:effective-pom command before the actual / configured mvn command.

(people can add multiple VSTS Maven build tasks just to split up commands if they want to )

A new option was added in the Maven Task version 1.122.1 to disable this behavior: Advanced->Authenticate built-in Maven feeds. By default this value is checked, so to disable you will have to change the value in the task. This fix will also be part of the m121 release.

Thank you for the suggestion!

Hi, I cannot find this configuration. can you please be more specific?

Hi there @lkillgore. I realize this issue is closed, but I'd like to request that this be turned off by default. If I want to see the effective pom in my logs I can add that step to my build process myself. In many cases the effective pom is incredibly long. In my case I reference spring-boot-starter-parent as my parent pom and have only two modules and a few of my own dependencies. I end up with 12,000 lines worth of effective pom in my log.

Hi @Dima1224, we're printing the effective-pom so we can seamlessly integrate into other services (not for diagnostic purposes). For instance, if you're using our Package Management system, we handle authentication for you (we need the effective-pom for this feature).

I'm sorry that this ends up being an annoyance for you, but I'm not sure that it's the best course of action to change this default and break existing builds that rely on this feature. Perhaps there may be some things that we can do to mitigate this for you, though. (For instance, I'll bring up the suggestion to suppress the pom from printing to the logs by default. Would something like this address your concerns?) You may also want to save a build template with the task configured with this option turned off, which might help you in the meantime.

@aviadkam, I apologize for missing your comment earlier. FWIW, here's the option:
image

You may notice that we do put a message in your build summary if you have 'authentication' enabled but aren't using it.

Thanks for the quick reply @lkillgore. I think the solution you proposed of suppressing the pom from printing to the logs by default is the right one. What we're seeing now is an example of internal implementation details leaking out to the user, which usually leads to confused and unhappy users.

I agree you can't turn off the authentication option by default since people may already be relying on it and it seems like generally useful functionality. I doubt anybody is relying on the effective pom being printed to the logs, though.

Why is this bug report closed?
We wan't to authenticate maven feeds from ado without using jwt maven stream tokens which expire.
I don' get anyway why the effective-pom:help comes together mandatory with this feature.
It clutters the console with useless info i don't want, and even raises the build time. Can you please remove "effective-pom:help param from command line`or make is optional ?
@lkillgore "we need the effective-pom for this feature". Do you really need the console log out for the feature? Could you maybe hide it from azure devops console, even if its printed system out by maven exe? Or run a prekob which collects the effective pom necesarry info before hand (if thta doesn't make the runtme even worse?)

I know this is an old post but since I was struggling with this, maybe it will help someone else too, I had my pipeline in yml form, this way you can disable the effective pom option:

  • task: Maven@3
    inputs:
    mavenPomFile: 'pom.xml'
    mavenOptions: '-Xmx3072m'
    options: '--settings ./.m2/settings.xml'
    javaHomeOption: 'JDKVersion'
    jdkVersionOption: '1.8'
    jdkArchitectureOption: 'x64'
    effectivePomSkip: true
    mavenAuthenticateFeed: false
    publishJUnitResults: true
    testResultsFiles: '*/surefire-reports/TEST-.xml'
    sonarQubeRunAnalysis: false
    goals: 'package'
Was this page helpful?
0 / 5 - 0 ratings