i am using jsf2 hibernate 4.1.4, spring 3.1 and maven 3 in eclipse helios. but i have this error when i try to add dependecy in to POM.
Java compiler level does not match the version of the installed Java project facet.
what does it mean? how can i solve this error?
also i have this warning:
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.
my POM:
<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>com.integrate</groupId>
<artifactId>integrate</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>integrate</name>
<dependencyManagement>
<dependencies>
</dependencies>
</dependencyManagement>
<properties>
<spring.version>3.1.0.RELEASE</spring.version>
</properties>
<dependencies>
<!-- Spring 3 dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- JSF dependencies -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.6</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.6</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Hibernate dependencies -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.4.Final</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.1.GA</version>
</dependency>
<!-- oracle Connector dependency -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
<!-- c3p0 dependency -->
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
</dependency>
</dependencies>
the pic:
Just add the build section with the maven-compiler-plugin to your pom.xml.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
Then you should configure project's build path.
Or you can just delete the project from eclipse workspace (without deleting from file system), remove eclipse's settings (.project, .classpath and .settings files and folders) from the project and re-import your project as an existent Maven project to your IDE. Eclipse will re-generate its settings properly.
Please check the project facets concerned with your project(Right click on the project/ Properties/ Project Facets/ Java).
It is just that the java version which you have installed in your system, and the one which you are specifying in the project facets of your project, might not be matching.
Specify the java version for Maven in D:\maven-2.2.1\conf toolchains.xml
<?xml version="1.0" encoding="UTF-8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>1.5</version> <!--This should be same as is configured via the toolchains plugin -->
<vendor>ibm</vendor> <!--This should be same as is configured via the toolchains plugin -->
</provides>
<configuration>
<jdkHome>C:\Program Files\Java\jdk1.5.0</jdkHome>
</configuration>
</toolchain>
</toolchains>
That worked for me:
Project->Java Build Path->Libraries->JRE version
Project->Java Compiler-> Compiler Compliance Level
Project->Project Facets->Java->Version
If you using Maven edit in pom.xml
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
Related
I'm having some issues with Eclipse, Maven, Java 8 and App Engine Standard Environment project.
After creating another project that requires Java 11, it seems that Eclipse or Maven is struggling to work correctly.
The main error I get in markers Eclipse tab that is impeding me to deploy or launch a local environment is:
App Engine Java Standard Environment JRE8 requires Dynamic Web Module with version matching expression "[2.5-3.1]"
Eclipse Project Facets are correctly configured. Dynamic Web Module version 2.5, App Engine Standar using Java 1.8
Project build path points to jdk1.8.0_211. Compiler too.
Nothing changed in the project recently. Error appeared after doing Maven -> Update project.
I tried every change suggested in Google but nothing seems to change.
I tried creating another workspace which worked (even reinstalling Eclipse) for 24 hours. After that, sudenly the error appeared again.
What should I try next? This problem is stopping me from working...
Edit:
Maven commands work fine, clean, install, package.
Also deploying (appengine:deploy) works but throws many errors of missing classes.
I cannot deploy the application through Google Cloud Tools extension in Eclipse because of Maven configuration errors.
Local server (Eclipse launching) throws many exceptions of missing classes.
Local server (Maven launching) fails to run with this error:
File exists
Maven Update project and install package outputs different compiled classes at target directory, don't know why
PD: Replaced some project naming with placeholders.
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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<artifactId>artifact-module</artifactId>
<name>name-module</name>
<parent>
<groupId>parent</groupId>
<artifactId>parent</artifactId>
<version>1.0</version>
</parent>
<properties>
<appengine.maven.plugin.version>2.4.0</appengine.maven.plugin.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<endpoints.project.id>projectid</endpoints.project.id>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
</properties>
<prerequisites>
<maven>3.0</maven>
</prerequisites>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>20.4.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.google.endpoints/endpoints-management-control-appengine -->
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-management-control-appengine</artifactId>
<version>1.0.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.endpoints/endpoints-framework -->
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-framework</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.88</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.apis/google-api-services-admin-directory -->
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-admin-directory</artifactId>
<version>directory_v1-rev110-1.25.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.apis/google-api-services-calendar -->
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-calendar</artifactId>
<version>v3-rev20191117-1.30.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.apis/google-api-services-people -->
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-people</artifactId>
<version>v1-rev20190910-1.30.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.apis/google-api-services-drive -->
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-drive</artifactId>
<version>v3-rev20191108-1.30.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.apis/google-api-services-gmail -->
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-gmail</artifactId>
<version>v1-rev20190602-1.30.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.gdata/core -->
<dependency>
<groupId>com.google.gdata</groupId>
<artifactId>core</artifactId>
<version>1.47.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.nimbusds/nimbus-jose-jwt -->
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>5.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.endpoints/endpoints-framework-auth -->
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-framework-auth</artifactId>
<version>1.0.11</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java -->
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.11.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>6.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.8</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.8</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.7.2</version>
</dependency>
<dependency>
<groupId>com.mailjet</groupId>
<artifactId>mailjet-client</artifactId>
<version>4.5.0</version>
</dependency>
</dependencies>
<build>
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>endpoints-framework-maven-plugin</artifactId>
<version>1.0.2</version>
<configuration>
<hostname>${endpoints.project.id}.appspot.com</hostname>
</configuration>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<!-- deploy configuration -->
<version>1</version>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>display-dependency-updates</goal>
<goal>display-plugin-updates</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
</plugins>
</build>
</project>
I'm using Maven. I'm having trouble downloading a dependency and getting the error, "Missing artifact org.hibernate:hibernate-core:jar:5.2.10.final".
I delete whole project an clone it again from git.I update maven dependencies, still there is no hibernate file load in it.
Here is my pom.xml
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>gau</groupId>
<artifactId>shoppingbackend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>shoppingbackend</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>4.3.6.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- SPRING -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- H2 Database -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.193</version>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.10.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<!-- Database connection pooling -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!-- update to latest java version -->
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
Git link of my project
https://github.com/Gauravmokashi/online-shopping.git
You may check if any other Maven projects of yours are currently using this dependency for Hibernate, and if they do, then diactivate them. After that, put this dependency into the project's pom.xml file you need and update ALL your Maven projects. It should work then.
I also face this issue and I tried many things like restart eclipse, maven clean
If you are using eclipse just right click on the project > select run as > click maven install. This may solve the issue
We have been working on JIRA plugin development and using apache-commons library for file upload purpose as follows:
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.2</version>
<scope>provided</scope>
</dependency>
Generated plugin is working fine on atlas development environment but while uploading the generated Jar on JIRA, following error is being displayed in logs.
2017-12-11 09:49:53,841 UpmAsynchronousTaskManager:thread-3
ERROR jira.admin 357x1243x1 1ycla6b 14.102.4.74,13.58.31.162 /rest/plugins/1.0/
[c.a.p.osgi.factory.OsgiPlugin] Detected an error (BundleException) enabling the plugin 'com.atlassian.tutorial.myPlugin' :
Unresolved constraint in bundle com.atlassian.tutorial.myPlugin [237]: Unable to resolve 237.0: missing requirement [237.0]
osgi.wiring.package; (osgi.wiring.package=org.apache.commons.fileupload).
This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints,
or there is no bundle available that provides the specified package. For more details on how to fix this, see https://developer.atlassian.com/x/mQAN
After going through various threads to resolve this issue we have tried the following.
Tried used different versions of Apache-Common 1.3.2 OR 1.3 OR 1.2.x etc...
Instead of using the maven we have directly uploaded the .jar file inside the lib folder and updated dependency section as well.
None of above worked so far.
Here is the POM.XML file:
<?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.atlassian.tutorial</groupId>
<artifactId>myPlugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<organization>
<name>Atlassian SDK Tutorial</name>
<url>http://developer.atlassian.com/</url>
</organization>
<name>myPlugin</name>
<description>This is the com.atlassian.tutorial:myPlugin plugin for Atlassian JIRA.</description>
<packaging>atlassian-plugin</packaging>
<dependencies>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</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>
</dependency>
-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</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>com.atlassian.activeobjects</groupId>
<artifactId>activeobjects-plugin</artifactId>
<version>1.2.3</version>
<scope>provided</scope>
</dependency>
<!-- <dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>1.3</version>
</dependency>-->
<!--<dependency>
<groupId>info.bliki.wiki</groupId>
<artifactId>bliki-core</artifactId>
<version>3.0.19</version>
</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>
<!-- 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>
</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>
-->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<!--<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.2</version>
<scope>provided</scope>
</dependency>-->
<dependency>
<artifactId>commons-fileupload</artifactId>
<groupId>commons-fileupload</groupId>
<version>1.3.2</version>
<scope>system</scope>
<systemPath>${basedir}/lib/commons-fileupload-1.3.2.jar</systemPath>
<extractDependencies>false</extractDependencies>
</dependency>
<dependency>
<groupId>com.atlassian.templaterenderer</groupId>
<artifactId>atlassian-template-renderer-api</artifactId>
<version>1.3.1</version>
<scope>provided</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 class="atlassian tut"></com>orial.myPlugin.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>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<fork>true</fork>
<executable>C:\Program Files\Java\jdk1.8.0_151\bin\javac</executable>
</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>
</plugins>
</build>
<properties>
<jira.version>7.5.0</jira.version>
<amps.version>6.3.6</amps.version>
<jdkLevel>1.8</jdkLevel>
<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>
<template.renderer.version>1.3.1</template.renderer.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
We need guidance for troubleshooting/resolving above explained issue.
This looks like a 3rd party library. So you need to change your scope from provided to compile -
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.2</version>
<scope>compile</scope>
</dependency>
By specifying <scope>compile</scope>, you tell the SDK that the commons-fileupload library is needed at compile time and runtime. The SDK will bundle the commons-fileupload library into your plugin, and the plugin system will make it available in the plugin classloader when the plugin is started.
More details - https://developer.atlassian.com/docs/getting-started/working-with-the-pom/managing-dependencies
I'm facing problems when I'm trying to deploy my war file to the openshift repository.
The error is:
Could not resolve dependencies for project ... the following artifacts could not be found:
All these external jar's are included in the WEB-INF folder of my project and I've also tried to add a local repository but still no luck.
Can anyone help me with this please?
Image of error
here is my pom.xml
<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>SussolWebservice</groupId>
<artifactId>SussolWebservice</artifactId>
<version>ROOT</version>
<packaging>war</packaging>
<properties>
<spring.version>4.0.1.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version> <!-- makesure correct version here -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<artifactId>ecj</artifactId>
<version>4.4.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>weka</groupId>
<artifactId>weka</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\weka.jar</systemPath>
</dependency>
<dependency>
<groupId>opencsv</groupId>
<artifactId>opencsv</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\opencsv-3.7.jar</systemPath>
</dependency>
<dependency>
<groupId>logging</groupId>
<artifactId>logging</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\slf4j-log4j12-1.7.1.jar</systemPath>
</dependency>
<dependency>
<groupId>log</groupId>
<artifactId>log</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\slf4j-api-1.7.1.jar</systemPath>
</dependency>
<dependency>
<groupId>loggger</groupId>
<artifactId>logger</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\log4j-1.2.17.jar</systemPath>
</dependency>
<dependency>
<groupId>packagemgr</groupId>
<artifactId>packagemgr</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\packageManager.jar</systemPath>
</dependency>
<dependency>
<groupId>SOM</groupId>
<artifactId>SOM</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\SelfOrganizingMap.jar</systemPath>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
I have checked your pom and found some dependencies with scope system, which means your JDK or container provides those jar's at a location you provide in the pom.
From the documentation:
system
This scope is similar to provided except that you have to
provide the JAR which contains it explicitly. The artifact is always
available and is not looked up in a repository.
provided
This is much like compile, but indicates you expect the JDK
or a container to provide the dependency at runtime. For example, when
building a web application for the Java Enterprise Edition, you would
set the dependency on the Servlet API and related Java EE APIs to
scope provided because the web container provides those classes. This
scope is only available on the compilation and test classpath, and is
not transitive.
More information here:
https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
It is very likely openshift has no files like those provided as systempath's in your POM.
You can do one of the following:
Remove scope & system path from you depedencies, this way the
default (Compile) scope will be used and those jar's will be
included in your project.
Store the jar files you need in a folder on your openshift server (app-root/data, for example) and refer to that folder in your pom.
If you are using Tomcat, and all your applications running on this Tomcat are using the libraries you want to share, you can always store your shared libs in: tomcat-dir/common/lib (don't forget to change your scope to "provided" in this case).
As shown in following screenshot - the project SDK and language level are 1.8:
And I went through all of the project modules: they are all likewise defined as 1.8. One of them is shown below:
Yet somehow IJ attached a language level of 1.4 to one of the modules
But actually .. it is not even that straightforward. E.g. the intellisense thinks 1.4:
But when I click on the java.lang.String underlined in red, it DOES go to 1.8:
The pom.xml for the culprit module 'icloud' makes no mention of any java level - so it is not to blame:
<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>
<parent>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-parent</artifactId>
<version>1</version>
<relativePath>../../parent</relativePath>
</parent>
<artifactId>ignite-cloud</artifactId>
<version>1.1.3-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds</groupId>
<artifactId>jclouds-allcompute</artifactId>
<version>${jcloud.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds.labs</groupId>
<artifactId>google-compute-engine</artifactId>
<version>${jcloud.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds.labs</groupId>
<artifactId>docker</artifactId>
<version>${jcloud.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds.provider</groupId>
<artifactId>cloudsigma-zrh</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
I have done Build|Rebuild twice. Also have done
mvn clean package
from command line twice. This is just a big time sink (/waste). So then: why is IJ sabotaging this module - and is there a workaround?
Add a the compiler plugin to pom.xml and reimport the pom will solve this issue
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
The problem was that intellij could not handle the examples subproject being
underneath a parent directory containing the main parent project
but the directory is its own self contained project with no relation to the parent
The workaround is to create an entirely independent project for the examples module.
The other suggested answer - about adding the compiler plugin - made no difference.