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

Failed to resolve dependencies with Tycho 2.7.0 for custom repositories #697

Closed
vogella opened this issue Feb 28, 2022 · 12 comments
Closed
Milestone

Comments

@vogella
Copy link
Contributor

vogella commented Feb 28, 2022

With Tycho 2.7.0 we see errors for resolving artifacts from internal Nexus servers.

[ERROR] Failed to execute goal on project a: Could not resolve dependencies for project a: Could not find artifact b:4.20.1 in central (https://repo.maven.apache.org/maven2) -> [Help 1]

It should go to the configured URL.

<repositories>
			<repository>
				<id>nexus</id>
				<url>https://nexus.client.de/repository/secure-public</url>
			</repository>
		</repositories>

@HannesWell IIRC you implemented this. Does it still work for you with Tycho 2.7.0?

@laeubi
Copy link
Member

laeubi commented Feb 28, 2022

I think you should provide a bit more context here:

  • Is this a snippet from a target, a pom or a settings.xml?
  • are there any additional errors/warning in the log
  • ...

@vogella
Copy link
Contributor Author

vogella commented Feb 28, 2022

Is this a snippet from a target, a pom or a settings.xml?

Target.

are there any additional errors/warning in the log

No.

We reverted this build to Tycho 2.6.0 and had to delete the content of .mvn/repository after going back to 2.6.0.
Unfortunately I'm not aware of other open Nexus server which I could use to build a standalone example which does not require internal network access. Is there any?

@laeubi
Copy link
Member

laeubi commented Feb 28, 2022

You should at least enable advanced debugging with -X to get some better understanding.
If you think it is a general problem, and not a nexus specific you could use any artifact not available at maven central (e.g. a snapshot from the eclipse-maven-repo).

Last but not least, I can only encourage everyone try out the current tycho snapshot build as often as possible to discover such problems early, at least when we announce new releases.

@vogella
Copy link
Contributor Author

vogella commented Feb 28, 2022

~/git/tycho/tycho-its/projects/target.mavenMulti seems to contains a IT test but does currently not work as it pointsto 2.5.0-SNAPSHOT

But if I change it to 2.7.0 it still works, looks to me that is downloads part from Maven central and parts from the other repo.

[WARNING] No explicit target runtime environment configuration. Build is platform dependent.
[DEBUG] [main] Computing preliminary target platform for MavenProject: org.eclipse.tycho.itests:test.bundle:0.0.1-SNAPSHOT @ C:\Users\vogella\git\tycho\tycho-its\projects\target.mavenRepos\test.bundle\pom.xml
[DEBUG] Using execution environment 'JavaSE-17' configured in Currently running profile, newer than configured profile (JavaSE-11) from [Bundle-RequiredExecutionEnvironment (unique entry)]
[DEBUG] Currently running JRE matches source level for JavaSE-17; current JRE system packages are used.
[DEBUG] Adding target definition file "file:/C:/Users/vogella/git/tycho/tycho-its/projects/target.mavenRepos/test.bundle/../test.target"
[INFO] Resolving target definition file:/C:/Users/vogella/git/tycho/tycho-its/projects/target.mavenRepos/test.bundle/../test.target for environments=[win32/win32/x86_64], include source mode=honor, execution environment=StandardEEResolutionHints [executionEnvironment=OSGi profile 'JavaSE-17' { source level: 17, target level: 17}], remote p2 repository options=org.eclipse.tycho.p2.remote.RemoteAgent@66d2885c...
[INFO] Resolving MavenDependencyRoots = [GroupId = edu.ucar, ArtifactId = cdm, Version = 5.0.0, ArtifactType = jar, IncludeDependencyScope = ], IncludeDependencyScope = [compile], MissingManifestStrategy = GENERATE, IncludeSource = true...
[DEBUG] Resolve edu.ucar:cdm:jar:5.0.0...
[DEBUG] Resolving artifact edu.ucar:cdm:jar:5.0.0 from [central (https://repo.maven.apache.org/maven2, default, releases), unidata-all (https://artifacts.unidata.ucar.edu/repository/unidata-all/, default, releases+snapshots)]
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.maven.apache.org/maven2
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
Downloading from central: https://repo.maven.apache.org/maven2/edu/ucar/cdm/5.0.0/cdm-5.0.0.jar
[DEBUG] Writing tracking file C:\Users\vogella\.m2\repository\edu\ucar\cdm\5.0.0\cdm-5.0.0.jar.lastUpdated
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifacts.unidata.ucar.edu/repository/unidata-all/
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifacts.unidata.ucar.edu/repository/unidata-all/
Downloading from unidata-all: https://artifacts.unidata.ucar.edu/repository/unidata-all/edu/ucar/cdm/5.0.0/cdm-5.0.0.jar

Do we also have an example in which the lib is not available on Maven central?

Another question, what is the policy of the tycho version for the IT projects? Update on demand to the latest Tycho version?

@laeubi
Copy link
Member

laeubi commented Feb 28, 2022

but does currently not work as it pointsto 2.5.0-SNAPSHOT

You can run any IT with any version of tycho specifying -Dtycho-version=<...>

looks to me that is downloads part from Maven central and parts from the other repo.

That's how it is supposed to work

Do we also have an example in which the lib is not available on Maven central?

'Downloading from unidata-all' in your output indicates that it is not available from central.

Another question, what is the policy of the tycho version for the IT projects? Update on demand to the latest Tycho version?

I generally update them whenever I touch the test to use a new feature. They get always injected the version of the current build if run inside the CI with a system option (see above.)

@laeubi
Copy link
Member

laeubi commented Mar 8, 2022

@vogella any updates here?

@laeubi
Copy link
Member

laeubi commented Mar 30, 2022

@vogella we are preparing a 2.7.1 bugfix release, so if you think there is an issue please let us know so this might be included.

@vogella
Copy link
Contributor Author

vogella commented Mar 30, 2022

Sorry, cannot replicate anymore, as I do not have access anymore to an inhouse Maven repo. Closing

@vogella vogella closed this as completed Mar 30, 2022
@ghost
Copy link

ghost commented Apr 1, 2022

I'd like to reopen this issue, as I've recently run into the same problem in our product, after testing out the 2.7.1 snapshot (after migrating from 2.6.0).

[ERROR] Failed to execute goal on project example: Could not resolve dependencies for project example.group:example:eclipse-plugin:2.1.1-SNAPSHOT: lib.group:lib.artifact:jar:7.40.0 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

The plugin is contributed via the target platform definition and download at the beginning of the reactor build:

[INFO] Resolving MavenDependencyRoots = [GroupId = lib.group, ArtifactId = lib.artifact, Version = 7.40.0, ArtifactType = jar, IncludeDependencyScope = ], IncludeDependencyScope = [compile], MissingManifestStrategy = GENERATE, IncludeSource = true...
Downloading from central: https://repo.maven.apache.org/maven2/lib/group/lib.artifact/7.40.0/artifact-7.40.0.jar
Downloading from nexus-3pps: https://<internal nexus>/lib/group/lib.artifact/7.40.0/artifact-7.40.0.jar
Downloaded from nexus-3pps: https://<internal nexus>/lib/group/lib.artifact/7.40.0/artifact-7.40.0.jar (631 kB at 1.2 MB/s)
Downloading from central: https://repo.maven.apache.org/maven2/lib/group/lib.artifact/7.40.0/artifact-7.40.0-sources.jar

When building the plugin, it then tries to fetch the pom from Maven Central only:

Downloading from central: https://repo.maven.apache.org/maven2/lib/group/lib.artifact/7.40.0/artifact-7.40.0.pom
[WARNING] The POM for lib.group:lib.artifact:jar:7.40.0 is missing, no dependency information available

Weirdly enough, the issue only appeared after building a release version of the dependent plugin (i.e. building the project with version 7.40.0-SNAPSHOT works).

Building the dependency locally (via mvn install) also causes the project to work with both 7.40.0 and 7.40.0-SNAPSHOT.

I'll have a look today whether I can come up with a working example that doesn't rely on our internal repository.

@laeubi laeubi reopened this Apr 1, 2022
@laeubi laeubi added this to the 3.0 milestone Apr 5, 2022
@laeubi
Copy link
Member

laeubi commented Apr 5, 2022

The current workaround is to add the repositories mentioned in the target also to the pom of the maven build. I think we need to rethink and possibly fix this in 3.0.0 with #585 for 2.7.x I don't see an easy solution for this.

laeubi added a commit to laeubi/tycho that referenced this issue Apr 6, 2022
@laeubi laeubi closed this as completed in 9cfc954 Apr 7, 2022
@laeubi
Copy link
Member

laeubi commented Apr 7, 2022

@vogella @pzi-dsa this should soon apear in the snapshot so please verify if it solves the issue now.

laeubi added a commit that referenced this issue Apr 7, 2022
Fix #697 - Failed to resolve dependencies with Tycho 2.7.0 for custom
repositories

Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
Co-authored-by: Patrick Ziegler <Patrick.Ziegler@dsa.de>
@laeubi laeubi modified the milestones: 3.0, 2.7.1 Apr 7, 2022
@ghost
Copy link

ghost commented Apr 8, 2022

I ran our build with the latest snapshot and the problem doesn't show up anymore.
Thank you for looking into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants