How to fix PluginincompatibleException? - java

I am trying to build a project in Netbeans from Maven Central. When I first tried to build the project there were a number of error messages because plugins didn't have versions specified in the POM. I fixed those problems.
I am running the latest version of Maven 3.5.0. I specified in the POM the latest version of the plugin. Here is the related section of the POM complete with the version number I added.
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.2.2</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
<execution>
<id>validate-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<excludeProperties>
<excludeProperty>git.build.*</excludeProperty>
<excludeProperty>git.commit.user.email</excludeProperty>
<excludeProperty>git.commit.message.*</excludeProperty>
<excludeProperty>git.commit.id.describe</excludeProperty>
<excludeProperty>git.commit.user.name</excludeProperty>
<excludeProperty>git.remote.origin.url</excludeProperty>
<excludeProperty>git.commit.id.abbrev</excludeProperty>
<excludeProperty>git.closest.tag.name</excludeProperty>
<excludeProperty>git.closest.tag.commit.count</excludeProperty>
<excludeProperty>git.remote.origin.url</excludeProperty>
</excludeProperties>
</configuration>
</plugin>
I now get the follow fatal error:
cd D:\darren\My Documents\NetBeansProjects\XBee-API; "JAVA_HOME=D:\\Program Files\\Java\\jdk1.8.0_121" cmd /c "\"\"D:\\Program Files\\Java\\NetBeans 8.2\\java\\maven\\bin\\mvn.bat\" -Dmaven.ext.class.path=\"D:\\Program Files\\Java\\NetBeans 8.2\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 install\""
Scanning for projects...
Inspecting build with total of 1 modules...
Installing Nexus Staging features:
... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
------------------------------------------------------------------------
Building com.rapplogic:xbee-api 0.9.2
------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin/2.2.2/git-commit-id-plugin-2.2.2.pom
log4j:WARN No appenders could be found for logger (org.apache.maven.wagon.providers.http.httpclient.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
Downloaded: http://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin/2.2.2/git-commit-id-plugin-2.2.2.pom (13 KB at 25.6 KB/sec)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1.729s
Finished at: Tue Jul 04 22:15:49 NZST 2017
Final Memory: 14M/245M
------------------------------------------------------------------------
Failed to execute goal pl.project13.maven:git-commit-id-plugin:2.2.2:revision (get-the-git-infos) on project xbee-api: The plugin pl.project13.maven:git-commit-id-plugin:2.2.2 requires Maven version [3.1.1,) -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginIncompatibleException
The Wiki help page is no help. There is no obvious way to resolve this problem and clear the error.

Related

com.sun.tools.xjc.maven2 giving No XSD files found even though xsd exist (java 11)

I am upgrading from java 8 to java 11. I'm attempting to use jaxb2-maven plugin to convert XSD files into java classes. when i run "mvn clean install" i get the below compile error
[INFO] Ignored given or default sources [xsd/dummy.xsd], since it is not an existent file or directory.
[INFO] Ignored given or default sources [xsd/MessageProcessingAck.xsd], since it is not an existent file or directory.
[WARNING] No XSD files found. Please check your plugin configuration.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.216 s
[INFO] Finished at: 2022-11-10T19:13:17-08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:2.4:xjc (Acknowledgement notification XML/WSDL binding) on project dsched-integration-ackn: : MojoExecutionException: NoSchemasException -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
my pom.xml
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>Acknowledgement notification XML/WSDL binding</id>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<schemaDirectory>src/main/resources/</schemaDirectory>
<outputDirectory>${basedir}/target/generated/</outputDirectory>
<packageName>com.dgp.ds.ackn.ws.send.acknowledgement</packageName>
<sources>
<source>xsd/MessageProcessingAck.xsd</source>
</sources>
<args>-wsdl -b ${basedir}/src/main/resources/xsd/</args>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
I have tried following the directions from these posts. I still got the same error
Maven jaxb2:xjc failing to generate code
the above post is mostly dealing with a lower version that is not compatible with most of my dependencies
https://artofcode.wordpress.com/2019/02/26/jaxb2-maven-plugin-2-4-and-java-11/
This post did not have any effect, both XSD were still not found
I was able to resolve this issue by using the below plugins
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.15.1</version>
....
</build>

Build fail Heroku java

I have issue deploy project java. i configed pom.xml version jar 11 and mvn 3.8.1. I build success project in local so when i deployed in heroku. What I need to do?
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.8.4/plexus-compiler-javac-2.8.4.jar (21 kB at 211 kB/s)
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 149 source files to /tmp/build_740f92f8/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.581 s
[INFO] Finished at: 2022-10-14T02:29:49Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project NCKHSV: Fatal error compiling: invalid flag: --release -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
! ERROR: Failed to build app with Maven
We're sorry this build is failing! If you can't find the issue in application code,
please submit a ticket so we can help: https://help.heroku.com/
! Push rejected, failed to compile Java app.
! Push failed
The problem is heroku currently using Java 8: Heroku Java versions
The indicator is this line:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project NCKHSV: Fatal error compiling: invalid flag: --release -> [Help 1]
I've encountered this problem when building maven application with target is Java 11 but running JDK is Java 8. I can't help with heroku since I haven't used it yet
At heroku you could really use the configurations in your pom.xml below,
please look carefully. :)
please check maven-plugin mentioned in pom.xml under <project>
I have something like this below.
...
<packaging>maven-plugin</packaging>
</project>
Futher more please check this plugin you could replace the below plugin code and modify as per your need. It can be added under build->plugins->THIS_PLUGIN
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.4</version>
<configuration>
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>default-descriptor</id>
<phase>process-classes</phase>
</execution>
<execution>
<id>help-descriptor</id>
<phase>process-classes</phase>
</execution>
<execution>
<id>mojo-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
Also please add the below dependency in your pom.xml, under ```dependencies-> THIS DEPENDENCY
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.7.4</version>
</dependency>
I hope, it helps!

Resolution will not be attempted until the update interval of company_repository has elapsed or updates are forced

I already have seen answers to this problems several time and I tried them too.
I am trying to use grooy-all and groovy-maven-plugin in my project and the dependencies in pom.xml is:
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-all</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>Kryst-reports-flex</id>
<phase>prepare-package</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<scriptpath>
<element>src/main/resources</element>
</scriptpath>
<source>ReportsAssembly.buildFlex(ant, project)
</source>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<executions>
<execution>
<id>Kryst-reports-flex</id>
<phase>prepare-package</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<scriptpath>
<element>src/main/resources</element>
</scriptpath>
<source>ReportsAssembly.buildFlex(ant, project)
</source>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.5.2</version>
</dependency>
</dependencies>
</plugin>
I am getting error when I am trying to do mvn package or mvn install on this project. The error is:
Failure to find org.codehaus.gmaven:groovy-all:jar:2.5.2 in http://myrepo:9090/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of Z-nexus-public has elapsed or updates are forced pom.xml /cockpit-repo line 1 Maven Configuration Problem
I tried to do mvn clean install -U and right click on project -> Maven -> update project with Update snapshots.
But nothing has worked till now.
Could anyone please help me regarding this?
Thanks in advance
PS: I tried mvn dependency:purge-local-repository clean install . It also gives error:
INFO] Downloading from : http://myrepo:9090/nexus/content/groups/public/org/codehaus/gmaven/groovy-maven-plugin/maven-metadata.xml
[INFO] Downloading from : http://myrepo:9090/nexus/content/groups/public-snapshots/org/codehaus/gmaven/groovy-maven-plugin/maven-metadata.xml
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/gmaven/groovy-maven-plugin/maven-metadata.xml
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/gmaven/groovy-maven-plugin/maven-metadata.xml (368 B at 1.0 kB/s)
[INFO] Downloaded from : http://myrepo:9090/nexus/content/groups/public/org/codehaus/gmaven/groovy-maven-plugin/maven-metadata.xml (368 B at 511 B/s)
[INFO]
[INFO] ---------------< com.zetes.crystal:cockpit-reports-flex >---------------
[INFO] Building Cockpit reports Flex components 3.2.1-MB-18
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from : http://myrepo:9090/nexus/content/groups/public/org/codehaus/gmaven/groovy-all/2.5.2/groovy-all-2.5.2.pom
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/gmaven/groovy-all/2.5.2/groovy-all-2.5.2.pom
[WARNING] The POM for org.codehaus.gmaven:groovy-all:jar:2.5.2 is missing, no dependency information available
[INFO] Downloading from : http://myrepo:9090/nexus/content/groups/public/org/codehaus/gmaven/groovy-all/2.5.2/groovy-all-2.5.2.jar
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/gmaven/groovy-all/2.5.2/groovy-all-2.5.2.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.816 s
[INFO] Finished at: 2018-08-30T14:25:55+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.codehaus.gmaven:groovy-all:2.5.2 or one of its dependencies could not be resolved: Could not find artifact org.codehaus.gmaven:groovy-all:jar:2.5.2 in Z-nexus-public (http://myrepo:9090/nexus/content/groups/public) -> [Help 1]
First try a forced update:
mvn clean install -U
If the forced update does not work there IS something wrong.
Check the following things:
Broken local artifacts - go to you local maven repository and search for the artifact and delete the folder. (in win usually under C:\Documents and Settings{your-username}.m2, in linux ~/.m2)
Is the artifact ACTUALLY on the repo, check spelling, version, everything!
Is the connection to the repo possible, watchout for proxy settings!

Maven add javadoc

I'm working in a Maven multimodule project and I'm not able to download javadocs for some dependencies. I'll describe my failed attempts:
I'm working with Netbeans so the first option was Right click in Dependencies -> Download Javadocs and some javadocs were dowoloaded but some other not.
Next option was to use mvn eclipse:eclipse but the result was the same (some javadocs were still missing). Also I saw that mvn eclipse plugin is deprecated
Last option was to use mvn dependency:resolve -Dclassifier=javadoc but the result is the same
I configured the maven-javadoc-plugin in my pom.xml but nothing happens. The configuration is the following:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
I don't want to use this option because implies a manual downloading. The third option gave me the following output:
[INFO] The following files have NOT been resolved:
[INFO] dom4j:dom4j:jar:javadoc:1.6.1:test
[INFO] org.jboss:jandex:jar:javadoc:1.1.0.Final:test
[INFO] org.hibernate:hibernate-entitymanager:jar:javadoc:4.3.1.Final:test
[INFO] org.hibernate:hibernate-validator:jar:javadoc:5.2.4.Final:provided
[INFO] xml-apis:xml-apis:jar:javadoc:1.0.b2:test
[INFO] org.hibernate.common:hibernate-commons-annotations:jar:javadoc:4.0.4.Final:test
[INFO] org.hibernate:hibernate-core:jar:javadoc:4.3.1.Final:test
[INFO] antlr:antlr:jar:javadoc:2.7.7:test
[INFO] javax.activation:activation:jar:javadoc:1.1:provided
Any help is appreciated, also if someone tells me that there's no other option but to install the artifacts manually.
Thanks in advance.

Cobertura Checks Fail on Travis CI

In my Maven build, I use Cobertura to check that there is a certain minimal coverage:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<check>
<branchRate>100</branchRate>
</check>
</configuration>
<executions>
<execution>
<goals>
<goal>cobertura</goal>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
When running mvn install, this works fine. However, in Travis CI, the build fails because Travis first runs mvn install -DskipTests=true to get the dependencies. Obviously, when tests are skipped, there is no coverage, and therefore the whole build fails:
[ERROR] ch.trick17.betterchecks.fluent.StringCheck failed check. Branch coverage rate of 0.0% is below 100.0%
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
...
[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.5.2:check (default) on project better-checks-core: Coverage check failed. See messages above. -> [Help 1]
Can I somehow configure Cobertura to skip the check if tests are skipped? Or is there any other solution, maybe on the Travis side?
Here is my .travis.yml file:
language: java
jdk:
- openjdk6
- openjdk7
- oraclejdk7
- oraclejdk8
script: "mvn install"
You can turn that of by using: install: true which skips the install step.
As an alternative to kmarbaise's answer, instead of completely turning off the install step, you can replace customize it so that it skips the Cobertura check:
install: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dcobertura.skip=true -B -V
This way, the output of your actual build script will not be cluttered with output from downloading the dependencies and Maven plugins.

Categories

Resources