Build Deployment basics - java

I am more into UI dev and less into Java...So, I would like to understand what exactly does the following things mean;
1. Build Deploy (Is it just a folder coped to a server and if yes, are there only class files in there,...)
2. What does exploded build mean?
If someone could explain me in very easy language (and not extremely technical), that would be really great...
Also any online resources in simple language would be helpful..
Thank you.

Build Deploy
Build deploy process will include many things such as
a) Checking the server configurations like database configurations, server resources configurations etc.
b) Checking the Application Configurations , means any changes in the application related configuration files.
c) Deplying the code on to the server
during this process server will read up the deployment descritor and deploy the application based on the configuration provided in DD xml (web.xml)
Also it deploy the ejb modules based on the configuration provided in ejb-jar.xml

Build Deploy
You build your application into some packaging and deploy it on the server.
for example if its web app you pack it in war file and put this war file on the server webapp for tomcat (dir differs from server to server) and start the server to deploy it.

Related

Can I deploy multiple WAR archive files to local Tomcat with IntelliJ IDEA?

I have two applications with two separate WAR artifacts. One is a WAR exploded directory for my front-end Angular app, and one is a WAR archive file for my back-end Spring REST api. I'm currently using IntelliJ IDEA to deploy my front-end to a local Tomcat server and was wondering how, if at all possible, I could configure IntelliJ to run my two artifacts on Tomcat simultaneously. I know I can do this by putting both under Tomcat webapps directory manually, but I was wondering if it was configurable in IntelliJ, and if so, how?
Yes, you should be able to do that.
If you are using Ultimate, you can create a "Local Tomcat" run
configuration in Project1, and go to the "Deployment" tab and drop in
the WAR file for your Project1. Then drop in the WAR file from your
other project (call it Project2) as an External Source. You would
then have both WARs in one run configuration.
This is the answer I found out under this link.

maven deployment of configuration information to tomcat

In my current development/deployment workflow I deploy my (Java/Spring) web apps to a remote tomcat containers by using the tomcat7 maven plugin.
This makes easy for me to simply deploy the new version of my app by invoking
mvn tomcat7:deploy
My specific problem now is how to correctly handle configuration information: at the moment I keep configuration information (db connection info, passwords, etc.) in .properties files which are packaged with my war and then deployed remotely to the container as described above. An improvement of this process is the use of maven profiles to include different versions of .properties for different target deploy environments.
The problem with this approach is that sentitive information (eg. passwords) are packaged with the war file, while I would prefer to have them somewhere else on the server, visible to the web app (e.g. as part of its classpath), but manageable independently (so as to allow a change in some config settings withouth having to rebuild/redeploy the app).
The only solution I've found so far for this implies the following steps:
1) do not include the .properties in the packaged war
2) deploy the war to the remote server with mvn tomcat7:deploy
3) manually copy the .properties on some server folders where they are accessible from the web app via classpath
In step 3) "manually" means not using maven-based mechanisms for this step. Can someone suggest me some mechanism through which both the packaged war and the configuration files can be separately deployed to a remote server (for instance some ?
For example , you can do this :
1. Create module_config.zip with maven-assembly-plugin contains : *.properties
2. Deploy war with mvn tomcat7:deploy
3. Start script to copy module_config > dir_deploy_application
4. ReStart tomcat7
You can do it with (sh script) or (jenkins)

Is there a way to deploy a Maven project with "jar" packaging into Tomcat7?

My project generates a Jar as the output package and uses an external War file, available on our Artifactory, as the Web Application to be deployed on Tomcat (currently using version 7). This War file contains all libs and modules required for the application to run.
I have already packaged and ran those projects outside eclipse on a "vanilla" Tomcat installation. In this scenario, the Jar my project generates is loaded on the context.xml file this way:
<Loader className="org.apache.catalina.loader.VirtualWebappLoader" virtualClasspath="/home/igor/workspace/myapp/myapp-2.4.3.jar"/>
Is there a way I can deploy this project on Tomcat using Eclipse and still be able to debug it? Can I use the Jar generated for this purpose or do I have to deploy the workspace project?
As for the War file, do (or can) I have to add it as an dependency?
Thanks in advance!
EDIT
We actually provide an Web Framework, which is packaged as a war. Other applications that use that framework are exported as jars and loaded into the framework through the context file as cited above.
Your question is confusing probably because of your custom plugin/classloader and deployment which is sort of orthogonal to debugging.
What I recommend is you keep whatever system you have to build/package/deploy and use JVM remote debugging. That is do not use the Eclipse WTP since you seem to have custom steps for deployment but rather build your code deploy & run a separate Tomcat instance and then run the remote debugger in Eclipse.
You will get some hotcode swapping with this method but not as much as something like JRebel.. (which you could use also) it will certainly be better than constantly redeploying.

Deploy a war file in the application?

I am trying to integrate the monitoring tool JAMon into my current Spring application. Everything is fine except I don't know how to establish the monitoring information on UI or log file. What is more confusing, is from here
under the section "Setting up the JAMonAppender - Default Behaviour", I see this line:
Install JAMon.war in your application, so you can view your Log4J
statistics and log records.
is there anyway that I can install a war file in current application or there is something wrong with above description?
My understanding is the war file should deployed in an application server. Can I use it as a dependency?
My understanding is the war file should deployed in an application
server. Can I use it as a dependency?
Any WAR file must be deployed in an application container. It cannot be used as a dependency. For your sake, you missed point 1, where you can download the API with all its dependencies here.

How does IntelliJ automatically deploy the webapp in tomcat?

How does IntelliJ automatically deploy the webapp in tomcat?
Just wondering as after the webapp has been deployed and run, there are no traces of the web app in the tomcat folder. (Not even the servlet classes' files).
Does it create those file and delete straight after execution?
Thanks in advance.
IntelliJ is deploying the exploded WAR which exists in your compilation target directory (for my project, it's target - it could be out for yours, depends on if you're using Maven or some other dependency management application), in the process explained at this Wiki link.
So, the artifact always exists in your target or out directory. If it didn't exist, then Tomcat would pitch a fit.

Categories

Resources