Error:java: release version 5 not supported - maven

I have a maven project in IntelliJ IDEA;
When I run the test using mvn test everything is fine, but when I use
the green arrow on IntelliJ IDEA I got this error: Error:java: release version 5 not supported

Go to: File->Project structure->Project and configure Project SDK to 1.8

It is a common error in IntelliJ.
Try adding
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
to your POM file.
Or:
update Java Compiler
update SDK version

Related

The import com.xom.dm.mulesoft.AbstractInputTransformer cannot be resolved

I am new to the Mulesoft and Java. We have a Mule application in Mule 3.9.1, jdk8 and Maven 3.8.4. I am getting below errors could you please help to resolve the Anypoint Studio setup issues.
The import com.xom.dm.mulesoft.AbstractInputTransformer cannot be resolved
The method getFunctionalMap(String) of type PlannerGroupsInputTransformer must override a superclass method
Unable to find type 'org.mule.module.apikit.exception.NotFoundException'
<modelVersion>4.0.0</modelVersion>
<groupId>com.xom.dm.project</groupId>
<artifactId>dm-10-notifications</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule</packaging>
<name>Mule Application</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<mule.version>3.9.1</mule.version>
<mule.tools.version>1.2</mule.tools.version>
<munit.version>1.3.8</munit.version>
<mule.munit.support.version>3.9.1</mule.munit.support.version>
<service.instance>${instance}</service.instance>
</properties>
I have tried changing build path and jre libraries... nothing works.
Probably the project is not correctly configured to build with Anypoint Studio 6 built-in Maven support. That you are trying to configure manually the build path is a tip that something is wrong for a Maven based project. Studio should configure the build path automatically from the pom. You must not change it manually. Read the documentation pages for that feature that I shared above and all its child pages to learn how to use a Maven project correctly in Studio 6.

Maven release plugin

Hi Meier I have used the following goal
mvn org.codehaus.mojo:versions-maven-plugin:2.7:update-property -
Dproperty=emom.web.dependency.shr.version -DallowSnapshots=true
My Job B pom.xml is
<dependency>
<groupId>com.safeway.app</groupId>
<artifactId>emom-shr</artifactId>
<version>${emom.web.dependency.shr.version}</version>
</dependency>
Under the properties it has version harcoded
<emom.web.dependency.shr.version>19.6.5-
SNAPSHOT</emom.web.dependency.shr.version>
My Job A pom.xml
<groupId>com.safeway.app</groupId>
<artifactId>emom-shr</artifactId>
<version>20.1.0-SNAPSHOT</version>
<packaging>jar</packaging>
When I run the above goal maven is picking the latest version i,e(20.1.0)
from artifactory but when I check the pom.xml of Job B under properties it still says 19.6.5 I need a way to change the 19.6.5 or current version to latest version available. Am I doing something wrong not able to figure it out.
You need versions:update-property to update the content of properties in your POM.
See https://www.mojohaus.org/versions-maven-plugin/update-property-mojo.html

creating Spring boot starter project

When i create my spring Boot starter project im getting error as maven configuration problem. Please help me to solve.
enter image description here
Similar Bug was reported in eclipse: https://bugs.eclipse.org/bugs/show_bug.cgi?id=547340
You can fix this by temporary downgrading the maven jar plugin version to 3.1.1 from 3.1.2. Add this to the properties section:
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
In your pom.xml
<properties>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>
Update: A fix has been released. Click Help > Check for updates in Eclipse/STS and install the newest m2e connector.

maven - remove -SNAPSHOT from properties tag in pom.xml

The parent pom.xml of my application contains the following snippet:
...
<version>2.0-SNAPSHOT</version>
...
<properties>
<property.version>1.0-SNAPSHOT</property.version>
</properties>
Essentially, I would like to update both the -SNAPSHOT versions to release versions. i.e., I want my resultant pom.xml to be like:
...
<version>2.0</version>
...
<properties>
<property.version>1.0</property.version>
</properties>
[Note: v1.0 of <property.version> is not yet deployed to the artifactory and also might not be the latest version available
There might exist more properties with SNAPSHOT versions that I do not want to update to release versions]
I figured out a way to update the <version> using maven versions:set plugin. However, I could not find any solution for updating the version (by removing -SNAPSHOT) inside the <properties> tag.
I've looked at documentations for versions:update-properties, versions:update-property.
I am trying to achieve this by using the mvn versions plugin, otherwise I would have to write a script (eg. shell) which would parse and do the needful.

Intellij not detecting appropriate Java version in Tycho/Maven build

I'm trying to migrate a Tycho/Maven project from Eclipse PDE to Intellij and i'm having trouble getting Intellij to use the appropriate java source versions. In particular, my MANIFEST.MF has Bundle-RequiredExecutionEnvironment: JavaSE-1.7, and my tycho-compiler-plugin has configuration -> [source|target] both equal to 1.7. The modules are imported into Intellij as maven projects with an OSGI facet.
Whenever I reimport the poms for the modules, it sets the language-level in the module to 1.5, which I understand to be the default. Where does Intellij pick op the project language level for these projects such that I can get it to detect the one I'd like?
Got same problem. Solved with adding to pom.xml:
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>

Resources