IntelliJ Jetty plugin does not extract war - intellij-idea

I'm using IJ Ultimate 2020.3 and trying to set up a Jetty Server run configuration.
AFAIK, in order to start Jetty with a war artifact it is needed to be located in $JETTY_HOME/webapps directory.
But, it looks like the Jetty plugin of my IJ refuses to copy the war (exploded, or any other) artifact to that directory, which lead the Jetty server to fail.
I was able to start the Jetty server (from IJ) only after manually copying the war file into the webapps directory, so looks like the only problem is the 'copy' step.
Any ideas?

IntelliJ IDEA doesn't copy the artifact into webapps, instead it instructs Jetty to load the artifact directly from the location that you have configured as the artifact output directory.
Artifact used for deployment:
Artifact output directory:
Startup logs showing that artifact is loaded directory from its output directory and not from webapps:

Thanks #CrazyCoder, this is a progress for me.
problem is that my output console suggests that it does not search for the artifact in the location it is set:

Related

Where is the war file built in Intellij IDEA, located?

I'm using IntelliJ IDEA and I'm building and deploying the web-application project every time I'm running it. All of this happens magically within IntelliJ IDEA.
However, now I'm supposed to manually deploy it on a test server's wildfly, so I need an artifact file (WAR or EAR) to drop in the standalone/deployments directory on the test server's running WildFly10.
I can't for the life of me find where IntelliJ Idea exports the WAR / EAR artifacts so I could copy paste it to the said directory on the test server. Any help is appreciated.
Please follow the steps :
Click on Edit Configurations.
Click on Deployment and add your artifact.
Apply these changes.
You can see a Build Artifacts under Build.
Click on Build Artifacts and it will create a war/jar to the respective folder.
If I'm wrong somewhere let me know.

How to make a war file auto deploy?

How do you make a war file auto deploy?
The server component is glassfish and the database is created in MySQL. Do I need to create an executable file that will extract the war file? and how to do it so?
It should be sufficient to copy/move your WAR file to the following folder:
$GLASSFISH_HOME/glassfish/domains/domain1/autodeploy
(You may change the domain name if you are using a different one.)
See also:
How to to autodeploy war file with GlassFish
WAR doesn't get redeployed in Glassfish from autodeploy
Oracle GlassFish Server 3.0.1 Quick Start Guide - Deploying and Undeploying Applications

How to set working directory in Intellij for jetty launcher?

By default Intellij jetty launcher sets working directory as jetty installation dir.
I need it to be project base directory because I use relative paths in the code.
If you create a maven goal jetty:run then your working directory will be the directory for that maven module.

Intellij IDEA: Server Configuration cannot be run cause file does not yet exist. Use maven goal result as artifact?

until now I deployed to a Glassfish server with the default IntelliJ artifact "Web Application: Archive". Now my built process got a bit more complicated with maven modifying several files.
In the glassfish configuration under Deployment, I substituted the Artifact to deploy with the direct war file and put the maven goal in "Before Launch: Another Configuration"
However, if mvn clean was run the war does not exist and I cannot run the configuration (because the external file doesn't exist).
Can I avoid having to run mvn package once manually? E.g. by making the output of a maven goal an Artifact?
Thanks!

How does Intellij deploy to JBoss?

I finally have my application in IntelliJ and deploying to JBoss. I'd like to get hot deploy working but it looks like I need to understand how IntelliJ and JBoss interact.
When I build my project in IntelliJ and then start JBoss, the ear file does not appear in the deploy directory so I assume that there is some magic that IntelliJ does so that JBoss reads from a different folder. What is happening during this step?
Thanks :)
I know this is an old and apparently answered question, but unfortunately the links provided in the accepted answer didn't give me the simple details I was looking for. For anyone also trying to understand how IntelliJ IDEA deploys your exploded war to JBoss without copying files to the deployments folder, here's what I've found while deploying locally from IDEA 14 (EAP) to JBoss 7.1.1.Final:
After you've created an "exploded war" artifact for your project (or it has automatically been created for you), IDEA will build your provided sources and place the output in the directory set in the artifact options (you can change this setting to place the output inside the deployments folder inside your jboss installation).
IDEA will update your JBoss configuration file (/standalone/configuration/standalone.xml) and add a "deployment" node inside the deployments section. This entry simply defines a name, a runtime name and the exploded war root folder for your project, which will point to the output directory of your artifact set in IDEA.
When JBoss is started (either manually or from your run/debug configuration in IDEA), it will automatically deploy your artifact. Be warned that if your files are in the output directory of your project and you clean it, JBoss will still try to find the directory, thus encountering errors in your next attempt to start it: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to mount deployment content, Failed to process phase STRUCTURE of deployment and java.io.FileNotFoundException to name a few.
Please refer to the documentation.
Basically, you need an exploded Artifact configuration with the directory name ending with .ear.
Build | Make performs hot deployment as well as Update action (which is configurable and can update only resources, resources and classes, optionally redeploy or restart the server).
Instead of copying your application to JBoss, IDEA runs it with appropriate parameters so that it uses Artifact directory instead. Configuration is very flexible and you can just change the artifact directory location to reside under JBoss directory.