NetBeans 7.3.1 has the nice ability of doing an incremental deploy of e.g. JSF pages to a Glassfish server which makes changes visible almost immediately.
This features does not seem to work for a remote Glassfish 4 instance, though: Whenever I save nothing else happens in the logfiles and when I hit "Run", it runs the Maven "war:war" goal and then deploys the .war to the remote server using "asadmin".
Does anybody know if that's a "documented" limitation or if I just do something wrong? (JRebel would probably help, I know, but I hope to get it done without. Maybe it only works if NetBeans can directly write to a local $domain/autodeploy/ directory but that's only a guess)
My project uses the following NetBeans Project Properties:
- Build -> Compile -> Compile On Save: for both app and test
- Run -> Java EE Version: Java EE 6 Web
- Run -> Deploy On Save: checked
The pom.xml contains the following relevant plugin:
<profiles>
<!-- References deployment settings in ~/.m2/settings.xml -->
<profile>
<id>devel-pom-build-profile</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>profile</name>
<value>webmanager-bl-devel-settings-profile</value>
</property>
</activation>
</profile>
....
</profiles>
...
<build>
<plugins>
...
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<version>2.1</version>
<configuration>
<terse>false</terse>
<echo>true</echo>
<debug>true</debug>
<glassfishDirectory>${glassfish.glassfishDirectory}</glassfishDirectory>
<user>${glassfish.user}</user>
<adminPassword>${glassfish.adminPassword}</adminPassword>
<domain>
<name>${glassfish.domain.name}</name>
<host>${glassfish.domain.host}</host>
<adminPort>${glassfish.domain.adminPort}</adminPort>
</domain>
<components>
<component>
<name>${project.artifactId}</name>
<artifact>${project.build.directory}/${project.build.finalName}.war</artifact>
</component>
</components>
</configuration>
<executions>
<execution>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
All other questions I found here were either about the general way of deploying the app which I've done with the maven-glassfish-plugin or seem to refer to older versions of NetBeans which did not yet have the "deploy on save" feature in the Project Settings. (But correct me if I missed one)