Maven dependency for org.apache.poi.hssf.usermodel.contrib.HSSFRegionUtil - maven

I am converting an existing ant build project to maven. The project uses the POI-2.5-FINAL and JXL jar files for writing data to excel. Although I have added the POI jar in the pom.XML dependencies, running maven build is failing due to the following compilation error :
error: package org.apache.poi.hssf.usermodel.contrib does not exist!
Note that all other classes from org.Apache.poi.hssf.usermodel such as HSSFWorkbook, HSSFSheet are not giving any error.
Also the code runs successfully in ant build.
Please let me know how I can solve this error.
Thanks.

If you want to stick to 2.5, try adding below dependency:
<dependency>
<groupId>poi</groupId>
<artifactId>poi-contrib-2.5-final</artifactId>
<version>20040302</version>
</dependency>

Related

maven unable to resolve dependencies when using version ranges

I am using maven 3.x.x and trying to use versions ranges in my pom.xml and it never worked. I tried version-ordering suggested by maven and getting the order as expected on my terminal. But when running maven compile, always getting error as below
Failed to execute goal on project test-client: Could not resolve dependencies for project com.abc.def:test-client:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at development.com.abc.test:my-service:jar:jar:[1.0.211006-mr424,1.0.211014-mr427]: No versions available for development.com.abc.test:my-service:jar:jar:[1.0.211006-mr424,1.0.211014-mr427] within specified range -> [Help 1]
But if I use the fixed version in my pom.xml, things start working.
my pom.xml:
<dependency>
<groupId>development.com.abc.test</groupId>
<artifactId>my-service</artifactId>
<version>[1.0.211006-mr424, 1.0.211014-mr427]</version>
<classifier>jar</classifier>
</dependency>
PS : the artifact uploaded for my-service does not contain maven-metadata.xml in the repository.
The end goal I am trying to achieve is to resolve dynamic dependencies

How to use a jar file as a library in a maven project

So I have a library which I want to use, and I have it inside of a folder called "lib",
I'm working in maven so I put this in my pom.xml
<dependency>
<groupId>org.worldborder</groupId>
<artifactId>worldborder</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}/src/lib/WorldBorder.jar</systemPath>
</dependency>
Doing this allows me to write code which uses said library, but when I build the jar it gives me a no class def found error when using, when I use mvn clean install, I do get a warning when I build,
Some problems were encountered while building the effective model for me.acidviper:ViperUHC:jar:1.0-SNAPSHOT
'dependencies.dependency.systemPath' for org.worldborder:worldborder:jar should not point at files within the project directory, ${basedir}/src/lib/WorldBorder.jar will be unresolvable by dependent projects # line 85, column 25
It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.
I'm a complete noob when it comes to maven, so I don't understand how to fix this error. Any help is appreciated. Thanks!
Hi I faced the same issue. To solve that I installed that jar directly into my local .m2 repository.
mvn install:install-file
-Dfile=/path/to/jar
-DgroupId=org.worldborder
-DartifactId=worldborder
-Dversion=1.0.0
-Dpackaging=jar
then if you are using spring boot you can use plugin like spring-boot-maven-plugin. It creates a complete jar for your application with all of it's dependencies

Could not resolve dependencies for project spmf ca.pfv pom.xml

I am working on open source maven project that use several mining dependencies.
after write this command into component mvn clean install I got ERROR in pom.xml file,enter code here that version of spmf is wrong.
<groupId>ca.pfv</groupId>
<artifactId>spmf</artifactId>
<version>2.33</version> // !!!
full error:
omponents-spmanalysis: Could not resolve dependencies for project
info.collide:components-spmanalysis:jar:2.0.0-SNAPSHOT: Failure to
find ca.pfv:spmf:jar:2.33
I tried to use different versions but same error at maven install.

Running soapui from JUnit

I'm getting an error - package com.eviware.soapui.tools does not exist, when I try to run my junit test from intellij using a maven command such as "mvn clean verify -Dwebdriver.driver=chrome -Dtags="API" -Dproperties=test.properties"
I'm using intellij and added the the soapui-5.2.1.jar file as a dependency to the project (File->Project Preferences->Modules->Add jar). The code to run is pretty straight forward:
SoapUITestCaseRunner runner = new SoapUITestCaseRunner();
runner.setProjectFile(RESOURCE_FOLDER + "periodictable-
soapui-project.xml");
runner.run();
Do I need to add any dependencies to the pom file to get it to run? At this stage all I have done is the above steps to add the jar and used the import below:
import com.eviware.soapui.tools.SoapUITestCaseRunner;
Thanks.
The import and code itself looks fine but try adding the below dependency to your POM file.
<dependency>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui</artifactId>
<version>X.X.X</version>
<scope>test</scope>
</dependency>
This dependency would download the SOAPUI jar(version of your choice, for me it works with v5.2.1) and allow you to execute the test suites inside your test project XML.
The official documentation says:
Copy all the jar files from the lib folder for SoapUI Pro Installation folder in class file path. Copy the soapui-pro-5.0.0.jar (or corresponding version) from the bin folder in SoapUI Pro intallation [sic] directory.
For the open-source version, the same instructions apply, you just copy the non-Pro resources.
If you already added the soapui-5.2.1.jar as a dependency to your project, you should be able to check that it was brought in with all of its dependencies correctly.

Not able to import Quartz Monitor plugin in Grails 2.4.3

I have installed quartz plugin for my grails project and have created Job.
BuildConfig.groovy
plugin {
compile ":quartz:1.0.2"
}
now i want to have the following plugin to monitor the jobs i have created.
https://grails.org/plugin/quartz-monitor
For installing this plugin it says
Add a dependency in BuildConfig.groovy:
compile ':quartz-monitor:<plugin version>'
I have added
compile ':quartz-monitor:1.1'
But it is giving Error as:
There was an error loading the BuildConfig: Bad artifact coordinates :quartz-monitor:1.1, expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
after Digging deep i come to know the plugin repo of grails
http://repo.grails.org/grails/plugins/org/grails/plugins/quartz-monitor/
where it has a pom file for this plugin as quartz-monitor-1.1.pom
<modelVersion>4.0.0</modelVersion>
<groupId>org.grails.plugins</groupId>
<artifactId>quartz-monitor</artifactId>
<packaging>zip</packaging>
<version>1.1</version>
......
So, i made changes as adding the groupId from here to my BuildConfig.groovy
now dependencies look like
compile 'org.grails.plugins:quartz-monitor:1.1'
But now i am getting error as
Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:quartz-monitor:jar:1.1 in grailsCentral (http://repo.grails.org/grails/plugins)
how can i install this plugin.
You need to install the latest version:
compile ":quartz-monitor:1.0"
The version 1.1 of quartz-monitor does not exist today (2/Nov/2015). If you open the Grails Plugin Manager, you will see the plugin in the list, if you expand it, you will see all the versions sorted by last to first, and the last is 1.0

Resources