Getting Stanford Core NLP through Maven - java

I am doing a project on text categorization using Stanford NLP in Java. To get the API, I added the dependencies in my POM file.
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.5.0</version>
<classifier>models</classifier>
</dependency>
When I do maven update/install I am getting the below error message :
Failure to transfer edu.stanford.nlp:stanford-corenlp:jar:models:3.5.0 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact edu.stanford.nlp:stanford-corenlp:jar:models:3.5.0 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000.
I found a similar question here - Maven dependency:get does not download Stanford NLP model files . But, I am unable to find a solution anywhere. Any help please?

Perhaps Maven is in an inconsistent state? Have you tried something like:
mvn clean install -U
The dependencies I use -- which look identical to yours above -- are:
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.5.0</version>
<classifier>models</classifier>
</dependency>

Related

Failure to transfer org.apache.poi:poi:jar:5.2.2

I want to write an Excel file with apache-poi.
If I use the following dependencies:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.15</version>
</dependency>
Everything works fine, but if I try to update to the newest version (5.2.2), I get the following error in my pom.xml:
Failure to transfer org.apache.poi:poi-ooxml:jar:5.2.2 from was cached
in the local repository, resolution will not be reattempted until the
update interval of central has elapsed or updates are forced.
Original error: Could not transfer artifact
org.apache.poi:poi-ooxml:jar:5.2.2 from/to central Error code 500,
Server Error
I hope someone could help me.

POM import failed: io.thorntail:bom-all:pom:2.7.0.Final

I'm following an e-book and I can't go ahead because of the error there in the pom.xml file.
I have this following errors:
Project build error: Non-resolvable import POM: io.thorntail:bom-all:pom:2.7.0.Final failed to transfer from http://repo.mj.gov.br/repository/maven-group/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of nexus has elapsed or updates are forced. Original error: Could not transfer artifact io.thorntail:bom-all:pom:2.7.0.Final from/to nexus (http://repo.mj.gov.br/repository/maven-group/): transfer failed for http://repo.mj.gov.br/repository/maven-group/io/thorntail/bom-all/2.7.0.Final/bom-all-2.7.0.Final.pomJava(0)
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>bom-all</artifactId>
<version>${version.thorntail}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
And this error:
Project build error: ‘dependencies.dependency.version’ for io.thorntail:jaxrs:jar is missing.Java(0)
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>jaxrs</artifactId>
</dependency>
</dependencies>
How do I resolve this? I'm using VsCode Java.
Thanks for any help.
I was without access to the repository. Problem solved.
http://repo.mj.gov.br/repository/maven-group/

maven build failing to download com.lowagie:itext:jar:2.1.7.js6 dependency

Previously my build is running fine but all of a sudden it's failing with the below error.
Failed to collect dependencies at ar.com.fdvs:DynamicJasper:jar:5.3.0 -> net.sf.jasperreports:jasperreports:jar:6.8.0 -> com.lowagie:itext:jar:2.1.7.js6: Failed to read artifact descriptor for com.lowagie:itext:jar:2.1.7.js6: Could not transfer artifact com.lowagie:itext:pom:2.1.7.js6 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [jaspersoft-third-party (http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/, default, releases+snapshots), jr-ce-releases (http://jaspersoft.jfrog.io/jaspersoft/jr-ce-releases, default, releases+snapshots)] -> [Help 1]
[ERROR]
These are the dependencies I am using in my code.
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7.js6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ar.com.fdvs</groupId>
<artifactId>DynamicJasper</artifactId>
<version>5.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/ar.com.fdvs/DynamicJasper-core-fonts -->
<dependency>
<groupId>ar.com.fdvs</groupId>
<artifactId>DynamicJasper-core-fonts</artifactId>
<version>2.0</version>
</dependency>
I tried changing the DynamicJasper version also but no luck.
In the docker file, I am using the below image as a base image.
FROM maven:3.6.0-jdk-11-slim AS build
if you run maven on linux .then use this
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.12.1</version>
<exclusions>
<exclusion>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- "jasperreports" can't resolve "itext" dependency on jenkins.so it added independently-->
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>4.2.0</version>
</dependency>
My issue resolved after adding this dependency.
The modified versions of iText 2.1.7 are available on this public repository:
https://jaspersoft.jfrog.io/ui/native/third-party-ce-artifacts/com/lowagie/itext
Jars are available for downloading.
It looks like there is error in downloading com.lowagie:itext:pom:2.1.7.js6. I think there is a version number change in maven repository. there is not any 2.1.7.js6 version in maven repository.
<!-- https://mvnrepository.com/artifact/com.lowagie/itext -->
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7</version>
</dependency>
for your ref:
https://mvnrepository.com/artifact/com.lowagie/itext/2.1.7
Try to remove this dependency folder from users\.m2 folder and run maven install again. This will remove the old dependency which is causing issues and will download the same dependency again.

Ignore optional reactor-extra maven dependecies when running springboot app in docker

I have a Spring Boot app that i run in a docker container using docker-compose.
I recently added the reactor-extra dependency to my pom.xml and for some reason i can't start the container anymore.
Here's what i added to the pom:
<dependency>
<groupId>io.projectreactor.addons</groupId>
<artifactId>reactor-extra</artifactId>
<version>3.4.2</version>
</dependency>
Now whenever i try to start the container i get this error:
Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline (default-cli) on project backend: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.5.2 in central
The code works fine when i run it directly on intellij and there are apparently no dependency issues.
I took a look here: https://mvnrepository.com/artifact/io.projectreactor.addons/reactor-extra/3.4.2
and it seems that this "4.5.2" version of org.eclipse.swt.gtk.linux.x86_64 does not exist. I assume this works on intellij because this is an optional dependency but the container building process fails when it tries to download that version.
I tried excluding it like so:
<dependency>
<groupId>io.projectreactor.addons</groupId>
<artifactId>reactor-extra</artifactId>
<version>3.4.2</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>
</exclusion>
</exclusions>
</dependency>
But it's still trying to download it and i get the same error which causes the build to fail.
I also tried adding the existing 4.3 version of org.eclipse.swt.gtk.linux.x86_64 to my pom but i still get the same result.
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>
<version>4.3</version>
</dependency>
<dependency>
<groupId>io.projectreactor.addons</groupId>
<artifactId>reactor-extra</artifactId>
<version>3.4.2</version>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>
</exclusion>
</exclusions>
</dependency>
How can i prevent maven from trying to download that dependency?
I fixed it by adding this to my pom:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
</plugin>
Source:
go-offline fails when optional dependencies cannot be resolved
https://issues.apache.org/jira/browse/MDEP-690
"Running org.apache.maven.plugins:maven-dependency-plugin:3.1.1:go-offline against this project passes. With version 3.1.2 the goal fails with:"
org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.5.2 in central (https://repo.maven.apache.org/maven2)

ArtifactDescriptorException while adding dependency mockito 1.10.19 version

While adding the following dependency in pom.xml file, getting ArtifactDescriptorException
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
Issue:
Description Resource Path Location Type
ArtifactDescriptorException: Failed to read artifact descriptor for org.mockito:mockito-all:jar:1.10.19: ArtifactResolutionException: Failure to transfer org.mockito:mockito-all:pom:1.10.19 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.mockito:mockito-all:pom:1.10.19 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org pom.xml /mockito-example line 1 Maven Dependency Problem
However, it is working fine with the 1.10.18 or 1.10.17
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.18</version>
<scope>test</scope>
</dependency>
I don't understand what is the issue with 1.10.19 version.
Any help would be helpful. Thanks!
Sounds like an earlier download attempt failed. As the message says, resolution will not be reattempted until the update interval of central has elapsed or updates are forced - typically the update interval is 24 hours.
If you haven't tried it already, suggest using the force updates option - mvn -U. (If this is in Eclipse, judging by the column titles, look for Force Update in the Maven/Update project dialog).
Just for reference, the same artifact version is downloading fine from over here.

Categories