This fixes an issue that popped up on the Azure Pipelines Maven3 task. Azure Pipelines runs the build with the argument -f path/to/pom/file. When running with the -f argument, the logic for generating the file .polyglot.pom.xxx does not get invoked and the maven-depoy-plugin attempts to upload the polyglot pom script to the Maven repository instead, causing the build to fail with a 409 Conflict error because the polyglot pom script is not valid xml.
This PR does the following:
Ensures that the xml pom file gets generated and written to .polyglot.pom.xxx whether running with the -f argument or not. The xml pom file is required for the maven install and deploy goals.
Adds a new @Component class named TeslaProjectBuilder to ensure that the location of the file .polyglot.pom.xxx gets set after the MavenProject object is produced. This ensures that the correct pom xml file will get copied into the local Maven repository for uploading to the remote Maven repository even when running with the -f argument.
This fixes an issue that popped up on the Azure Pipelines Maven3 task. Azure Pipelines runs the build with the argument
-f path/to/pom/file
. When running with the-f
argument, the logic for generating the file.polyglot.pom.xxx
does not get invoked and the maven-depoy-plugin attempts to upload the polyglot pom script to the Maven repository instead, causing the build to fail with a409 Conflict
error because the polyglot pom script is not valid xml.This PR does the following:
.polyglot.pom.xxx
whether running with the-f
argument or not. The xml pom file is required for the maven install and deploy goals.@Component
class namedTeslaProjectBuilder
to ensure that the location of the file.polyglot.pom.xxx
gets set after the MavenProject object is produced. This ensures that the correct pom xml file will get copied into the local Maven repository for uploading to the remote Maven repository even when running with the-f
argument.