tycho icon indicating copy to clipboard operation
tycho copied to clipboard

Reproducer for generate-sources issue

Open lppedd opened this issue 2 years ago • 11 comments

Command from root project directory: mvn clean generate-sources (do not install before)

Expected issue output:

[INFO] Reactor Summary for repro-parent 1.0.0-SNAPSHOT:
[INFO]
[INFO] repro-parent ....................................... SUCCESS [  0.059 s]
[INFO] a .................................................. SUCCESS [  3.354 s]
[INFO] b .................................................. FAILURE [  0.005 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  58.727 s
[INFO] Finished at: 2022-09-22T11:20:47+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project b: Could not resolve dependencies for project com.lppedd.tycho.repro:b:eclipse-plugin:1.0.0-SNAPSHOT: Could not find artifact com.lppedd.tycho.repro:a:jar:1.0.0-SNAPSHOT -> [Help 1]    
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :b

This is a follow up for this comment.

lppedd avatar Sep 22 '22 09:09 lppedd

Btw @laeubi this seems to be independent of any plugin. You can remove gmaven and it will error out anyway.

lppedd avatar Sep 22 '22 17:09 lppedd

@lppedd can you check the ECA problem? Please make sure to push your commit with the email you used to sign the ECA!

laeubi avatar Oct 04 '22 09:10 laeubi

@laeubi I will, in the meantime I'm using a Maven extension to forcefully resolve dependencies. See https://stackoverflow.com/questions/73840829/maven-extension-to-forcibly-resolve-a-dependency-how-dangerous-is-it Maybe that's the only way?

lppedd avatar Oct 04 '22 10:10 lppedd

So this is more a generic maven problem than a Tycho one?

laeubi avatar Oct 04 '22 10:10 laeubi

@lppedd you probably want to push forward the following tickets at maven what most probably would allow to resolve this maven issue: https://issues.apache.org/jira/browse/MNG-7538 because that would allow to tell maven that there is something but the final name is (not yet) known.

laeubi avatar Oct 04 '22 10:10 laeubi

Test Results

358 files  358 suites   2h 0m 16s :stopwatch: 328 tests 317 :heavy_check_mark:   9 :zzz: 0 :x: 2 :fire: 656 runs  634 :heavy_check_mark: 19 :zzz: 0 :x: 3 :fire:

For more details on these errors, see this check.

Results for commit e0363922.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Oct 04 '22 10:10 github-actions[bot]

@laeubi yes, I think this is a Maven core issue. Probably we can discard this PR, but if you find 5 free minutes just test the reproducer yourself, you'll notice this is a pretty important issue (at least that's my thought). The issue you linked seems related but I read

that is used while resolving an Artifact against a remote repository

In the reproducer the failure is not related to a remote artifact, but to a local one only.

lppedd avatar Oct 04 '22 10:10 lppedd

In the reproducer the failure is not related to a remote artifact, but to a local one only.

Yeah its a bit unspecific, actually, as you have noted, when maven tries to resolves an artifact it do so by asking the WSR, if that can't give the file it asks the remote (that probably download the file then), but in both cases (either download or not (yet) generated local item) it would simply help to say: Hey I know here is something, and if you need it I can try to gather it then.

Probably we can discard this PR

If you like, we can @Ignore the testcase and give in the documentation the links to maven issue that need to be addressed so we can enable it once the maven issues are fixed (I think WSR also needs a new method that returns a Supplier<File>) we can check with Tycho again...

laeubi avatar Oct 04 '22 11:10 laeubi

@lppedd just noted Tycho already contains some hacks in that area:

https://github.com/eclipse-tycho/tycho/blob/0f790c7c2498f6de0344d5ad1f7c0cc685c2ef2f/tycho-core/src/main/java/org/eclipse/tycho/core/maven/MavenDependencyInjector.java#L398

laeubi avatar Oct 05 '22 07:10 laeubi

@laeubi

If you like, we can @Ignore the testcase

Will make this change ASAP, and check the legal stuff (it's strange, I remember submitting it through the Eclipse site).

just noted Tycho already contains some hacks in that area

How does that trick compare to the WSR one?

lppedd avatar Oct 05 '22 08:10 lppedd

It creates a temp file to trick maven that it things the artifact is resolved...

laeubi avatar Oct 05 '22 08:10 laeubi

This one can be closed as you pushed it alongside #2035

lppedd avatar Feb 05 '23 23:02 lppedd