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

Cannot update tile.xml with maven-versions-plugins #127

Open
drekbour opened this issue Sep 27, 2021 · 7 comments
Open

Cannot update tile.xml with maven-versions-plugins #127

drekbour opened this issue Sep 27, 2021 · 7 comments

Comments

@drekbour
Copy link

I wanted to maven-versions-plugin auto update on the tile.xml ...

mvn -f tile.xml versions:update-properties 

... but find that we cannot do this without adding Maven-mandatory properties ...

    <modelVersion>4.0.0</modelVersion>
    <groupId>boo</groupId>
    <artifactId>yaa</artifactId>
    <version>1.0-SNAPSHOT</version>

... which then need removing because :validate rejects them. As a one-off this is acceptable but I was trying to automate the tiles equivalent of using my.company:internal-bom:pom:LATEST to hold the floating set of last-released <dependencyManagement> across an internal software stack (do tell if there's a more sensible solution here)

Given tiles simply isn't involved in that invocation the only solutions I imagine are:

1 (optionally) make the validation failure into a warning
2 validate a "magic" placeholder GAV used only for such purposes?

(*) this all presumes tiles-only extension syntax is used in tile.xml

@rvowles
Copy link
Member

rvowles commented Sep 27, 2021

Dependency management isn't done in tiles if that is a question? Only plugin management, we typically use composite poms (poms which contain only dependencies, and which are typically grouped by logical subset, e.g. logging, your web stack, your DI stack, etc).

@drekbour
Copy link
Author

Ok. Leaving aside anything relating to dependencyManagement - there's a lot of helpful stuff versions:* can do for us. How can tiles help to apply this when the pertinent content is now in a tile.xml

@talios
Copy link
Member

talios commented Sep 28, 2021

That being said - management of plugins can't AFAIK be handled via the composite model @rvowles uses.

In my own case - we use properties for plugin versions in our tiles, which can be overridden in the consuming project with whatever means you want.

This is the same mechanism used by the kemitix-maven-tiles project ( which uses Github's dependabot ) which you can see an example of here: https://github.com/kemitix/kemitix-maven-tiles/pull/287/commits

@drekbour
Copy link
Author

That's quite the workaround. If I understand, the pom.xml has roughly the same content (- <configuration> etc) as tile.xml just so its <properties> can be worked on by versions:update-properties. The tile then uses resource filtering to pick up those properties from the pom.

Functional but ... 2x everything in a library designed for DRY ...

@rvowles
Copy link
Member

rvowles commented Sep 28, 2021

Yikes. I agree!

@rvowles
Copy link
Member

rvowles commented Sep 28, 2021

In theory the version update mechanism seems a good one, but the time you are operating on is raw. From our perspective it would only make sense if we pre stripped that section from the pom before merging.

@drekbour
Copy link
Author

What about a mojo that merges the tile into itself (likely fairly easy) and then merges changes back into the tile (maybe not so easy)

mvn maven-tiles-plugin:apply-to-self versions:update-properties

Simpler first step might be to limit feedback to only <properties> of the pom.xml (to be used via filtering)

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

3 participants