BIRT maven configuration not working as expected.
Added following dependencies in the pom.xml file
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.birt.runtime</artifactId>
<version>4.4.2</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>com.ibm.icu</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
<version>3.4.0.v20140312-2051</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>com.ibm.icu</artifactId>
<version>52.1.1.v201501240615</version>
</dependency>
the jar has been downloaded and Maven update was done on the project. Still, java code gives compile time error?
import org.eclipse.birt.report.engine.api.*;
Compile time error: The import org.eclipse cannot be resolved
How can we resolve these dependencies and make it work?
You are just importing the runtime library, not the engine api. Therefore, your compiler complains about missing classes.
You need the following library to import:
https://mvnrepository.com/artifact/org.eclipse.birt/report-engine/3.7.0
Finally, I am able to use by doing some changes in dependencies
Add these two jars in lib folder.
"flute-1.3.jar" &
"org.eclipse.orbit.mongodb-2.10.1.v20130422-1135.jar"
Dependency Update:
//Start of birt
compile(group: 'org.eclipse.birt.runtime', name: 'org.eclipse.birt.runtime', version: '4.4.2') {
exclude(group: 'org.milyn', module: 'flute')
exclude(group: 'org.eclipse.birt.runtime', module: 'org.eclipse.orbit.mongodb')
}
//End of birt
Related
Maven shade plugin is very powerful for resolving dependency conclict, but a situation I have is as follows :
myproject
guava 31
thridparty-dependency-1
guava18
I could relocate the guava 31 dependency and then the conflict will be resolved. And how about following situation :
myproject
thirdparty-1
guava31
thirdparty-2
guava18
thirdparty-3
guava4
Or how about if there are more than two dependencies conflicting as the same dependency but with different versions ?
If I use relocation, then thirdparty-1/guava31 will be relocated but the guava18 and guava4 still conflict.
I'm not sure how to handle this situation.
You need to de-conflict these across the whole project, not just for the shaded uber-jar.
Use Maven <exclusions> in the pom.xml declarationtion to achieve this.
For example:
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>${neo4j.version}</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>${netty.version}</version>
</dependency>
Despite having appropriate jars in classpath Spring Boot throws - java.lang.ClassNotFoundException: org.apache.camel.spring.spi.XmlCamelContextConfigurer
Any suggestions what is missing here.
I have added the respective starters in pom.xml as shown below:
<dependency>
<groupId>org.springframework.boot</groupId>[![enter image description here][1]][1]
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>2.19.3</version>
</dependency>
The project maven dependencies also shows the class availability, as in given image attachment.
the answer is here - https://stackoverflow.com/a/34271507/2885422 It all depends how maven loads the class. There are 2 version of camel-spring.jars available in classpath (2.20.1 and 2.19.3. Ref: my original post image)
And org.apache.camel.spring.spi.XmlCamelContextConfigurer class is available only in 2.20.1 jars. And maven by default looks in earlier one and once package found matching but no class found throws error (?)
And the reason I believe 2.19.3 get loaded is Apache-cxf jars is of 2.19.3. Unfortunately our project repository does not have apache-cxf starter jars.
https://stackoverflow.com/a/34271507/2885422
Solution: - I hope it may be helpful for future references
By adding options I could resolve the issue,by having exclusion clause added as given below. Thus I could load only required version jars.
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>2.19.3</version>
<exclusions>
<exclusion>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</exclusion>
</exclusions>
</dependency>'
I have some transitive dependency excludes in my custom-plugin build script. Like so:
configurations {
compile.exclude group: 'commons-math3', module: 'commons-math3'
}
dependencies {
'org.apache.jmeter:ApacheJMeter:2.13',
}
When publishing to plugins.gradle.org using com.gradle.plugin-publish version 0.9.1, the excludes are not propagated to the generated POM:
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter</artifactId>
<version>2.13</version>
<scope>compile</scope>
</dependency>
Is there a workaround? Can I somehow use plugin-publish's withDependencies extension?
Maven-publish plugin has (or at least, used to have) a similar issue. See here
Update: This issue is unresolved, and is now logged as a gradle defect.
Exclude the module at the dependency that it is a transitive dependency of:
dependencies {
compile('org.apache.jmeter:ApacheJMeter:2.13') {
exclude group: 'commons-math3', module: 'commons-math3'
}
}
And this is what you will get in the resulting POM:
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter</artifactId>
<version>2.13</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>commons-math3</artifactId>
<groupId>commons-math3</groupId>
</exclusion>
</exclusions>
</dependency>
When I upgrade to activemq-all-5.6.0
I get this error during server startup
SLF4J: Class path contains multiple SLF4J bindings
I don't have this issue when using activemq-all-5.5.1
On checking I do find that there StaticLoggerBinder.class in both activemq-all-5.6.0.jar and slf4j-log4j12-1.5.10.jar which is causing the issue
Please do help in debugging this issue
My pom.xml is as follows
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.5.10</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.10</version>
<scope>runtime</scope>
</dependency>
The active mq dependency is like this
Old Version 5.5.1 (This works)
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.5.1</version>
</dependency>
New Version 5.6.0 (This gives the error)
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.6.0</version>
</dependency>
Thanks in advance.
The ActiveMQ guys use the Maven Shade Plugin to create the activemq-all "ueber" jar. Somewhere between version 5.5.1 and 5.6.0 they added the org.slf4j:slf4j-log4j12 dependency - hence your problem.
Unfortunately because they used the shade plugin you can not use exclusions in your activemq-all dependency definition in your POM.
Instead you will need to completely replace the activemq-all dependency with all the required individual dependencies (except of course the org.sl4j-log4j12 one).
The following page details all the required dependencies:
http://activemq.apache.org/initial-configuration.html#InitialConfiguration-RequiredJARs
Alternatively the following is the list of all dependencies (required and optional) included in the activemq-all jar (taken from the configuration of the shade plugin in the activemq-all pom):
org.apache.activemq:activemq-camel
org.apache.activemq:activemq-core
org.apache.activemq:activemq-console
org.apache.activemq:activemq-jaas
org.apache.activemq:activemq-optional
org.apache.activemq:kahadb
org.apache.geronimo.specs:geronimo-jms_1.1_spec
org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec
org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec
org.apache.geronimo.specs:geronimo-annotation_1.0_spec
org.slf4j:slf4j-api
org.slf4j:slf4j-log4j12
log4j:log4j
Hope that helps.
I had the same problem while using Spring. What helped me was replacing the dependency of activemq-all with:
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-spring</artifactId>
<version>5.14.3</version>
</dependency>
Hope this will help anyone...
How can I remove artifacts from the lib folder of the ear? For exemple: activation.jar.
I was try follow the especification about Excluding a module (just change webModule for jarModule) but without success with this error: Artifact[jar:javax.activation:activation] is not a dependency of the project.
Use provided as scope wherever the dependency is defined.
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
Set the scope to provided. Maven will still add the dependency to the compile time classpath but not to the final WAR.
As others have said, you need to use provided as the scope. If the jars you need to remove are not dependencies of your project directly (ie are transient dependencies), then you need to exclude them from whatever is bringing them into your build . If you actually need those classes at compile-time, you'll have to re-include them as provided:
<dependency>
<!-- this dependency has javax.activation as a dependency -->
<groupId>blah.groupId</groupId>
<artifactId>blah.artifactId</artifactId>
<version>blah.version</version>
<exclusions>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<exclusion>
</exclusions>
</dependency>
<!-- only necessary if this jar is needed at compile-time -->
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>