Unable to load the mojo-incompability - maven

Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.2:repackage (repackage) on project MyEXE_Spring_REST_JPA: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:3.0.2:repackage failed: Unable to load the mojo 'repackage' in the plugin 'org.springframework.boot:spring-boot-maven-plugin:3.0.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/springframework/boot/maven/RepackageMojo has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
im trying to "run as" > "maven build.." but when i run it, it gives me this type of error, i tried to update the maven or install it..But it doesnt look like the error is changing

Related

Dependencies outside of Apache NiFi must not use SNAPSHOT versions

I'm new to NiFi and I'm trying to develop my first custom processor.
I'm following documentation(s)/tutorial(s) on how to create one, and here I am:
generated maven skeleton project for nifi-processor; (✔)
added some simple implementation in the onTrigger(...) method; (✔)
failing to build .nar. (x)
Whenever I'm executing mvn clean package either within any sub-directory of the custom processor project structure (nifi-artifactBaseName-nar or nifi-artifactBaseName-processors) or in the root directory of the project, I get this:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce (enforce-maven-version) on project nifi-myfirstcustomrprocessor-nar:
[ERROR] Rule 3: org.apache.maven.enforcer.rules.dependency.RequireReleaseDeps failed with message:
[ERROR] Dependencies outside of Apache NiFi must not use SNAPSHOT versions
[ERROR] com.giorgi.tutorials:nifi-myfirstcustomrprocessor-nar:nar:1.0-SNAPSHOT
[ERROR] com.giorgi.tutorials:nifi-myfirstcustomrprocessor-processors:jar:1.0-SNAPSHOT <--- is not a release dependency
Anything I'm doing wrong? any help?
Solved.
When creating a custom processor project (or just any maven project), version 1.0-SNAPSHOT is generated by default (disregarding of whether you create it from command-line, IDE, or etc.), and that's NOT OK for NiFi custom processor - you should NOT use SNAPSHOT for versioning your custom processor artifact.
I just changed 1.0-SNAPSHOT to 1.0 and everything worked fine - .nar has been built.

Java 11 with gradle: must specify an absolute path but is ${tools.jar}

We are moving from Java 8 to 11 on a project using jaxb. As it has been removed from the JDK, it has to be included separately, which I have done via gradle config:
compile("javax.xml.bind:jaxb-api:2.2.11")
compile("com.sun.xml.bind:jaxb-core:2.2.11")
compile("com.sun.xml.bind:jaxb-impl:2.2.11")
I am able to run the project, however compileJava gradle job throws errors:
Errors occurred while build effective model from C:\Users\.\.gradle\caches\modules-2\files-2.1\com.sun.xml.bind\jaxb-core\2.2.11\db0f76866c6b1e50084e03ee8cf9ce6b19becdb3\jaxb-core-2.2.11.pom:
'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} in com.sun.xml.bind:jaxb-core:2.2.11
Errors occurred while build effective model from C:\Users\.\.gradle\caches\modules-2\files-2.1\com.sun.xml.bind\jaxb-impl\2.2.11\2d4b554997fd01d1a2233b1529b22fc9ecc0cf5c\jaxb-impl-2.2.11.pom:
'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} in com.sun.xml.bind:jaxb-impl:2.2.11
The job finishes and there is a jar created, however when run on production server it stops with this error:
java.lang.NoClassDefFoundError: javax/xml/bind/Unmarshaller$Listener
I'm using Spring Boot v1.5.6 and gradle 4.8.1
The solution is to use a newer version of the jaxb libraries. 2.3.0 is no longer using tools.jar.

Maven issue while Building for a latest fix given by WSO2

WSO2 has given a latest fix for Governance Registry5.3.0(Governance REST API Update issue). While building a code for applying a fix the below error is thrown.
Error when building code using Maven.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project org.wso2.carbon.governance.api: Compilation failure: Compilation failure:
[ERROR] \Users\a596500\Downloads\carbon-governance-master\components\governance\org.wso2.carbon.governance.api\src\main\java\org\wso2\carbon\governance\api\util\CheckpointTimeUtils.java:[22,30] error: package org.apache.commons.lang does not exist
[ERROR] Failed to execute goal on project org.wso2.carbon.governance.api: Could not resolve dependencies for projectorg.wso2.carbon.governance:org.wso2.carbon.governance.api:bundle:4.7.2-SNAPSHOT: The following artifacts could not beresolved: org.wso2.carbon.registry:org.wso2.carbon.registry.extensions:jar:4.6.1-SNAPSHOT, org.wso2.carbon.registry:org.wso2.carbon.registry.common:jar:4.6.1-SNAPSHOT, org.wso2.carbon.registry:org.wso2.carbon.registry.admin.api:jar:4.6.1-SNAPSHOT
org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:jar:4.6.1-SNAPSHOT: Could not find artifact org.wso2.carbon.registry:org.wso2.carbon.registry.extensions:jar:4.6.1-SNAPSHOT in nexuspro-level0 (https://repo.fmr.com/content/groups/level0/)
Please clone below repos, Move to the relevant tag and run an mvn clean install -e on each and every repo accordingly.
https://github.com/wso2/carbon4-kernel.git tag : 4.4.7
https://github.com/wso2/carbon-registry.git tag : 4.6.0
https://github.com/wso2/carbon-governance.git tag : 4.7.1
https://github.com/wso2/carbon-governance-extensions.git tag : 4.5.2
https://github.com/wso2/jaggery-extensions.git tag : 1.5.5
https://github.com/wso2/carbon-store tag : 2.4.6
https://github.com/wso2/product-greg.git tag : 5.3.0
To apply the fix and generate the latest jar you have to apply the fix manually to 5.3.0 tag from your local machine and build the source.

Download latest release from Artifactory with Gradle

Artifactory has a feature of their API where you can download the latest release of a jar file (See http://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-RetrieveLatestArtifact).
Their example is:
GET http://localhost:8080/artifactory/ivy-local/org/acme/[RELEASE]/acme-[RELEASE].jar
I'm working on a project where all builds get published and I want to grab the jar from the last one. So what I'm looking for is a dependency like this in gradle:
compile "org.acme:acme:1.0.0.9.[RELEASE]"
This fails due to escaping of the square brackets so I tried:
compile "org.acme:acme:1.0.0.9.%5BRELEASE%5D"
This seems to allow gradle/ivy to find the file but it fails because the .pom file version does not match what is defined.
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':project:compile'.
> Could not resolve org.acme:acme:1.0.0.9.%5BRELEASE%5D.
Required by:
org.acme:acme:unspecified
> Could not resolve org.acme:acme:1.0.0.9.%5BRELEASE%5D.
> inconsistent module metadata found. Descriptor: CachedResource: /Users/xxxx/.gradle/caches/artifacts-26/filestore/org.acme/acme/1.0.0.9.%5BRELEASE%5D/pom/3986d9c1a27873ce92c0dbd089fc1ca9618f8c1a/acme-1.0.0.9.%5BRELEASE%5D.pom for http://localhost/artifactory/org/acme/acme/1.0.0.9.%5BRELEASE%5D/acme-1.0.0.9.%5BRELEASE%5D.pom Errors: bad version: expected='1.0.0.9.%5BRELEASE%5D' found='1.0.0.9.80'
Is there any way to get gradle and ivy to pull the latest release from artifactory?
I was able to get this working using the ivy syntax:
compile "org.acme:acme:1.0.0.9.+"
This solves the problem I have but I never did manage to get it working using the Artifactory [RELEASE] url.

Hudson build error: LifecycleExecutionException Unable to locate the Javac Compiler in

I created a dynamic web project in eclipse for a web service with axis2. I then converted it into Maven project, I'm able to compile and generate war file in eclipse, but when i deploy it on server and try to build it with Hudson-3.0.0 it gives me following error:
mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.3.2(default-compile)
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project WebServices: Compilation failure
Unable to locate the Javac Compiler in:
C:\Program Files (x86)\Java\jre6..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
Please Let me know what's wrong with it!
I have exactly the same problem, ever since I upgraded Hudson from 2.2.1 to 3.0.1.
Both JAVA_HOME environment variable and JDK in hudson configuration point to JDK and not to JRE.
If I run mvn compile in the workspace directory of the job, everything works well.
Looks like the hudson cannot find java_home.
In hudson settings java.home property is set correctly ?
Does any other java projects builds successfully ?
Did you do what the exception said yet?
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
Sounds like you don't have Java installed. So install it.

Resources