Community
Participate
Working Groups
Driver: RC1 After a Web module has been added to the Tomcat 5.0 server, if other classes are added to the Web module, when we called server.getServerPublishState() IServer.PUBLISH_STATE_NONE is returned even though the new classes had not been "published" to the .metadata/org.eclipse.wst.server.core temporary publish area. See bug 119140 for more history for this bug.
I think we've had some miscommunication - getServerPublishState() is spec'd to only return a difference when server-level resources have changed, e.g. the server configuration. There are corresponding getModulePublishState(IModule[]) methods to check whether a specific module needs to be published. You can't tell whether a publish needs to be kicked off unless you've checked all of these. The quick fix is for you to change: server.getServerPublishState(); to: ((Server) server).shouldPublish(); Yes, you'll get a warning because this is not on the public API. This method checks all of the getXyzPublishState() methods to determine if a publish is required. I can easily add it to the public API for 1.5.
Since Tim also pointed out that we should be calling: shouldRestart = ((Server)server).shouldRestart(); instead of, shouldRestart = server.getServerRestartState(); we also need shouldRestart (currently internal) to be in the public API as well.
Updating summary to "Add shouldPublish() and shouldRestart() to API"
API added and released to 2.0 stream.
Tim, what are the new APIs to use?
The methods are still called shouldPublish() and shouldRestart(). They've just been promoted to IServer.
Closing as fixed since M3. If this was closed in error, please reopen.
New Gerrit change created: https://git.eclipse.org/r/108030
New Gerrit change created: https://git.eclipse.org/r/108029
New Gerrit change created: https://git.eclipse.org/r/109666
Gerrit change https://git.eclipse.org/r/109666 was merged to [master]. Commit: http://git.eclipse.org/c/servertools/webtools.servertools.git/commit/?id=f139ff49caef68eecf758f82052a0a543f6b7af3