Giter Club home page Giter Club logo

Comments (5)

mickaelistria avatar mickaelistria commented on June 6, 2024

I imagine that we could instead let the tycho version force a qualifier. Instead of failing with Maven version is x.y.z.123456 and version in MANIFEST.MF is x.y.z.qualifier, the validate version could instead set forceQualifier=123456. In most cases, that would work, in other cases where there are inconsistencies, further steps such as packaging-plugin baseline replacement or compare-with-baseline would fail.

from tycho.

mickaelistria avatar mickaelistria commented on June 6, 2024

As we're brainstorming in many other discussions about better integrating with plain Maven, I'm wondering whether Tycho can better leverage this "CI-friendly" versions in place of the qualifier/-SNAPSHOT.
Mainly, I'm wondering: can the revision or sha1 or whatever variable allowed in <version> be set in project intiialization? More concretely, would it be possible for Tycho to dynamically set eg. sha1 according to the current module last change date in git history? Could the step is usually run to set the qualifier property be run early enough to set the sha1 property and have this expanded in the Maven version?

from tycho.

laeubi avatar laeubi commented on June 6, 2024

Why not? The jgit timestamp provider already do some stuff to compute the qualifier. But if I understand correctly it is assumed that the version is set by the CI server or commandline or ... already and the only real change is that one could use these magic properties inside version string.

I think the main problem is that version in manifest = version in pom constraint. I could imagine that we simply make it that instead of fail the build add an option to replace the version in the manifest with the version from the maven model. This of course would require a user to not use hard versions in feature/manifest but version ranges but I think this is acceptable (one should version packages not bundles).

from tycho.

mickaelistria avatar mickaelistria commented on June 6, 2024

Why not?

I'm not certain, but I have the impression that those specific properties in version need to be resolved very early in the lifecycle; ie in model build, before any plugin is executed. So before we have a hook where to add the jgit-timestamp-provider. Or maybe we can hook some extra execution before model build using the extension...?

I think the main problem is that version in manifest = version in pom constraint

It wouldn't hurt to have an option (opt-in) in the https://www.eclipse.org/tycho/sitedocs/tycho-packaging-plugin/validate-version-mojo.html that would allow 1.0.0 in MANIFEST.MF to be an acceptable match for 1.0.0-SNAPSHOT in pom files. It should remain an opt-in because the behavior of generating multiple artifacts with same qualified version and different content is a strong anti-pattern, and the qualifier is used to avoid that; and Tycho should encourage best approaches by default.

that instead of fail the build add an option to replace the version in the manifest with the version from the maven model?

Note that usually, there is no qualifier segment in the Maven model version. So there is usually not enough for Maven to "drive" a qualifier. However, in case one uses 4-segments versions in the Maven model, it could indeed be an option to the https://www.eclipse.org/tycho/sitedocs/tycho-packaging-plugin/build-qualifier-mojo.html to deduce qualifier from Maven 4th-segment if available.

from tycho.

laeubi avatar laeubi commented on June 6, 2024

Tycho now support CI-Friendly versions see: https://github.com/eclipse/tycho/blob/master/RELEASE_NOTES.md#enhanced-support-for-maven-ci-friendly-versions
Please open specific issues if you still see problems.

from tycho.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.