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

Target platform resolved multiple times #1660

Closed
Bananeweizen opened this issue Nov 13, 2022 · 4 comments · Fixed by #1702
Closed

Target platform resolved multiple times #1660

Bananeweizen opened this issue Nov 13, 2022 · 4 comments · Fixed by #1702
Milestone

Comments

@Bananeweizen
Copy link
Contributor

I've just converted Eclipse-CS from a target platform module to a plain target file reference. Doing that I noticed the target is resolved as many times as modules refer to it. Shouldn't we resolve it only once?
configuration is ${basedir}/../somedir/somefile.target, which resolves to the same absolute path each time. This is 2.7.5, I still have to verify on 3.0.

See first and last line of this snippet:

[INFO] Resolving target definition file:/C:/dev/eclipse-cs/git/eclipse-cs/net.sf.eclipsecs.branding/../net.sf.eclipsecs.target/net.sf.eclipsecs.target.target for environments=[win32/win32/x86_64, linux/gtk/x86_64, macosx/cocoa/x86_64], include source mode=honor, execution environment=StandardEEResolutionHints [executionEnvironment=OSGi profile 'JavaSE-11' { source level: 11, target level: 11}], remote p2 repository options=org.eclipse.tycho.p2.remote.RemoteAgent@2006fdaa...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Resolving dependencies of MavenProject: net.sf.eclipsecs:net.sf.eclipsecs.branding:10.3.3-SNAPSHOT @ C:\dev\eclipse-cs\git\eclipse-cs\net.sf.eclipsecs.branding\pom.xml
[INFO] Resolving target definition file:/C:/dev/eclipse-cs/git/eclipse-cs/net.sf.eclipsecs.checkstyle/../net.sf.eclipsecs.target/net.sf.eclipsecs.target.target for environments=[win32/win32/x86_64, linux/gtk/x86_64, macosx/cocoa/x86_64], include source mode=honor, execution environment=StandardEEResolutionHints [executionEnvironment=OSGi profile 'JavaSE-11' { source level: 11, target level: 11}], remote p2 repository options=org.eclipse.tycho.p2.remote.RemoteAgent@2006fdaa...
...
@laeubi
Copy link
Member

laeubi commented Nov 13, 2022

@Bananeweizen do I get ti correctly that you have different targets that point to the same target file via includes?
Can you provide an integration-test to demonstrate the issue with a minimal setup?

@Bananeweizen
Copy link
Contributor Author

@laeubi Check lines 341, 343, ... in https://app.travis-ci.com/github/checkstyle/eclipse-cs/jobs/588317951#L341. That's always the same .target file being resolved again and again. I can try to convert that into an integration test with 2 modules and 1 target file.

Bananeweizen added a commit to Bananeweizen/tycho that referenced this issue Nov 20, 2022
Bananeweizen added a commit to Bananeweizen/tycho that referenced this issue Nov 20, 2022
@laeubi laeubi mentioned this issue Nov 20, 2022
@HannesWell
Copy link
Member

In case you need a workaround that works for Tycho 2.7.5 you can use the maven.multiModuleProjectDirectory or user.home property as base:

<file>${maven.multiModuleProjectDirectory}/releng/foo/bar.target</file>

But I have to remark that the maven.multiModuleProjectDirectory is not official AFAIK. So it might just vanish in future Maven releases (although I don't know about any plans in that regard). Using user.home has the disadvantage that it corresponds to the working directory and therefore changes if you build from another repo as working dir.

@laeubi
Copy link
Member

laeubi commented Feb 8, 2023

@laeubi laeubi added this to the 4.0 milestone Jun 24, 2023
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

Successfully merging a pull request may close this issue.

3 participants