This blog post shows how to publish a Java Servlet, encapsulated in a WAR file, to an Azure Web Site using FTP via Maven.
The first step will be to generate a simple servlet using Maven:
1 mvn archetype:generate -DgroupId=com.example -DartifactId=hello-world -DarchetypeArtifactId=maven-archetype-webapp This creates a simple, Hello World application in the hello-world directory. We can verify it works by running it in a local servlet container using the instructions found in Supporting mvn jetty:run in Maven applications.
Read more...
When I’m writing a Java servlet using Maven, I find it convenient to be able to run the Java servlet in a local servlet container for testing purposes. This is very easy to do using the Jetty Maven plugin.
To add the Jetty Maven plugin to your project, modify pom.xml as follows:
1 2 3 4 5 6 7 8 9 10 <build> <plugins> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.2.0.M0</version> </plugin> ... </plugins> </build> You can then run your project in Jetty using the following command:
Read more...