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

mvn install does not complete using the latest version of Maven 3.8, stalls requesting ctakes module #6

Closed
JohnLevander opened this issue Sep 30, 2021 · 9 comments

Comments

@JohnLevander
Copy link
Collaborator

JohnLevander commented Sep 30, 2021

Maven 3.8 added some extra security to block non-https resource downloads by default. On my Windows machine, this resulted in a never-ending wait for a jar from http://0.0.0.0/ when building the project. This occurs when trying to download a ctakes resource.

Screenshot:
error

I researched some fixes. The solutions are:

  1. Ask user to downgrade to Maven 3.6 (not great)
  2. Ask user to enter some security-reducing settings in the users settings.xml file (really not great)
  3. track down the http (insecure) resources we are requesting and switch them to use https:// (preferred solution)

Regarding the last option, I looked through the poms and didn't find any calls to non-https resources but I will have to look again.

Here is a stack overflow thread on this issue:
https://stackoverflow.com/questions/66980047/maven-build-failure-dependencyresolutionexception

I tested Maven 3.3, 3.6. and 3.8. 3.8 is the release the build breaks.

@seanfinan
Copy link
Contributor

This is not good.
#3 (switch to https) is not an option. We do not control the actual repos for any of the dependencies. I can look into this further, but considering the number of different providers this is really problematic.
#2 (user change settings.xml) is not really great. As soon as you ask users to go edit files they tune out.
#1 is the best option. It is easier for the user than #2 and it is tried and tested by many users over many years.

@tmills
Copy link

tmills commented Sep 30, 2021

what about this option?
https://stackoverflow.com/a/67441519
Essentially creating a custom settings.xml for the project. I assume it uses the settings you provide and backs off to the global settings for anything you leave out, so you could just put in mirrors for the repos without https?

@seanfinan
Copy link
Contributor

That sounds good. Another problem might occur if they have settings in their regular settings.xml that allow tunneling through a firewall or something like that. I have something special in mine. However, I think that chances of that kind of problem are low and we could handle special cases separately - maybe a comment at the bottom of a readme or something with an indication of what we are doing.

@seanfinan
Copy link
Contributor

Ok, some strange stuff:

  1. In the dphe poms we specifically point to https for ctakes:
    https://repository.apache.org/content/groups/snapshots/
  2. Supposedly, Sonatype, the biggest maven central provider, is completely https, not http.
    https://blog.sonatype.com/central-repository-moving-to-https

@seanfinan
Copy link
Contributor

And ... right now I am building with maven 3.8.2 and no errors, http or otherwise.

@JohnLevander
Copy link
Collaborator Author

JohnLevander commented Sep 30, 2021 via email

@seanfinan
Copy link
Contributor

I did clear .m2 of everything under ctakes. It took a long time to grab the jars but it did get them - from the https area.
Did you see it fail or did you just see those warnings? When clean, that mirror will attempt to use http for externals. Why it tries that first is beyond me. However, after that fails it will go through an https and get the poms and jars.

@JohnLevander
Copy link
Collaborator Author

JohnLevander commented Oct 1, 2021 via email

@JohnLevander
Copy link
Collaborator Author

So I let it run all night and the process never finished with v3.8.1., I set MAVEN_HOME back to v3.8.2 and seems like I'm getting the same issue. Versions 3.3 and 3.6 work, strangely, on the same machine. That was all on my Windows machine.

I just verified that 3.8.2 builds just fine on the Mac.

I'm going to close this and reopen it if there is something we need to do or if it's just a "lucky" machine configuration that I stumbled upon.

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

No branches or pull requests

3 participants