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

Fixed: javax.ws.rs-api dependency download issue by excluding it as a… #249

Closed

Conversation

girishvasmatkar
Copy link
Contributor

Fixed:(OFBIZ-)

Explanation

The problem stems from an invalid POM for the artifact javax.ws.rs-api with version 2.1.1. javax.ws.rs-api gets somehow included as a transitive dependency by tika-parsers:1.20 and javax.ws.rs-api:2.1.1 has an invalid POM definition for the packaging.
I checked file https://repo1.maven.org/maven2/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.pom and this is what I see -
${packaging.type}

So gradle tries to actually go to https://jcenter.bintray.com/javax/ws/rs/javax.ws.rs-api/2.1.1/javax.ws.rs-api-2.1.1.$%7Bpackaging.type%7D instead of 
https://jcenter.bintray.com/javax/ws/rs/javax.ws.rs-api/2.1.1/javax.ws.rs-api-2.1.1.jar which is a valid URL and JAR does exist.

So the first issue is that the POM file is messed up and it is actually an issue with other versions as well of the artifact javax.ws.rs-api. 
There are two fixes as suggested here - gradle/gradle#3065

  1. Exclude javax.ws.rs-api from tika-parsers:1.20 and add it's dependency explicitly using @jar to indicate the packaging type. We will go back to tika-parsers:1.20 because the later version is creating dependency hell problems as pointed out by Jacopo.compile 'org.apache.tika:tika-core:1.20'
    compile('org.apache.tika:tika-parsers:1.20') {
    exclude group: 'javax.ws.rs'
    }compile "javax.ws.rs:javax.ws.rs-api:2.1.1@jar" // @jar will make sure packaging 'jar' is used to resolve the URLI have tested the above fix and it is working properly. No 404 issue while the solr test is running too.
  2. Upgrade Gradle version to 4.5 (see the explanation at https://github.com/gradle/gradle/issues/3065).     I have tested upgrading to 4.5 while being on commit 2d15771d56ab1637efa5685799f86a7bb118cee4. I think Gradle upgrade will be a big upgrade for the release and would probably require proper testing. I am personally not for Gradle upgrade.

Thanks:
Girish

… transitive dependency and then explicitly downloading as a jar packaging
@sonarcloud
Copy link

sonarcloud bot commented Jan 4, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@@ -139,8 +139,11 @@ dependencies {
compile 'org.apache.httpcomponents:httpclient-cache:4.5.4'
compile 'org.apache.logging.log4j:log4j-api:2.10.0' // the API of log4j 2
compile 'org.apache.shiro:shiro-core:1.4.0'
compile 'org.apache.tika:tika-core:1.24.1'
compile 'org.apache.tika:tika-parsers:1.24.1'
compile 'org.apache.tika:tika-core:1.20'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Girish,
We need to update tika-core to 1.24.1
https://issues.apache.org/jira/browse/OFBIZ-12080

@martnaum
Copy link

martnaum commented Jan 8, 2021

Hi Girish,

switching to tika-core:1.24.1 and tika-parsers:1.24.1 fixed the problem for us. 1.25 also seems to work but we'll stick to 1.24.1 first after @dixitdeepak 's comment. There's no need to exclude javax.ws.rs in both cases.

@girishvasmatkar
Copy link
Contributor Author

Hi @martnaum, @dixitdeepak : Yes, I noticed there was a security vulnerability for lower tika version so it made sense to update it and hence solr/lucene had to be updated to so that makes sense.

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