Force fetch location of dependency artifacts for feature projects #5169
Unanswered
alxflam-work
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Instead of using dependency:unpack-dependencies you might try to use tycho-p2-extras:mirror instead what should download all dependencies in a configurable way and is P2 aware. Also you might want to take a look at target-platform-configuration:mirror-target-platform what should also work for feature projects. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm currently upgrading a codebase from tycho
1.7.0
to4.0.13
. I do have a minimal reproducible example for what i'm describing, but first here's the description of what occurred during this migration:We have a feature project, let's call it
docs-feature
for this discussion, which includes some other features and bundles in itsfeature.xml
. The included features / plugins of thisdocs-feature
are not part of the same reactor build like thedocs-feature
, they are resolved using a p2 repository. What we do with thedocs-feature
then is the following:The
maven-dependency-plugin
and itsunpack-dependencies
goal are used to fetch all the asciidoc files from the contents of the feature. Then we can generate some HTML / PDL documentation from these ADOC files. We're doing it like this because we have a bigger application feature, many bundles provide functionality for it and each of the bundle provides an ADOC file with its user documentation. Then every product has adocs-feature
including the bundles relevant for the product and so we can build a single PDF / HTML documentation tailored to the product. So using thedocs-feature
, we can fetch relevant adoc files, process them into a single document, and then distribute it as a root file feature within the product.This worked fine in Tycho
1.7.0
but it's failing with Tycho4.0.13
, as since #745 thefetch
member ofMavenDependencyInjector
is only set totrue
foreclipse-plugin
andeclipse-plugin-test
packaging types - but we do have a feature project.So then we get the exception
Unknown archiver type: No such archiver: 'tmp'
by theunpack-dependencies
goal as tycho has not force fetched the dependencies, hence instead the new "file not yet available.tmp" file is assigned to the artifacts. Andtmp
is not ajar
and cannot be handled, and obviously it would be empty, so there's nothing to handle anyways.I can mitigate the issue when debugging the build by changing
fetch
totrue
.But is there any solution i can apply to force the dependencies to be fetched, even though it is a feature project?
It's not directly possible, as the constructor of
MavenDependencyInjector
does not have any means to adapt the logic which decides whetherfetch
istrue
orfalse
, i was thinking more into a workaround direction whether i could additionally configure some tycho goal to resolve dependencies forcefully?The only workaround i can currently think of is creating and eclipse-plugin project which requires the bundles included in the
docs-feature
and generate the PDF / HTML with this project instead, as its project type will forcefetch
to betrue
.The MRE is this repo: https://github.com/alxflam-work/tycho-fetch-location (Maven 3.9.9, Tycho 4.0.13, Java 17)
See branch
main
and its build error at https://github.com/alxflam-work/tycho-fetch-location/actions/runs/16073946777/job/45364642912 caused by thefile not yet available.tmp
file due tofetch
beingfalse
.On branch
ftrFilterGroupId
, the following was done: Enabled line 61 of the pom.xml, the build works again as then only the groupId of the local reactor build projects are regarded by the unzip, and as these are part of the local reactor build, their location is resolved.In my real environment that's not possible, the features and plugins included in the
docs-feature
are not part of the same reactor build.Beta Was this translation helpful? Give feedback.
All reactions