jandex icon indicating copy to clipboard operation
jandex copied to clipboard

Skip Plugin Execution on packaging type pom

Open Neoministein opened this issue 11 months ago • 1 comments

Hey, I am currently working on a multi module maven project. I've added jandex-maven-plugin to the root pom.xml of the project to have it executed on all sub modules.

The 'problem' now is that is also executes on the root project and generates an jandex.idx file.

Since projects with packaging type pom don't have a compile phase there isn't really anything to index. My idea would be to skip the execution if no other FileSet is configured.

Example:

public void execute() throws MojoExecutionException {
    if (processDefaultFileSet && "pom".equals(mavenProject.getPackaging())) {    
        getLog().info("Jandex execution skipped");
        return;
}

Neoministein avatar Mar 08 '24 17:03 Neoministein