How to deploy web application to existing Jetty using Maven? - java

Using mvn tomcat7:deploy I can deploy a web application to Tomcat. But how can I do this with jetty? As far as I understand it, the Maven Jetty Plugin launches its own Jetty server but can I configure it to use my existing Jetty server?

You can use the Jetty Maven plugin with either the run-war or deploy-war tasks.
http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html#running-assembled-webapp-as-war

Related

Server required in eclipse for spring boot

I am new to spring boot and I would want to know the basics of it. I am creating a project with jHipster. When I install gulp on my system I can see the project running at port 9000. I however want to deploy the same application on my local using tomcat apache server.
Can I debug my code in java using the same server installed during the time of spring boot or do I need a separate server like apache?
From JHipster documentation "Profiles" :
If you're using Maven Wrapper (mvnw)
./mvnw package
If you're using Gradle Wrapper (mvnw)
./gradlew bootRepackage
Should produce WAR with development profile as
By default, JHipster will use the dev profile
I think you can deploy this WAR on your usual Tomcat

JBoss and IntelliJ - Use Jboss Plugin to run and deploy or use Maven

I am a newbie in setting up a Java EE application in IntelliJ. I manage to make it work and deploy it using the plain Run Configuraiton > JBoss settings. But I want to convert my project into a maven project. I would just like to ask the difference between:
(1)building and running a web/ear application using IntelliJ Jboss plugin and creating a server run configuration, and
(2)using maven + jboss maven plugin to build, deploy, and run the server
Can I use the features of the IntelliJ JBoss plugin if I deploy using maven instead (such as hotdeploy and viewing the output of the server directly in intellj)?
Thanks a lot!

How to deploy Java EE application using Jenkins CI?

I have Jenkins CI configured with a SVN repo of our Java EE based application.
I am able to build the application but I am facing problems while deploying the war. Actually I don't have any idea how to get a war file out of the build and deploy it to a remote Tomcat 7 server.
I need to deploy this code to Tomcat 7 in the form of a war deployment. Please guide me through any tutorial or docs.
If your build is Maven based, you could use the Maven Tomcat plugin. This will do more or less the same actions as the Jenkins Deploy plugin, but it will add a dependency on your build tool and not on your continuous integration tool.
There's a plugin for that: https://wiki.jenkins-ci.org/display/JENKINS/Deploy+Plugin
Basically, the deploy plugin will use tomcat's built in REST API/manager application to deploy the war file.
I use this in anger, and it's pretty simple. The plugin does everything you'll need for a simple situation.
If your needs are more complicated than this, you can script access to the management REST API directly, but I advise you to start with the plugin.

Jetty has been embedded in maven

when I use maven in my project, I dont install Jetty so is Jetty embedded in maven? how about others like Tomcat or glassfish
Maven itself does not embed Jetty.
There is this Maven plugin called: jetty-maven-plugin which embeds jetty for fast development lifecycle.
There is also a Tomcat Maven Plugin... you guessed it... it embeds tomcat... if you use the tomcat:run goal that is... it also has goals that will deploy to your own install of tomcat though so it does not limit itself to embedding.
I think there is a Glassfish Maven Plugin that does not embed glassfish but does provide goals to use an existing installation.
There is also the cargo maven plugin which can provision some containers and run application on those containers
Maven basically is a build tool, managing libraries and dependencies in a project. Jetty, Tomcat and Glassfish are Servlet Containers, that means Web Servers, that interact with Servlets (and Glassfish is even more, it's a full-featured Application Server).
That said, Maven does also download required libraries for you. I suppose Jetty is in your case among those libraries, so Maven "installs" it for you and even starts the Server when you run the project. More Info here for example:
http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
Tomcat and Glassfish would have to be installed manually as far as i know.

Maven embedded tomcat deploy war file

I'm using maven and the embedded tomcat through the tomcat-maven-plugin to run my Spring MVC project. Now I've got a another war file which I also want to run on this tomcat. Is there a way to achieve this? It doesn't seem to work, when I put the war file in the webapps folder of the embedded tomcat.
support of this feature is in snapshot version of the plugin see https://issues.apache.org/jira/browse/MTOMCAT-169

Categories