can't add maven dependency - apache poi - java

I created this maven project in Eclipse on my mac. The following two artifacts are in my pom. No problem on MAC.
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.14</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.14</version>
</dependency>
However when I recently moved the code to Eclipse on my PC I got this weird error "Missing artifact org.apache.poi:poi:jar:3.14". And it points to both the dependency block and the first line of pom (see screenshot) . Updated project many times and it did not help.
I have set up two repositories, one public and one institutional.
<repositories>
<repository>
<id>JBoss repository</id>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>repo</name>
<url>http://risdevtool01p.mdanderson.edu:8081/artifactory/repo</url>
</repository>
</repositories>
When I do "mvn clean install -U", it looks like it is trying to download poi and poi-ooxml from two different repositories.
Downloading:http://repository.jboss.org/nexus/content/groups/public/org/apache/poi/poi-ooxml-schemas/3.14/poi-ooxml-schemas-3.14.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/poi/poi/3.14/poi-3.14.jar
Downloading: http://risdevtool01p.mdanderson.edu:8081/artifactory/repo/org/apache/poi/poi/3.14/poi-3.14.jar
Downloading: http://risdevtool01p.mdanderson.edu:8081/artifactory/repo/org/apache/poi/poi-ooxml-schemas/3.14/poi-ooxml-schemas-3.14.jar

The problem is in the nexus of JBoss, the artifact is not properly deleted indeed we had the version in the list of available versions but the version is not available at the expected location which is http://repository.jboss.org/nexus/content/groups/public/org/apache/poi/poi/3.14/
404 - Path /org/apache/poi/poi/3.14/ not found in group repository "Public Repository Group" [id=public].
Path /org/apache/poi/poi/3.14/ not found in group repository "Public Repository Group" [id=public].
But, obviously they've just removed this version properly indeed now this version is no more part of the available versions as you can see here http://repository.jboss.org/nexus/content/groups/public/org/apache/poi/poi/ such that if you remove it from your local repository and try again with a command of type mvn clean install, it will work

Related

Cannot resolve dropwizard version 2.1.3-SNAPSHOT in maven project pom in Intellij

Using the following dependency entry in my pom:
<dependencies>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
<version>${dropwizard.version}</version>
</dependency>
</dependencies>
Using an older dropwizard version works fine:
<properties>
<dropwizard.version>2.0.9</dropwizard.version>
</properties>
But using the most up to date version as listed on mvnrepository:
<dropwizard.version>2.1.2</dropwizard.version>
gives the following error:
Dependency 'io.dropwizard:dropwizard-core:2.1.2' not found
Additionally, using the recommended version in dropwizard's tutorial page does not work either:
<dropwizard.version>2.1.3-SNAPSHOT</dropwizard.version>
I have the following to pull snapshots in my pom:
<repositories>
<repository>
<id>nexus</id>
<name>nexus-snapshot</name>
<url>http://localhost:8081/repository/maven-snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
Update:
By deleting io/dropwizard from my ~/.m2/repository directory and invalidating caches & restarting, I was able to load dropwizard version 2.1.2. I am still unable to determine how to properly load the SNAPSHOT version. I don't know what repository settings to add to my pom file in order to correctly link to that dependency.

Maven plugin for running JWebAssembly

I can see that JWebAssembly can be built with gradle
https://github.com/i-net-software/JWebAssembly/wiki/Build-with-Gradle
but they also provide examples for adding maven dependencies, so I would expect that there is a maven plugin as well. I can't find it anywhere. How to run JWebAssembly with maven?
This is from the same github wiki(https://github.com/i-net-software/JWebAssembly/wiki/Getting-Started#add-dependency-to-api):
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.i-net-software</groupId>
<artifactId>jwebassembly-api</artifactId>
<version>master-SNAPSHOT</version>
</dependency>

Unable to add IBM db2jcc4 jar file through Maven

I am trying to access DB2 tables in a java project. I am able to access the tables when I manually added the jar files - db2jcc4.jar and db2jcc_license_cisuz.jar. No issues in accessing the tables.
But when I try to add these jar files through Maven, they won't add to the project.
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>db2jcc4</artifactId>
<version>9.7.0.4</version>
</dependency>
Error Message - Missing artifact id.
Also, the latest db2jcc4.jar files (Version 11.1) are not present in Maven repository. Is there any other place I can access it from?
You have to download the right driver from IBM.
http://www-01.ibm.com/support/docview.wss?uid=swg21363866
Then install it to your local maven repository
http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html
As written in maven central repository the artifact is in another repo.
Add it to your pom and it will work.
<repositories>
<repository>
<id>Alfresco</id>
<name>Alfresco</name>
<url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
</repository>
</repositories>
Assuming that , using share drive is the option to go.
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>licences</artifactId>
<version>0.7</version> <!-- Adjust this properly -->
<scope>system</scope>
<systemPath>R:\JDBC drivers\IBM DB2_db2_2.2.0.v20130525_0720\db2jcc_license_cisuz.jar</systemPath>
</dependency>
According to maven central repository the artifact is in another repository. Include these two in your pom.xml and it should work:
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc4</artifactId>
<version>10.1</version>
</dependency>
<repositories>
<repository>
<id>com.ibm.db2.jcc</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
</repository>
</repositories>

Missing artifact error while adding a depentency in pom

Am trying to add a dependency sauce-connect-plugin in to pom.xml file
<groupId>com.saucelabs.maven.plugin</groupId>
<artifactId>sauce-connect-plugin</artifactId>
<version>2.1.18</version>
</dependency>
But building the pom file am getting
Missing artifact com.saucelabs:sauce-connect:jar:3.1.32
Also i mentioned the repository
<repositories>
<repository>
<id>saucelabs-repository</id>
<url>https://repository-saucelabs.forge.cloudbees.com/release</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
in this url http://repository-saucelabs.forge.cloudbees.com/release/com/saucelabs/sauce-connect/3.1.32/
sauce-connect:jar:3.1.32 is present
Then why Missing artifact error is showing??
What wrong with me.
When i directly add following in tho the pom file and added the repository am getting the same error
<dependency>
<groupId>com.saucelabs</groupId>
<artifactId>sauce-connect</artifactId>
<version>3.1.32</version>
</dependency>
You have used mismatched versions:
sauce-connect-plugin presents in:
http://repository-saucelabs.forge.cloudbees.com/release/com/saucelabs/sauce-connect-plugin/
which have only versions of 1.0.11, 1.0.12, 1.0.13 and 1.0.14.
But you have tried to download 2.1.18
What you mentioned with the URL http://repository-saucelabs.forge.cloudbees.com/release/com/saucelabs/sauce-connect/3.1.32/ will not represent for sauce-connect-plugin. It will represent for only sauce-connect
So you should try with following dependency:
<dependency>
<groupId>com.saucelabs.maven.plugin</groupId>
<artifactId>sauce-connect-plugin</artifactId>
<version>1.0.11</version><!-- 1.0.11, 1.0.12, 1.0.13 or 1.0.14 -->
</dependency>
If you need exactly the version of 2.1.18, then you need to upload the artifact in the location http://repository-saucelabs.forge.cloudbees.com and try.
Here you can find someone who is also using this, try to compare your pom https://github.com/saucelabs/sauce-java/blob/master/sauce-connect-plugin/pom.xml

Jongo Maven Dependency causing problems

I am currently trying to use the Jongo project to connect to a remote MongoDB.
To do so, I added these dependencies to my project :
<dependencies>
<dependency>
<groupId>org.jongo</groupId>
<artifactId>jongo</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.6.5</version>
</dependency>
</dependencies>
I already had some troubles with the first dependency (jongo:1.0), since maven could not retreive this version (the latest maven knew was 0.4) : Intellij tells me Dependency "org.jongo:jongo:1.0" not found. Yet, the dependency can be found there
I managed to get it via Project Structure -> Librairies
The problem is that this dependency is now local, and anyone who clones this project must import this dependency manually, which is not suitable.
I am using Intellij IDEA 13.0
First, the Sonatype dependency version in the snapshots repository you had linked in your post is 1.1-SNAPSHOT and not 1.0.
It's not recommended to use 3rd party snapshots in your build
If however you insist, you need to add Sonatype snapshots repository to your maven build as follows:
<repository>
<id>sonatype-snapshots</id>
<name>sonatype-snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
EDIT
The 1.0 version resides in Sonatype releases repository:
<repository>
<id>sonatype-releases</id>
<name>sonatype-releases</name>
<url>https://oss.sonatype.org/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
Jongo 1.0 is in maven central. There is no need for extra repository configuration in your pom.

Categories