How can I stop maven-compiler-plugin altering version of dependency when building with JBPM libraries? - maven

I have been seeing the warning below for months and key aspects of JBPM are not working with my code so how do I solve:
[WARNING] The POM for com.fasterxml.jackson.core:jackson-annotations:jar:2.9.10.redhat-00005 is missing, no dependency information available
[WARNING] The POM for com.fasterxml.jackson.core:jackson-core:jar:2.9.10.redhat-00005 is missing, no dependency information available
[WARNING] The POM for com.fasterxml.jackson.core:jackson-databind:jar:2.9.10.redhat-00005 is missing, no dependency information available
Given that I have been specifying the relevant dependencies in my pom.xml as:
<properties>
<jbpm.version>7.44.0.Final-redhat-00006</jbpm.version>
<myJackson.version>2.10.0</myJackson.version> <!-- was 2.9.0 -->
...
</properties>
...
</plugin>
<!--plugin> <groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<version>${jbpm.version}</version>
<extensions>true</extensions> <dependencies>
</plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
</configuration>
</plugin>
...
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${myJackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${myJackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${myJackson.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
I am hoping that when the Jackson libraries are consistent my projects issues go away. How should I change my pom.xml to resolve the missing pom files? Version 2.9.10.redhat-00005 does not exist that I know of and I also don't think they are Redhat's - which would likely be version 00006, not 00005, from the JBPM.

Related

Unable to start plugin: Unable to resolve 167.0: missing requirement [167.0] osgi.wiring.package; (osgi.wiring.package=com.atlassian.inject)

I'm using the latest version of the atlassian SDK to develop a plugin for JIRA. I've already written a large portion of my code, and have added a handful of dependencies that I required to the pom.xml file of my project (see below).
Unfortunately, upon running atlas-run to start my local JIRA environment, it fails to load my plugin due the following error:
'com.COMPANY.COMPANY-worklog-plugin' - 'COMPANY-worklog-plugin' failed to load.
[INFO] [talledLocalContainer] Cannot start plugin: com.COMPANY.COMPANY-worklog-plugin
[INFO] [talledLocalContainer] Unresolved constraint in bundle com.COMPANY.COMPANY-plugin [167]: Unable to resolve 167.0: missing requirement [167.0] osgi.wiring.package; (osgi.wiring.package=com.atlassian.inject)
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer]It was loaded from C:\Project\COMPANY-worklog-plugin\target\jira\home\plugins\installed-plugins\COMPANY-worklog-plugin-1.0.0-SNAPSHOT.jar
I've been plagued with the same kinds of errors for a few days now, including the following: (which I managed to fix by adding the dependency to my POM):
[INFO] [talledLocalContainer]Unresolved constraint in bundle com.maxxton.worklog-plugin [167]: Unable to resolve 167.0: missing requirement [167.0] osgi.wiring.package; (osgi.wiring.package=bsh)
I've tried the following things:
Re-generating my plugin with the Atlassian Framework, which worked until I re-added my dependencies
Removing and re-adding my dependencies to see where the error lays. Couldn't manage to find out if there's a faulty dependency or not.
Changing the scopes of my external dependencies (provided-> compile and back, test where necessary.)
Use atlas-mvn clean nearly every time before running my atlas-run command.
Activating my plugin within jira (timeout error)
Researched this question before posting. I'm especially lost because it appears to be a stock Atlassian package that's causing the problem.
My POM is as followed:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.maxxton</groupId>
<artifactId>maxxton-worklog-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<organization>
<name>Example Company</name>
<url>http://www.example.com/</url>
</organization>
<name>maxxton-worklog-plugin</name>
<description>This is the com.maxxton:maxxton-worklog-plugin plugin for Atlassian JIRA.</description>
<packaging>atlassian-plugin</packaging>
<dependencies>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
</dependency>
<!-- Add dependency on jira-core if you want access to JIRA implementation classes as well as the sanctioned API. -->
<!-- This is not normally recommended, but may be required eg when migrating a plugin originally developed against JIRA 4.x -->
<!--<dependency>-->
<!--<groupId>com.atlassian.jira</groupId>-->
<!--<artifactId>jira-core</artifactId>-->
<!--<version>${jira.version}</version>-->
<!--<!–<scope>provided</scope>–>-->
<!--<scope>compile</scope>-->
<!--</dependency>-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-annotation</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-runtime</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.beanshell</groupId>
<artifactId>bsh</artifactId>
<version>2.0b4</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpasyncclient</artifactId>
<version>4.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.3.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.4.9</version>
<scope>compile</scope>
</dependency>
<!-- WIRED TEST RUNNER DEPENDENCIES -->
<dependency>
<groupId>com.atlassian.plugins</groupId>
<artifactId>atlassian-plugins-osgi-testrunner</artifactId>
<version>${plugin.testrunner.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2-atlassian-1</version>
<scope>compile</scope>
</dependency>
<!-- Uncomment to use TestKit in your project. Details at https://bitbucket.org/atlassian/jira-testkit -->
<!-- You can read more about TestKit at https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Smarter+integration+testing+with+TestKit
-->
<!--
<dependency>
<groupId>com.atlassian.jira.tests</groupId>
<artifactId>jira-testkit-client</artifactId>
<version>${testkit.version}</version>
<scope>test</scope>
</dependency>
--> </dependencies>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jira-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productVersion>${jira.version}</productVersion>
<productDataVersion>${jira.version}</productDataVersion>
<!-- Uncomment to install TestKit backdoor in JIRA. -->
<!--
<pluginArtifacts>
<pluginArtifact>
<groupId>com.atlassian.jira.tests</groupId>
<artifactId>jira-testkit-plugin</artifactId>
<version>${testkit.version}</version>
</pluginArtifact>
</pluginArtifacts>
-->
<enableQuickReload>true</enableQuickReload>
<enableFastdev>false</enableFastdev>
<!-- See here for an explanation of default instructions: -->
<!-- https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins
-->
<instructions>
<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
<!-- Add package to export here -->
<Export-Package>
com.maxxton.api,
</Export-Package>
<!-- Add package import here -->
<Import-Package>
org.springframework.osgi.*;resolution:="optional",
org.eclipse.gemini.blueprint.*;resolution:="optional",
*
</Import-Package>
<!-- Ensure plugin is spring powered -->
<Spring-Context>*</Spring-Context>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<executions>
<execution>
<goals>
<goal>atlassian-spring-scanner</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
<configuration>
<scannedDependencies>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-external-jar</artifactId>
</dependency>
</scannedDependencies>
<verbose>false</verbose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins> </build>
<properties>
<jira.version>7.2.4</jira.version>
<amps.version>6.2.6</amps.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
<atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
<!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<!-- TestKit version 6.x for JIRA 6.x -->
<testkit.version>6.3.11</testkit.version>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target> </properties>
</project>
Thank you.
Looks like I found a way to fix it, though I'm unsure if it's a good fix. It has something to do with importing certain packages; I'm unsure of the logic behind it, but it seemed to have gotten rid of any and all of the bundle errors, causing my plugin to load perfectly when starting my local environment.
For those curious, I changed my from:
<Import-Package>
org.springframework.osgi.*;resolution:="optional",
org.eclipse.gemini.blueprint.*;resolution:="optional",
*
</Import-Package>
To
<Import-Package>
org.springframework.osgi.*;resolution:="optional",
org.eclipse.gemini.blueprint.*;resolution:="optional",
*;version="0";resolution:=optional
</Import-Package>

How to get specific version dependencies jars from maven artifactory repository who has "Provided" scope

Is it possible to get specific version dependencies jars from maven artifactory repository who has "Provided" scope after the build.Due to so many webapps and most of them having common dependencies, thought of making all dependencies as "Provided" (So that WEB-INF/lib would be empty) and getting all "provided" jars of specific version from the artifactory repository during deployment (Very first step of deployment is copying the jars in to Tomcat common lib followed by war deployment).If possible please help me by giving model script to do the copy from repository to tomcat common lib before deployment.
Assume app having 3 webapp (webapp1,webapp2 and webapp3) and all using abc1.jar,abc2.jar,abc3.jar.each webapp classloader loading all these 3 for each war to deploy.Instead making them as provided and keeping 3 jars in Tomcat common lib would be appropriate i feel.Now my question is after the maven build, can i get provided jars from repository to copy them from repository to tomcat lib using shell script
Sample pom.xml (Without provided scope)
http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
com.group.groupid
mSampleJDBCTempPrj
war
0.0.1-SNAPSHOT
mSampleJDBCTempPrj Maven Webapp
http://maven.apache.org
org.springframework
spring-context
3.1.1.RELEASE
cglib
cglib
2.2.2
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901-1.jdbc4</version>
</dependency>
</dependencies>
<build>
<finalName>mSampleJDBCTempPrj</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- <includeScope>provided</includeScope> -->
<outputDirectory>/Users/venugopal/Documents/providedDependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
When the idea is, to create an archive, which contains the jars, that are marked with the scope provided in the pom.xml. So if multiple web-apps use these same jars, they can be deployed to the central place in the wen container provider (Tomcat / Jetty / JBoss / etc).
For as far as I know there is no option in Maven to create an archive, for these provided dependencies. Or some other way to extract them easily from the Maven repository.
A question rises Why would you do so? Many projects move these days to Docker or similar solutions. Which deploy just one web-app in one container. So no need for the complexity of searching for commin libraries and placing them upfront on the web container. Etc etc.
Another question Why add complexity. An easier set-up is to add all depended jars to the web-app. As disk space and network speed / capacity, is most of the time not an issue.
Seems the answer Getting jars from scope provided maven web project is already provided
TIP The above sample, shows the usage of the maven-dependency-plugin. It is configured to run during the phase package (<phase>package</phase>).
Use mvn clean package, to let it do it's task.
The pom.xml needed a few small modifications:
This is just a small pom.xml, so package should be pom, as there is no web-app content, Java classes, configuration etc.
In build, the finalName is not needed.
Updated dependency postgresql it's scope with value provided, so at least one dependency is resolved, by the plug-in
Removed pluginManagement which should be used in parent-pom cases, not here. Here it just hides the plug-in. In cases where it is used, the parent-pom defines the plugin configuration for multiple Maven projects. All projects which use the same parent-pom, can include a plugin, with the same version number and configuration, as given in the parent-pom.
Addition
The corrected pom.xml, from the question:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.group.groupid</groupId>
<artifactId>mSampleJDBCTempPrj</artifactId>
<packaging>pom</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>mSampleJDBCTempPrj Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901-1.jdbc4</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>provided</includeScope>
<outputDirectory>${project.build.directory}/providedDependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Calling KieScanner throws ClassNotFoundException

I have several Drools projects and would like to be able to dynamically load rules changes. The projects all work fine until I tried to add KieScanner to them. I followed the directions here: http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/DroolsReleaseNotesChapter.html#d0e515
I am using drools 6.1.0.Final with Wildfly 8.0.0.Final
The documentation indicates that having the dependency for the kie-ci in my class path was enough. Clearly either I am doing something wrong or the documentation is wrong.
The project builds but when it is called, I get this trace:
10:21:17,946 ERROR [io.undertow.request] (default task-2) UT005023: Exception handling request to /catalog/vetec/search/facets/term: org.jboss.resteasy.spi.UnhandledException: javax.enterprise.inject.CreationException
at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:76) [resteasy-jaxrs-3.0.6.Final.jar:]
at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:212) [resteasy-jaxrs-3.0.6.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:149) [resteasy-jaxrs-3.0.6.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:372) [resteasy-jaxrs-3.0.6.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179) [resteasy-jaxrs-3.0.6.Final.jar:]
Caused by: java.lang.NoClassDefFoundError: org/apache/maven/repository/internal/MavenRepositorySystemSession
at org.kie.scanner.MavenRepository.getMavenRepository(MavenRepository.java:73) [kie-ci-6.1.0.Final.jar:6.1.0.Final]
at org.kie.scanner.ArtifactResolver.(ArtifactResolver.java:36) [kie-ci-6.1.0.Final.jar:6.1.0.Final]
at org.kie.scanner.KieRepositoryScannerImpl.getArtifactResolver(KieRepositoryScannerImpl.java:87) [kie-ci-6.1.0.Final.jar:6.1.0.Final]
at org.kie.scanner.KieRepositoryScannerImpl.getArtifactVersion(KieRepositoryScannerImpl.java:108) [kie-ci-6.1.0.Final.jar:6.1.0.Final]
at org.drools.compiler.kie.builder.impl.KieRepositoryImpl$KieModuleRepo.load(KieRepositoryImpl.java:281) [drools-compiler-6.1.0.Final.jar:6.1.0.Final]
at org.drools.compiler.kie.builder.impl.KieRepositoryImpl$KieModuleRepo.load(KieRepositoryImpl.java:267) [drools-compiler-6.1.0.Final.jar:6.1.0.Final]
at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:90) [drools-compiler-6.1.0.Final.jar:6.1.0.Final]
at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:77) [drools-compiler-6.1.0.Final.jar:6.1.0.Final]
at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:97) [drools-compiler-6.1.0.Final.jar:6.1.0.Final]
at com.sial.rules.cdi.KSessionContextProvider.(KSessionContextProvider.java:49) [sial-rules-0.0.1-SNAPSHOT.jar:]
Here is the pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sial.rules</groupId>
<artifactId>sial-rules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>JBoss Repository</id>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<!-- Added to ensure that we have the correct DROOLS/JBOSS versions -->
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-bom</artifactId>
<version>6.1.0.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.wildfly.bom</groupId>
<artifactId>jboss-javaee-7.0-with-tools</artifactId>
<version>8.0.0.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.wildfly.bom</groupId>
<artifactId>jboss-javaee-7.0-with-resteasy</artifactId>
<version>8.0.0.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-decisiontables</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-persistence-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>knowledge-api</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-internal</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-ci</artifactId>
<exclusions>
<exclusion>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0-rc1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.drools</groupId>
<artifactId>drools-maven-plugin</artifactId>
<version>6.0.0.CR5</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
This business rules project is itself incorporated into the actual WARs that are deployed to Wildfly.This is the dependency used in the application poms:
<dependency>
<groupId>com.sial.rules</groupId>
<artifactId>sial-rules</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
I recently discovered that the extra dependency breaks our Arquillian Unit tests. Since Arquillian has a completely different maven integration, my best guess is that this is a bug in KIE. It is very similar to BZ1098018
Adding this extra dependency "fixes" the issue when the code actually calls kie-ci, however with this dependency our Arquillian tests fail to deploy.
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-aether-provider</artifactId>
<version>3.0.5</version>
</dependency>
You should not need to declare the additional maven, aether and other dependencies manually. The kie-ci should transitively depend on everything it needs. If you look at the pom.xml of the kie-ci https://github.com/droolsjbpm/drools/blob/6.1.0.Final/kie-ci/pom.xml the dependencies you added are also listed there, so Maven resolves them automatically.
This seems to be either some weird bug or misconfiguration. I presume you have the following in your pom:
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-ci</artifactId>
<version>6.1.0.Final</version>
</dependency>
Could you post your whole pom?
The problem is that kie-ci includes an older version of maven (3.0.5) than does Arquillian (3.1.1) Specifically the maven-aether-provider. Arquillian (really ShrinkWrap) really wants to use the newer version.
I tried forcing the 3.0.5 version in the pom.xml but get the issue of the resolver.
This is the error:
java.lang.UnsupportedOperationException: Unable to boostrap Aether repository system. Make sure you're running Maven 3.1.0 or newer.
So basically kie 6.1.0.Final is incompatible with Arquillian 1.1.5.Final
I will have to see if the Kie 6.2.0CR3 release will work

compilation error, package javax.ws.rs does not exist, dependencies not resolved from maven

I had mentioned the dependency libraries in the pom file, also the library system path exists also, but during the compilation using maven clean install -e -X, it throws error saying the package does not exists.
**[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/gopc/workspace/RestfulService/src/restfu/Hello.java:[4,19] C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:4: package javax.ws.rs does not exist
[ERROR] /C:/Users/gopc/workspace/RestfulService/src/restfu/Hello.java:[5,19] C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:5: package javax.ws.rs does not exist
[ERROR] /C:/Users/gopc/workspace/RestfulService/src/restfu/Hello.java:[6,19] C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:6: package javax.ws.rs does not exist
[ERROR] /C:/Users/gopc/workspace/RestfulService/src/restfu/Hello.java:[8,1] C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:8: package javax.ws.rs.core does not exist
[ERROR] /C:/Users/gopc/workspace/RestfulService/src/restfu/Hello.java:[21,2] C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:21: cannot find symbol
symbol: class Path**
POM file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>RestfulService</groupId>
<artifactId>RestfulService</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
<outputDirectory>${basedir}/build/classes</outputDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>jersey-server</groupId>
<artifactId>jersey-server</artifactId>
<version>1.4</version>
<scope>compile</scope>
<systemPath>${basedir}/lib/jersey-server-1.4.jar</systemPath>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
<version>1.4</version>
<scope>system</scope>
<systemPath>${basedir}/lib/javax.ws.rs.jar</systemPath>
</dependency>
</dependencies>
</dependencyManagement>
</project>
You need to include the Java EE dependencies in your POM, with a provided scope (aka, the files will eventually be provided by the application server, but in the meantime I need them for compilation).
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
I had this and more similar issues after system update, when NetBeans changed fonts, and GUI in general. I have resolved this issue by adding Java EE 6 API Library in NetBeans IDE by doing
myProject->Properties->Libraries->Add Library
The dependency that #Perception replied with is also needed but it was not enough for me as well. The following dependency was also needed:
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
</dependency>
https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api/2.0
Τhis fixed the problem for me!
I think this dependency is better
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
</dependency>
The modern day answer will be as below :
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
</dependency>
Jersey is published in java.net repository; just use this (or better edit your user settings.xml):
<repositories>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.8</version>
</dependency>
</dependencies>
JSR311 (javax.ws.rs) will be downloaded automatically by maven as a jersey-core dependency.
I resolved the issue by adding the dependencies in between the <project> tags instead of in dependency management.
In my case it was IntelliJ 'make' that was not working, although mvn clean install worked fine. The way to resolve it is to remove the two erroneous "Modules" from the "project Structure"->Modules tab, the modules were: main and test. Somehow they got in there from 'create project from existing source'.
I came through this error, the solution for me was to have both of this dependencies:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
</dependency>
I resolved the issue the same approach as #BugsForBreakfast.
But wanted to share that javax.ws.rs-api artifact is been moved now.
One can use the dependency below:
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>3.1.0</version>
</dependency>

Is there a way to include two versions of the same artifact in Maven?

<dependency>
<groupId>org.jmock</groupId>
<artifactId>jmock</artifactId>
<version>1.2.0</version>
</dependency>
<!--Include Both Jmock 1&2 is cool: http://www.jmock.org/upgrade1to2.html -->
<dependency>
<groupId>org.jmock</groupId>
<artifactId>jmock</artifactId>
<version>2.5.1</version>
</dependency>
This doesnt work.
Check out the dependency mediation section in http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html . One version will win.

Resources