takari / polyglot-maven

Support alternative markup for Apache Maven POM files
Eclipse Public License 1.0
893 stars 101 forks source link

Fixes #220 #221

Closed thorntonrp closed 3 years ago

thorntonrp commented 4 years ago

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:

  1. 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.
  2. 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.
mosabua commented 3 years ago

0.4.6 is out