I did some more testing and discovered mvn -X...

So I used mvn -X compile and mvn -X install to check the differences (it seems 
that the IDE 'Build' action uses the install goal).

I found that only with the install goal the recompilation of my module is 
triggered by this dependency:
[DEBUG] New dependency detected: 
D:\JeromeDocs\NetBeansProjects\JJazzLab\modules\Guava\target\org-jjazz-guava-1.0-SNAPSHOT.jar

This is just a library wrapper module for the Guava lib, which is built first 
by the reactor plugin. Guava is a dependency of most of the modules, hence the 
general recompilation. 

So how should I change the my guava module (pom below) to avoid this 
recompilation with the install goal ?  


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.jjazzlab</groupId>
        <artifactId>jjazzlab-parent</artifactId>
        <version>1.0-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
    <artifactId>org-jjazz-guava</artifactId>
    <name>Guava</name>
    <packaging>nbm</packaging>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.netbeans.utilities</groupId>
                <artifactId>nbm-maven-plugin</artifactId>
                <configuration>
                    <publicPackages>                      
                        
<publicPackage>com.google.common.annotations</publicPackage>
                        <publicPackage>com.google.common.base</publicPackage>
                        
<publicPackage>com.google.common.base.internal</publicPackage>
                        <publicPackage>com.google.common.cache</publicPackage>
                        <publicPackage>com.google.common.collect</publicPackage>
                        <publicPackage>com.google.common.escape</publicPackage>
                        
<publicPackage>com.google.common.eventbus</publicPackage>
                        <publicPackage>com.google.common.graph</publicPackage>
                        <publicPackage>com.google.common.hash</publicPackage>
                        <publicPackage>com.google.common.html</publicPackage>
                        <publicPackage>com.google.common.io</publicPackage>
                        <publicPackage>com.google.common.math</publicPackage>
                        <publicPackage>com.google.common.net</publicPackage>
                        
<publicPackage>com.google.common.primitives</publicPackage>
                        <publicPackage>com.google.common.reflect</publicPackage>
                        
<publicPackage>com.google.common.util.concurrent</publicPackage>
                        
<publicPackage>com.google.common.util.concurrent.internal</publicPackage>
                        <publicPackage>com.google.common.xml</publicPackage>
                        
<publicPackage>com.google.thirdparty.publicsuffix</publicPackage>
                    </publicPackages>
                </configuration>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>23.6-jre</version>
        </dependency>
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
</project>



Jerome



    Le lundi 22 mai 2023 à 11:48:50 UTC+2, Eric Barboni <sk...@apache.org> a 
écrit :  
 
 
Hi,

  

Maven will build all children, but should be faster on the compilation plugin 
part you should have something like that :

Nothing to compile - all classes are up to date.

  

Best Regards

Eric

  

De : Jerome Lelasseux <lelass...@yahoo.com.INVALID> 
Envoyé : vendredi 19 mai 2023 21:04
À : NetBeans Mailing List <users@netbeans.apache.org>
Objet : Why Maven build app always recompiles ?

  

On my NB platform app, if I open a single module and build it, it recompiles 
only when source files are modified, as expected.

  

But when I run Build on the parent project, maven always recompiles all 
modules. Is it normal ?

  

Jerome

  

App is here https://github.com/jjazzboss/JJazzLabTemp

  

  
  

Reply via email to