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

Fix pom.xml repository url substitution property failure. #613

Open
wants to merge 1 commit into
base: 10.1.x
Choose a base branch
from

Conversation

geniusjoe
Copy link

Problem

I'm new to this project.
When I forked the project to the local computer,my IDEA ide throw an exception about cannot resolve parent project.

shortcut1

Could not transfer artifact io.confluent:kafka-connect-storage-common-parent:pom:10.1.2 from/to confluent (${confluent.maven.repo}): Cannot access ${confluent.maven.repo} with type default using the available connector factories: BasicRepositoryConnectorFactory

My IDEA cannot resolve the parent dependency io.confluent:kafka-connect-storage-common-parent although it can be found on confluent site. Therefore I think it's not caused by SnapShot version.

image

Steps to repreduce

Just simply delete package .m2\repository\io\confluent\kafka-connect-storage-common-parent\10.1.2 from local .m2 dependency cache, git checkout to 10.0.0.6 branch and then reload project.

Solution

An issue about this exception has been mentioned in #331.
According to these StackOverflow thread1 thread2 :

I assume the error happens when parent pom is being downloaded from the repo? That would make sense because to build the whole list of properties you'd need to download the parent and build an Effective POM. So you can't apply properties because parent hasn't been downloaded and you can't download parent because properties haven't been applied. That's my take on why it doesn't work, but I didn't run any experiments to confirm the hypothesis.

Maven will substitude property after parent pom has been parsed, so if parent pom is from remote repo and repo url is not written explicit, maven cannot download it.

Does this solution apply anywhere else?
  • yes
  • no
If yes, where?

Any other version using substitution in pom.xml repository url.

Test Strategy

Testing done:
  • Unit tests
  • Integration tests
  • System tests
  • Manual tests

Release Plan

@geniusjoe geniusjoe requested a review from a team as a code owner April 5, 2022 16:42
@CLAassistant
Copy link

CLAassistant commented Apr 5, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@geniusjoe geniusjoe force-pushed the bugfix/repository_url_resolution branch from 5a8177e to 58ddead Compare April 5, 2022 17:03
@geniusjoe
Copy link
Author

@cjolivier01 @kpatelatwork @kkonstantine
Any advice you could give would be much appreciated.

@orinciog
Copy link

Hi! Your fix also worked for me. Thank you!

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 this pull request may close these issues.

None yet

3 participants