NetBeans omits compiling the Widgetset

Everything was working ok, until Netbeans (and the vaadin-maven-plugin) decided not to detect module changes when compiling the widgetset. So it doesn’t build, and the application fails to start.

The problem is that I am not that good at maven related issues, and don’t know where to start… My knowledge is limited to adding and removing dependencies (addons and project related libraries mostly) and in Netbeans ‘Clean and Build…’ fires a widgetset rebuild.

But now not anymore.

As a start tried to clean Netbean’s cache, but that didn’t solve it.

Can anybody help please? Where can I find the precise maven goals involved and execute them from Netbeans?

Thanks in advance,

Carlos Conti.

Let me add the POM.xml to see if that sheds some light…

<?xml version="1.0" encoding="UTF-8"?> 4.0.0
<groupId>com.sofia</groupId>
<artifactId>Ui</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>Ui</name>

<properties>
    <vaadin.version>7.5.3</vaadin.version>
    <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
    <jetty.plugin.version>9.2.3.v20140905</jetty.plugin.version>
    <project.source.version>1.7</project.source.version>
    <project.target.version>1.7</project.target.version>
    <project.encoding>UTF-8</project.encoding>
 <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
</properties>

<repositories>
    <repository>
        <id>vaadin-addons</id>
        <url>http://maven.vaadin.com/vaadin-addons</url>
    </repository>
    <repository>
        <id>vaadin-snapshots</id>
        <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
            <repository>
                <id>vaadin-releases</id>
                <url>http://oss.sonatype.org/content/repositories/vaadin-releases</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
</repositories>
    

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-bom</artifactId>
            <version>${vaadin.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
            <dependency>
                <groupId>org.vaadin.addons</groupId>
                <artifactId>contextmenu</artifactId>
                <version>4.5</version>
             </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-server</artifactId>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-push</artifactId>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-client</artifactId>
        <scope>provided</scope>
    </dependency>
    <!--
      Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory).
      
      For widgetset compilation, vaadin-client-compiler is automatically added on the
      compilation classpath by vaadin-maven-plugin so normally there is no need for an
      explicit dependency.
    -->
    <!--
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-client-compiler</artifactId>
        <scope>provided</scope>
    </dependency>
    -->
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-themes</artifactId>
    </dependency>
            <dependency>
                <groupId>org.vaadin.addon</groupId>
                <artifactId>easyuploads</artifactId>
                <version>7.4.2</version>
             </dependency>
             <dependency>
                <groupId>org.vaadin.addons</groupId>
                <artifactId>imageviewer</artifactId>
                <version>0.5.1.v7</version>
             </dependency>
             <dependency>
                <groupId>org.vaadin.addons</groupId>
                <artifactId>dom</artifactId>
                <version>0.1.0</version>
             </dependency>
             <dependency>
                <groupId>com.vaadin.tapio</groupId>
                <artifactId>googlemaps</artifactId>
                <version>1.1.2</version>
             </dependency>
 <dependency>
  <groupId>${project.groupId}</groupId>
  <artifactId>Model</artifactId>
  <version>${project.version}</version>
  <exclusions>
   <exclusion>
    <groupId>eclipse</groupId>
    <artifactId>jdtcore</artifactId>
   </exclusion>
  </exclusions>
 </dependency>
 <dependency>
  <groupId>com.twilio.sdk</groupId>
  <artifactId>twilio-java-sdk</artifactId>
  <version>3.3.10</version>
 </dependency>
     <dependency>
        <groupId>com.reveregroup.gwt</groupId>
        <artifactId>gwt-image-loader</artifactId>
        <version>1.1.4</version>
    </dependency>
 <dependency>
  <groupId>com.vaadin</groupId>
  <artifactId>vaadin-client-compiler</artifactId>
  <version>7.5.3</version>
 </dependency>
 <dependency>
  <groupId>log4j</groupId>
  <artifactId>log4j</artifactId>
  <version>1.2.16</version>
 </dependency>
 <dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>1.6.4</version>
 </dependency>
 <dependency>
  <groupId>com.vaadin.addon</groupId>
  <artifactId>vaadin-charts</artifactId>
  <version>2.1-SNAPSHOT</version>
 </dependency>
</dependencies>

<build>
        <resources>
        <resource>
            <directory>
                src/main/java/com/sofia/ui/view/alltogether
            </directory>
            <targetPath>
                com/sofia/ui/view/alltogether
            </targetPath>
        </resource>
        </resources>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.0</version>
            <configuration>
                <encoding>${project.build.sourceEncoding}</encoding>
                <source>${project.source.version}</source>
                <target>${project.target.version}</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <encoding>${project.build.sourceEncoding}</encoding>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.3</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
                <!-- Exclude some unnecessary files generated by the GWT compiler. -->
                <packagingExcludes>WEB-INF/classes/VAADIN/gwt-unitCache/**,
                    WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>${vaadin.plugin.version}</version>
            <configuration>
                <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                <webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory>
                <draftCompile>false</draftCompile>
                <compileReport>false</compileReport>
                <style>OBF</style>
                <strict>true</strict>
             <runTarget>http://localhost:8080/Ui</runTarget>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>update-widgetset</goal>
                        <goal>compile</goal>
                        <!-- disabled by default to use on-the-fly theme compilation -->
                        <!-- <goal>compile-theme</goal> -->
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.4</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <version>2.6.1</version>
            <!-- Clean up also any pre-compiled themes -->
            <configuration>
                <filesets>
                    <fileset>
                        <directory>src/main/webapp/VAADIN/themes</directory>
                        <includes>
                            <include>**/styles.css</include>
                            <include>**/styles.scss.cache</include>
                        </includes>
                    </fileset>
                </filesets>
            </configuration>
        </plugin>

        <!-- The Jetty plugin allows us to easily test the development build by
            running jetty:run on the command line. -->
        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>${jetty.plugin.version}</version>
            <configuration>
                <scanIntervalSeconds>2</scanIntervalSeconds>
            </configuration>
        </plugin>
    </plugins>

    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
            <!-- TODO Remove when http://dev.vaadin.com/ticket/14924 is resolved -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>com.vaadin</groupId>
                                    <artifactId>
                                        vaadin-maven-plugin
                                    </artifactId>
                                    <versionRange>[7.1.11,)</versionRange>
                                    <goals>
                                        <goal>resources</goal>
                                        <goal>update-widgetset</goal>
                                        <goal>compile</goal>
                                        <goal>compile-theme</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

</build>

To anyone this may interest, the problem was that presumably something got broken. The solution was to force the compilation of the widgetset which I had to specify manually, like this:

<plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>${vaadin.plugin.version}</version>
                <configuration>
                    <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                    <webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory>
                    <draftCompile>false</draftCompile>
                    <compileReport>false</compileReport>
                    <style>OBF</style>
                    <strict>true</strict>
                                        <runTarget>http://localhost:8080/Ui</runTarget>
                                        <modules>
                                            <module>com.sofia.ui.MyAppWidgetset</module>
                                        </modules>
                 <force>true</force>
                </configuration>
...
</plugin>


Once done, I could comment out the modules and the force tags, and the widgetset compilation returned to compile successfully only when needed and automatically.

Hope this helps someone.

Carlos.