How to update or replace dependencies from other library in Maven probject? - maven

My project is using another library commons-collection, which I have no control of. I run the command:
mvn dependency:tree -Dverbose -Dincludes=commons-collections
Verbose not supported since maven-dependency-plugin 3.0
[INFO] com.jde.jnlu:jnlu-qe-web:war:1.0.0-SNAPSHOT
[INFO] \- com.jde.jimi3.data:jd-jimi3-data-sdk:jar:3.0-SNAPSHOT:compile
[INFO] \- com.jde.jmq:jmq-client-spring:jar:2.1.2:compile
[INFO] \- com.jde.jmq:jmq-client-core:jar:2.1.2:compile
[INFO] \- com.jde.jmq:jmq-client-json:jar:1.2.9:compile
[INFO] \- commons-beanutils:commons-beanutils:jar:1.9.2:compile
[INFO] \- commons-collections:commons-
collections:jar:3.2.1:compile
As it can been seen, the "commons-collections" is introduced by jd-jimi3-data-sdk which I can't update. But I was reminded of the current version of "commons-collection" has a potential security issue and needs to be upgraded. How can I achieve that in my project?

In your project, if you declare an explicit dependency on the version of commons-collection that you want, Maven will use that instead. See Maven documentation: Resolving conflicts using the dependency tree.
If you want to be really sure, you can also (in addition to the above) exclude commons-collection from your jd-jimi3-data-sdk dependency. Something like:
<project>
...
<dependencies>
<dependency>
<groupId>com.jde.jimi3.data</groupId>
<artifactId>jd-jimi3-data-sdk</artifactId>
<version>3.0-SNAPSHOT</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
This is also covered in the Maven documentation: Dependency Exclusions.
Warning: Since the library you are using - jd-jimi3-data-sdk - was not written with this version of commons-collections, and allegedly not tested with it, this may break you project!

Related

Using maven quarkus:dev target, why would I get an unresolved dep on com.fasterxml.jackson.annotation

A colleague posted a quarkus project to our internal git. When I cloned the repo, and did 'mvn compile quarkus:dev', I get:
$ mvn compile quarkus:dev
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< com.fnorb.api:rest-cloudpoc >------------------
[INFO] Building rest-cloudpoc 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # rest-cloudpoc ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # rest-cloudpoc ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 30 source files to C:\Bitbucket\INT\java-rest-cloudpoc\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Bitbucket/INT/java-rest-cloudpoc/src/main/java/com/fnorb/api/rest/cloudpoc/beans/DeriveTemplate.java:[4,40] package com.fasterxml.jackson.annotation does not exist
The "fasterxml.jackson.annotation" line is repeated N times, capped at 100.
There are also instances of
[ERROR] /C:/Bitbucket/INT/java-rest-cloudpoc/src/main/java/com/fnorb/api/rest/cloudpoc/beans/ObjectType.java:[18,2] cannot find symbol
symbol: class JsonInclude
The dep tree shows:
[INFO] +- io.quarkus:quarkus-resteasy:jar:1.4.2.Final:compile
[INFO] | +- io.quarkus:quarkus-vertx-http:jar:1.4.2.Final:compile
....
[INFO] | | +- io.quarkus:quarkus-vertx-core:jar:1.4.2.Final:compile
[INFO] | | | +- io.quarkus:quarkus-netty:jar:1.4.2.Final:compile
....
[INFO] | | | \- io.vertx:vertx-core:jar:3.8.5:compile
....
[INFO] | | | \- com.fasterxml.jackson.core:jackson-core:jar:2.10.3:compile
Is this just a misconfiguration of my host systems? Tried on Win10 and Ubuntu 18.04 headless (Linux subsystem for Windows) and Ubuntu 18.04.4 LTS native.
Technology evidenced above (ie, like 'beans') of which I have added no commentary, assume I have no knowledge of that particular technology. If you think this is related to the problem -- great! but will need hand-holding if you need me to do something with them. Don't just say "huh beans. You need to frog blast the vent core, the reticulator dependency hasn't been frinosticated yet" because I will just nod, rub my chin, shrug and try very hard not to tsk you. Thanky.
Please tell me I missed a step someplace!
Edit 1: Request for POM dependencies
<version>0.1</version>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus-plugin.version>1.4.2.Final</quarkus-plugin.version>
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>1.4.2.Final</quarkus.platform.version>
<surefire-plugin.version>2.22.1</surefire-plugin.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
And request for imports in the imports from one of the relevant files:
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
No, no, your hosts are not misconfigured. Maven projects normally work out-of-the-box if they themselves are set up right.
First of all, the com.fasterxml.jackson.annotation package is not in the jackson-core dependency but instead in the jackson-annotations package.
If you're using Quarkus, you'll get the jackson-annotations dependency indirectly if you're using for example quarkus-smallrye-openapi. But to me it seems like the class DeriveTemplate in your project imports something from com.fasterxml.jackson.annotation, so the jackson-annotations should be declared as dependency directly in your pom.xml.
If this doesn't help you, you should post your pom.xml as well as the imports section of DeriveTemplate here.
Hope, I didn't vent the frog capacitor too much ;-)
Most likely, the missing dependency will look like:
<dependency>
<groupId>com.fasterxml</groupId>
<artifactId>jackson-annotations<artifactId>
<version>${your-desired-jackson-version}</version>
</dependency>

Maven scope - provided, but spring-boot-starter-webflux dependencies included in compiled jar. Why?

I want to build jar file library and not include dependencies, as they will be in class path of application which will use this library. I use maven scope - provided for that and all dependencies are excluded but few still left. I found they come from spring-boot-starter-webflux. Why it this? And what should I do to get rid of them?
Here the dependency example
<dependencies>
<!-- Nevertheless provided scope some jars from this dependency
are in compiled jar file. Why ? -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
Sample project with just this one dependency is on https://github.com/pavelmorozov/MavenProvidedTest/blob/master/pom.xml
Empty compiled project jar have 5+ megabytes size.
Update After JF Meier suggestion, I tried mvn dependency:tree and found two libraries with scope compile
[INFO] +- org.springframework.boot:spring-boot-starter-reactor-netty:jar:2.1.3.RELEASE:provided
[INFO] | \- io.projectreactor.netty:reactor-netty:jar:0.8.5.RELEASE:compile
[INFO] | +- io.netty:netty-codec-http:jar:4.1.33.Final:compile
[INFO] | | +- io.netty:netty-common:jar:4.1.33.Final:compile
[INFO] | | +- io.netty:netty-buffer:jar:4.1.33.Final:compile
[INFO] | | +- io.netty:netty-transport:jar:4.1.33.Final:compile
[INFO] | | | \- io.netty:netty-resolver:jar:4.1.33.Final:compile
[INFO] | | \- io.netty:netty-codec:jar:4.1.33.Final:compile
[INFO] | +- io.netty:netty-codec-http2:jar:4.1.33.Final:compile
[INFO] | +- io.netty:netty-handler:jar:4.1.33.Final:compile
[INFO] | +- io.netty:netty-handler-proxy:jar:4.1.33.Final:compile
[INFO] | | \- io.netty:netty-codec-socks:jar:4.1.33.Final:compile
[INFO] | \- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.33.Final:compile
[INFO] | \- io.netty:netty-transport-native-unix-common:jar:4.1.33.Final:compile
...
[INFO] +- org.springframework:spring-webflux:jar:5.1.5.RELEASE:provided
[INFO] | \- io.projectreactor:reactor-core:jar:3.2.6.RELEASE:compile
[INFO] | \- org.reactivestreams:reactive-streams:jar:1.0.2:compile
And for example I see one of POM files
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-reactor-netty</artifactId>
<version>2.1.3.RELEASE</version>
...
<dependencies>
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty</artifactId>
<version>0.8.5.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
Now I still not get why other Spring Boot included libraries not override scope to compile. Does it means this two libraries build wrong or they build this way for some reason? And I still not clear how to remove in simple way dependencies that seems have override scope?
I tried to put version number in my POM dependency - but this have no effect - same jars included in compiled project jar:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<version>2.1.3.RELEASE</version>
<scope>provided</scope>
</dependency>
Update about parents
Parent pom file spring-boot-starter-parent not contains any dependencyManagement section, but have one more parent - spring-boot-dependencies - and it does have dependencyManagement section but scope compiled there is not provided. Some of dependencies have scope import though. I not understand could this import scoped dependencies have effect in my case. Some samples from here:
<dependencyManagement>
<dependencies>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-reactor-netty</artifactId>
<version>2.1.3.RELEASE</version>
</dependency>
...
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-bom</artifactId>
<version>${reactor-bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
...
</dependencies>
</dependencyManagement>
The part of content of spring-boot-starter-reactor-netty i posted here in previous update.
Update after Andy Wilkinson answer just to clarify - such dependencies are not included in jar, seems spring boot maven plugin do its work in different way here:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<scope>provided</scope>
</dependency>
A Spring Boot fat jar is intended to contain everything that's required to run the application. You can't use -jar and -classpath at the same time when launching the JVM, so that means that the jar needs to contain provided dependencies as well as there's no other way for them to get onto the classpath.
This behaviour is described in the documentation for Spring Boot's Maven Plugin where it says the following:
The example above repackages a jar or war that is built during the package phase of the Maven lifecycle, including any provided dependencies that are defined in the project.
If you don't want your application's jar to have any dependencies packaged inside it, i.e. you want it to be a normal jar rather than a fat jar, then you probably do not want to use Spring Boot's Maven plugin to build it. If you remove it from your sample project's pom.xml file and then build it, the resulting jar has the following contents:
$ unzip -l target/MavenProvidedTest-0.0.1-SNAPSHOT.jar
Archive: target/MavenProvidedTest-0.0.1-SNAPSHOT.jar
Length Date Time Name
--------- ---------- ----- ----
329 02-22-2019 11:33 META-INF/MANIFEST.MF
0 02-22-2019 11:33 META-INF/
0 02-22-2019 11:33 META-INF/maven/
0 02-22-2019 11:33 META-INF/maven/io.spring/
0 02-22-2019 11:33 META-INF/maven/io.spring/MavenProvidedTest/
1 02-22-2019 11:33 application.properties
1403 02-22-2019 11:33 META-INF/maven/io.spring/MavenProvidedTest/pom.xml
101 02-22-2019 11:33 META-INF/maven/io.spring/MavenProvidedTest/pom.properties
--------- -------
1834 8 files
If you want some but not all of the dependencies to be included, then you could continue to use Spring Boot's Maven Plugin and exclude some dependencies instead.
It is possible that the parent pom has a dependencyManagement section that overwrites scopes/versions.
From your question I understand that you need a thin executable jar. For you may use spring-thin-launcher plugin. It will exclude the dependencies to be packaged as part of the jar but will download from maven during first run or you may provide your own local repo where all the jar files can be found.
For details refer to this tutorial

where does the maven version get overridden?

I am building a spring boot starter, following the recommended convention with core / autoconfigure / starter module separation. When I look at the maven dependency-tree, this is what I have :
[INFO] com.myDomain.myProject:myProject-starter:jar:1.0.8-SNAPSHOT
[INFO] +- com.myDomain.myProject:myProject-autoconfigure:jar:1.0.8-SNAPSHOT:compile
[INFO] | \- com.myDomain.myProject:myProject-core:jar:1.0.8-SNAPSHOT:compile
[INFO] | +- io.github.openfeign:feign-gson:jar:9.5.1:compile
[INFO] | | +- io.github.openfeign:feign-core:jar:9.5.1:compile
[INFO] | | \- com.google.code.gson:gson:jar:2.8.5:compile
gson comes in v2.8.5, which is the version I expect - my project works with it
(note : in https://mvnrepository.com/artifact/io.github.openfeign/feign-core/9.5.1 , we see that the expected version for gson is 2.5... so not sure why I get 2.8.5..)
In my root pom.xml, I declare the BOM like this :
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign-dependencies</artifactId>
<version>2.0.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
and in my "core" pom.xml :
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-gson</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
</dependency>
</dependencies>
Now, in another project, I use the starter. So my pom.xml is very simple :
<dependencies>
<dependency>
<groupId>com.myDomain.myProject</groupId>
<artifactId>myProject-starter</artifactId>
<version>1.0.8-SNAPSHOT</version>
</dependency>
</dependencies>
When I look at the dependency tree in this project, I get this :
[INFO] \- com.myDomain.myProject:myProject-starter:jar:1.0.8-SNAPSHOT:compile
[INFO] +- com.myDomain.myProject:myProject-autoconfigure:jar:1.0.8-SNAPSHOT:compile
[INFO] | \- com.myDomain.myProject:myProject-core:jar:1.0.8-SNAPSHOT:compile
[INFO] | +- io.github.openfeign:feign-gson:jar:9.5.1:compile
[INFO] | | +- io.github.openfeign:feign-core:jar:9.5.1:compile
[INFO] | | \- com.google.code.gson:gson:jar:2.5:compile
gson comes in v2.5, and because of that it doesn't work. If I override it in the pom.xml, by declaring gson 2.8.5 before the starter, then it works..
But there must be something that I am missing in the way Maven works..
I've tried deleting the 1.0.8-snapshot version from my local repo, then rebuild, it, to make sure my second project was not taking an older version, but I keep getting this incorrect version in my build, and I have no clue where it's coming from / what overrides it.
code is available in this branch if you want to give it a try locally : https://github.com/societe-generale/github-crawler/tree/sprinBoot2upgrade
I am really interested in any pointer for investigation, to understand the root cause, because I am quite confused right now..
Thanks !
=========================================
EDIT 1
As mentioned in comments, it's Spring Boot starter that overrides the gson version to 2.8.5 (instead of the 2.5 planned in feign-core).
So now the question becomes : how come that when I use the starter as the single dependency in another project with no parent, that overridden version (2.8.5) disappears and I end up with the initial version (2.5) that is not compatible with spring-boot-autoconfigure 2.0.4.RELEASE ?
EDIT 2
I have created a fresh, more focused question here : Not getting the expected version when using the Spring Boot starter I built
quick summary based on the various hints in the question comments
Verbose mode is discontinued since Maven 3.x, so use mvn dependency:tree -X to get more details on versions used/overridden, etc. Then you get something like that :
[DEBUG] io.github.openfeign:feign-gson:jar:9.5.1:compile
[DEBUG] com.google.code.gson:gson:jar:2.8.5:compile (version managed from 2.5 by org.springframework.boot:spring-boot-dependencies:2.0.4.RELEASE)
-> this points quite clearly to where the version is coming from, ie https://github.com/spring-projects/spring-boot/blob/v2.0.4.RELEASE/spring-boot-project/spring-boot-dependencies/pom.xml#L65

Maven says I have a cyclic reference in multi-module project but can't figure out why

I have a multi-module project that looks like this:
module1
pom.xml
module2
pom.xml
pom.xml
The pom.xml in module2 has a dependency on module1.
When I run mvn clean compile I get the following error:
The projects in the reactor contain a cyclic reference.
Here are my dependencies in module1:
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.48</version>
</dependency>
</dependencies>
I can't figure out why it says there is a cyclic reference. Even when I do mvn dependency:tree on module1 I get the following:
[INFO] +- log4j:log4j:jar:1.2.14:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] +- com.jcraft:jsch:jar:0.1.48:compile
[INFO] \- junit:junit:jar:4.8.2:test
It looks to me like there aren't any references to module2 in module1. So where is the cyclic reference coming from?
Edit: Here is the log with debug on:
+ Error stacktraces are turned on.
Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
Java version: 1.6.0_31
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='com.myorg:module2'}' and 'Vertex{label='com.myorg:module1'}' introduces to cycle in the graph com.myorg:module1 --> com.myorg:module2 --> com.myorg:module1
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.BuildFailureException: The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='com.myorg:module2'}' and 'Vertex{label='com.myorg:module1'}' introduces to cycle in the graph com.myorg:module1 --> com.myorg:module2 --> com.myorg:module1
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:295)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: hidden.org.codehaus.plexus.util.dag.CycleDetectedException: Edge between 'Vertex{label='com.myorg:module2'}' and 'Vertex{label='com.myorg:module1'}' introduces to cycle in the graph com.myorg:module1 --> com.myorg:module2 --> com.myorg:module1
at hidden.org.codehaus.plexus.util.dag.DAG.addEdge(DAG.java:143)
at hidden.org.codehaus.plexus.util.dag.DAG.addEdge(DAG.java:123)
at org.apache.maven.project.ProjectSorter.<init>(ProjectSorter.java:118)
at org.apache.maven.execution.ReactorManager.<init>(ReactorManager.java:99)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:288)
... 11 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Thu Jul 05 17:21:21 EDT 2012
[INFO] Final Memory: 3M/244M
[INFO] ------------------------------------------------------------------------
Ah! It was a misleading error.
The problem wasn't that there both module1 and module2 depended on each other. The problem was that module2 is a Maven plugin and in my root pom.xml I had the plugin in the section. I removed that plugin from the build and it started working.
It happened to me in this circumstances.
The module_child_X was specified 2 times at module_root pom.xml:
- As a module
(pom.xml of the root module)
<dependency>
<groupId>module_root</groupId>
<artifactId>module_child_X</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>jar</type>
</dependency>
- As a dependency
(pom.xml of the root module)
<modules>
<module>module_child_X</module>
...
</modules>
Solution?
Removed the module_child_X as a dependency. It is already specified as a module.
I do nearly the same, and I use IDEA.
I have a project A, which depends on a module B.
In the pom file of A, B was declared as a dependency. This is OK.
In the pom file of B, A was declared as its parent. I removed this information, and as it was requested in the error message I added the version number of B in its pom file.
And now it is OK.
I had exactly the same issue in a multimodule ear project. The ejb pom had a dependency on the web module (compile scope) and the web pom a dependency on the ejb module. As soon as i removed the ejb's pom dependency on the web module, the project build fine.
It makes sense that the intramodule dependencies must be unidirectional after all, in order to avoid cyclic references.

Shiro Plugin conflicting with Quartz framework in Grails

I have been working Quartz framework in my grails project with lib called quartz-all-1.7.3.
Now I need to install the shiro plugin to my project. So, whenever I am installing shiro plugin to my project its getting installed successfully..
But again whenever I am running my project again it's giving compilation error as follows :
[groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
[groovyc] Compile error during compilation with javac.
[groovyc] ....scheduler\quartz\framework\CustomJDBCDelegate.java:46: com.securonix.application.scheduler.quartz.framework.CustomJDBCDelegate is not abstract and does not override abstract method updateSchedulerState(java.sql.Connection,java.lang.String,long,java.lang.String) in org.quartz.impl.jdbcjobstore.DriverDelegate
[groovyc] public class CustomJDBCDelegate implements DriverDelegate, StdJDBCConstants {
[groovyc] ^
So after long look on shiro plugin I have found that it has some dependencies with plugins. In that one of the dependency is shiro-quartz-1.0.0-incubating.jar. So, now inside it's pom.xml file I have seen following line code :
<dependency>
<groupId>quartz</groupId>
<artifactId>quartz</artifactId>
</dependency>
As per our line in pom.xml, there is no tag of version with quartz dependency, that means whenever shiro getting installed in my project, simultaneously it's extracting latest library of quartz i.e. 1.8.3 with maven.
And inside that quartz 1.8.3 the method updateSchedulerState of class CustomJDBCDelegate has been changed from version quarts 1.7.3.
So now problem is I cannot change quartz-all-1.7.3 in my existing project, and wanted to use Shiro plugin too in my project.
So there should be some resolution so that shiro should get quartz-1.7.3 version rather than the latest one using maven.
Any help would be highly appreciated...
Thanks...
Maybe I'm getting this wrong, do you mean something like this?:
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-quartz</artifactId>
<version>1.0.0-incubating</version>
<exclusions>
<exclusion>
<groupId>quartz</groupId>
<artifactId>quartz</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>1.7.3</version>
</dependency>
then $ mvn dependency:tree
[...]
[INFO] +- org.apache.shiro:shiro-quartz:jar:1.0.0-incubating:compile
[INFO] | \- org.apache.shiro:shiro-core:jar:1.0.0-incubating:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.5.6:compile
[INFO] | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] \- org.quartz-scheduler:quartz:jar:1.7.3:compile
[INFO] \- commons-logging:commons-logging:jar:1.1:compile
[INFO] +- log4j:log4j:jar:1.2.12:compile
[INFO] +- logkit:logkit:jar:1.0.1:compile
[INFO] \- avalon-framework:avalon-framework:jar:4.1.3:compile

Resources