How to test executable Maven Jar file through any web server? - maven

I just created a maven project and did all the procedure to create a maven build. Then I exported that maven project as the jar file. I want to test the same jar. How could I achieve this with anyone of the web server like TomEE, JBoss?
Thanks in advance

Why not packagong a war instead of a jar? Then just drop it in the webapps/deploy folder of the server and start

Related

Spring Boot with Maven Install vs Eclipse Export WAR

I hardly use Maven.The only time for me to use it is for maintaining my web app dependencies.
Now I started to develop web app using Spring Boot. I notice when I run Maven install, a WAR file will be created in the target folder. Then I export WAR using File > Export on my STS IDE and compare the two wars. The size of the 2 files are different. How can this be ? Also, the WAR file created from Maven runs fine on standalone Tomcat 7 while the exported war from Eclipse (STS) doesn't.
What am I missing here ?
It's reasonable to assume that WTP (File > Export > Web etc) would produce a different WAR file from the maven build. Maven build may have plugins applied to the build to produce the desired WAR file. Check your POM file carefully and check if there are any maven plugins used in the build.
Now, I don't exactly know how Eclipse WTP component produces their WAR file (Export WAR file is not from STS - it's Eclipse WebToolsProject) from the project. There might be options in the export wizard to play around with or some configuration file in your project. You'd better off asking that on the Eclipse forum: https://eclipse.org/forums/index.php?t=thread&frm_id=88
Hope this helps.

Use of spring-boot-maven-plugin

While creating a spring boot project I define property in pom.xml as <packaging>war</packaging> with which I can create a war and thereafter deploy the war into server maybe tomcat or WAS.
But I came across a plugin named spring-boot-maven-plugin whose documentation states that it's use is to package executable jar or war archives and run an application in-place.
My query is why do we need this at all ?
If my packaging can tell me what to create and then can deploy it to run, what is the used of this plugin.
I am trying to understand a new project so wanted to be sure that every line makes sense
The maven plugin will create an "executable" archive. In the case of the war packaging, you would be able to execute your app with java -jar my-app.war. If you intend to deploy your Spring Boot application in an existing Servlet container, then this plugin is, indeed, not necessary.
The maven plugin does more things like running your app from the shell or creating build information.
Check the documentation
The Spring Boot Maven Plugin provides Spring Boot support in Apache Maven, letting you package executable jar or war archives and run an application “in-place”.
Refer this - https://www.javaguides.net/2019/02/use-of-spring-boot-maven-plugin-with.html

Maven JBOSS application deployment

I followed this tutorial http://www.mastertheboss.com/jboss-maven/jboss-maven-example-building-a-java-ee-6-application/ in order to have a simple web application to better understand Java EE and JBOSS. I set up the example project (by archetype) and compiled it.
However, I am stuck after running mvn compile. I want to deploy my application as a war file to my JBOSS webroot directory (in my case /usr/share/jboss-as/standalone/deployments/).
I think mvn package and mvn install must be executed. Where can I specify that I want a war file and that it should be copied to my deployment location on JBOSS?
Obviously, I can use the jboss maven plugin http://docs.jboss.org/jbossas/7/plugins/maven/latest/, which is addressed via console
jboss-as:deploy
Configuration is read from the POM file.

How to use jetty-runner to deploy a war file which is not using maven

Hi recently i heard that we can use jetty-runner to deploy a war file.But my question is can we use this to deploy a war file which uses no maven.Can we use jetty-runner to deploy any war files.
jetty-runner is separate from maven, you just need to point at a war file
http://blogs.webtide.com/janb/entry/jetty_runner
cheers

How do I deploy ejb jar in TomEE

M exploring openejb 4 beta with TomEE, could anyone explain how I deploy ejb jar on TomEE? I'm using it for testing purposes. Also, is it possible to configure tomee in eclipse and debug through ejbs??
Thanks in advance.
There are several scenarios for using EJB through the TOMEE(included OpenEJB), if you have an EAR file (consists of JARs and WAR) for deployment you need first active the APP folder in installed(means copied) TOMEE folder then you just drop your EAR file into APP folder and TOMEE unpack it and will be deployed properly.

Resources