Comments (5)
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.
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.
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.
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.
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)
- Confusing warning or wrong use of system JDK in the compiler plugin?
- set-version fails to update MANIFEST.MF if CI-firendly versions are in use
- Improve output for missing requirements on dependencies
- Building fails because of `Inconsistent reactor project` HOT 2
- Broken links in the Eclipse/Github wiki HOT 1
- Unconsidered linked .classpath files and test source folders HOT 1
- [tycho-version-plugin] Since 4.0.5 non-matching version of child modules are forcefully overwritten HOT 3
- forceContextQualifier has been broken since Tycho 4.0.5
- sort order of root nodes in dependency-tree is unstable HOT 1
- Linked .classpath files: linked classpath entries paths not resolve against project base directory
- Parsing custom variables in linked project resources HOT 2
- [DS] Validation of transitive generated 'osgi.extender=osgi.component' requirement fails HOT 11
- support reuseFork option in tycho-surefire-plugin
- Unable to build eclipse application repository or site with patch features HOT 3
- The application packaged by Tycho can't start on MacOS 14.4 HOT 1
- Missing p2 dependencies in maven dependency:tree output HOT 1
- Goal `publish-features-and-bundles` inherits metadata available in reactor HOT 3
- Not possible to remove qualifier for release build from bundles/features and product when using CI friendly versions HOT 1
- Strange error with Tycho 4.0.8 HOT 3
- [sbom] BOM is calculated multiple times for the same unit HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tycho.