I am currently trying to work with Codehaus Mojo Properties. I only found out about it this morning.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
</plugin>
So I cant say that I am an expert on it. But when trying to build a war file I keep getting:
Caused by: org.apache.maven.plugin.MojoFailureException: Circular property definition:
My plugin configuration is:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<inherited>true</inherited>
<executions>
<execution>
<id>read-pal-properties</id>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${project.basedir}\src\main\resources\system.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
A property that fails is:
webserver.websphere=WebSphere:cell=${webserver.cell},node=${webserver.node},server=${webserver.server}
I googled a bit about it, and saw that this is a known bug. So just wanted to see if there are other plugins that do that same job.
https://github.com/mojohaus/properties-maven-plugin/issues/27
Any help would be appreciated.
If you still haven't found the answer yet after >2years, use the 1.0-alpha-2 version
Related
Im using maven 3.8.3. Tryig to avoid the step of the default jar creation, using the answers I found in topics like:
remove jar created by default in maven
What is the best way to avoid maven-jar?
What I tried:
1.
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.3</version>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.3</version>
<executions>
<execution>
<id>default-jar</id>
<phase/>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
<configuration>
<finalName>unwanted</finalName>
<classifier>unwanted</classifier>
</configuration>
</execution>
</executions>
</plugin>
I also checked the solution of <packaging>pom</packaging> instead of jar. but I'm not sure this is the use case.
More details: This is a non-empty module, containing resources and generated unversioned java sources.
Solutins #1-#3 caused me the following error:
The packaging for this project did not assign a file to the build artifact.
Please assist, Thanks in advance.
I am using the javadoc maven plugin and it creates the correct javadoc package, but all classes are created twice.
Maven dependency:
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.0</version>
</dependency>
My build code
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Can anyone help me please, what am I missing here?
command usage for doc generation
mvn clean install -Dresources="FirstProject/example_API"
I noticed the same problem and came upon a solution after enabling debug on the maven-javadoc-plugin maven plugin and seeing what it's doing. Specifically setting the sourcepath as shown below fixed the double listing problem for me and I've tried this on multiple version of Corretto 8 as well as Temurin 8. All had the double listing problem because it's an issue with the javadoc tool itself but setting the sourcepath manually fixed it for me.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<debug>true</debug>
<sourcepath>${basedir}/src/main/java</sourcepath>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
There's a bug in recent versions of the Maven Javadoc Plugin. The bug is known as MJAVADOC-700. It is dead easy to reproduce.
Downgrading to version 3.2.0 of the plugin fixes the problem. Setting the sourcepath explicitly is an alternative fix.
Findbugs does not support jdk11, I have a project in which I have a dependency jar which uses findbugs.
https://github.com/gleclaire/findbugs-maven-plugin/issues/93
Although I don't have findbugs maven plugin in my project but due to the dependency jar, it still executes.
How can I stop it from executing, because it fails every time.
I tried with below, but doesn't work.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>${plugin.findbugs-maven-plugin.version}</version>
<configuration>
<excludeFilterFile>${project.basedir}/exclude-findbugs.xml</excludeFilterFile>
<failOnError>false</failOnError>
</configuration>
<executions>
<execution>
<goals>
<goal>findbugs</goal>
</goals>
<configuration>
<failOnError>false</failOnError>
<skip>true</skip>
</configuration>
</execution>
</executions>
</plugin>
Can someone please help me?
TIA
It worked by adding a skip tag as true. as below.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>${plugin.findbugs-maven-plugin.version}</version>
<configuration>
<excludeFilterFile>${project.basedir}/exclude-findbugs.xml</excludeFilterFile>
<skip>true</skip>
</configuration>
</plugin>
Hey guy's I'm posting this question having spent a good deal of time researching and not found a detailed answer. Currently I'm having an issue with generating sources from AWS Workflow. I'm using Maven apt-maven-plugin and aspectj-maven-plugin. These plugins both work for generating the client classes for the activities yet fail with the following error when running mvn clean package or mvn clean install against my workflow classes.
Error
[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-
plugin:1.7:compile (default) on project (myproject): Execution default
of goal org.codehaus.mojo:aspectj-maven-plugin:1.7:compile failed:
basedir (myproject)\target\generated-sources\annotations does not exist
-> [Help 1]
Plugins
<groupId>org.codehaus.mojo</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.0-alpha-5</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.7</version>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-flow-build-tools</artifactId>
</aspectLibrary>
</aspectLibraries>
<complianceLevel>1.7</complianceLevel>
<showWeaveInfo>true</showWeaveInfo>
<verbose>true</verbose>
<sources>
<source>
<basedir>${basedir}/target/generated-sources/annotations</basedir>
</source>
<source>
<basedir>src/main/java</basedir>
<includes>
<include>**/*.java</include>
</includes>
</source>
</sources>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
I'm not sure how to go about fixing this issue and any help would be great.
The error message is clear- mvn could not find /target/generated-sources/annotations, but in pom it is stated as the source for aspectj-maven-plugin.
Does your code intend to generate sources under /target/generated-sources/annotations? If yes, then there is issue with generation, you'll need to expose more of your pom for me to tell what went wrong. If no, why not remove this part and give it another shot.
<source>
<basedir>${basedir}/target/generated-sources/annotations</basedir>
</source>
ps: I'd rather put this as comment but I'm not able to :(
I have configured cobertura in a maven 3 project. My requirement is to configure cobertura in parent pom and configure the ignore, exclude values in child poms in multiple projects. The basic configuration of cobutura plugin in pom xml with reference to it in child pom worked fine. But when i tried to configure ignore, exclude packages in child pom and added instrument goal in parent pom, i'm getting directory issues with the plugin. Google search gave me this link, but not successful so far. : http://blog.bielu.com/2012/01/errata-to-maven2-maven3-migration.html
Here is my configuration:
Parent pom:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<check>
<haltOnFailure>true</haltOnFailure>
<branchRate>50</branchRate>
<lineRate>50</lineRate>
<haltOnFailure>true</haltOnFailure>
<totalBranchRate>50</totalBranchRate>
<totalLineRate>50</totalLineRate>
<packageLineRate>50</packageLineRate>
<packageBranchRate>50</packageBranchRate>
</check>
</configuration>
<executions>
<execution>
<id>instrument-code</id>
<phase>process-classes</phase>
<goals>
<goal>instrument</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
Child pom:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<configuration>
<instrumentation>
<ignores>
<ignore>to.ignore.*</ignore>
</ignores>
<excludes>
<exclude>to/exclude/*</exclude>
</excludes>
</instrumentation>
</configuration>
</plugin>
</plugins>
</build>
Error thrown:
[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.5.1:instrument (instrument-code) on project test: Unable to prepare instrumentation directory. source and destination are the same directory.
Tried several configuration, but no luck yet. Please advice me on this.
Thanks.