Closed devanpedrik closed 3 weeks ago
Doing a full publish prompt error message but still manage to deploy war.
which is the same error message shown when clicking terminate server. Also if I may get a clarify on some of the feature provided.
To be clarified:
1) A full publish will copy over every file in the module to the deployment directory, and will tell the server to re-deploy the module by renaming the creating a file with a .dodeploy suffix. An incremental publish will only re-publish the changed files. If the changed file is a jsp or html file, it should be picked up by the server immediately. If the changed file is a class file or a descriptor file that links to dependencies, the change may only be picked up if the server was started in debug mode or if you restart the server after that. The RSP will generally attempt to check it the changed file is a class file in order to trigger the dodeploy functionality.
2) Stopping the server attempts to issue a stop command, typically by running the shutdown jar as a new process with the proper command line arguments to shut down the server. A terminate will attempt to kill the process, if it has a reference to it.
The biggest problem these tools face is what workspace files or folders are being deployed. Typically, you do not tell the UI to deploy a given project in its entirety, because the project layout is different than the deployed layout. The project layout, for example, often includes folders like src
or other paths that will eventually be mapped into some other folder.
So, users typically tell the UI to deploy something like the target/MyWebapp1.war
folder. The problem is, this folder is only regenerated when you run a maven command. So changing a source .java file will generally not affect the target folder at all. If you have vscode-java
installed, the incremental builder will generally try to compile Your.java into bin/Your.class
, but, again, this file is in the bin
folder (or other output folder) and is not part of the assembled project structure inside the target
folder.
To work around this, you can give your project a mapping file as shown here: https://github.com/redhat-developer/vscode-rsp-ui/?tab=readme-ov-file#provisional-project-structure-details
To summarize, you can add a file named .rsp/rsp.assembly.json
at the root of your project, and this file will map your source folders to where, in the assembled war output, it belongs. Then, the RSP incremental publisher will know that when you change src/Your.java
, and the vscode-java extension automatically compiles that into bin/Your.class', the class file should then further be copied into
/WEB-INF/classes/` in the output war.
It's worth noting that the linked example does not include a bin
folder example. So that would be something like:
{
"source-path": "bin/",
"deploy-path": "/WEB-INF/classes/"
},
The workaround listed indicates how to properly use the tool to get the desired results.
I am running a maven project with SLF4J for wildfly 26. It seems that when I add LOGGER.info and such, it does not output the LOGGER into the console until I run the mvn clean install command on my project and restarting the server.
I have tried running wildfly with the same configuration on eclipse and the logger is shown in the console as expected so I don't think there are anything wrong with the SLF4J setup in the wildfly configuration. So I wonder if the server does not republish automatically like eclipse does and is that the supposed function for async publish provided in the setting.
Process for clarity:
Other issue that I faced:
Also some side question,
What actually happen for vscode is that it'll generate a ISDEPLOYING FILE then it'll turned into DEPLOYED FILE if it is successfully deployed. But seems like the .war file still contain the older version of the files and not the latest unlike what is happening for eclipse. When I open the DEPLOYED FILE seems like it is not a package and contain the text of the .war deployed. Notice the time frame difference between the ISDEPLOYING FILE and DEPLOYED FILE too.
I am quite new to these, please be patient with me.