war

Create a JAR containing classes and resources from webapp using Gradle

谁说胖子不能爱 提交于 2020-01-03 09:04:20
问题 I would like to create a jar from the contents of a WAR using gradle. The result I want is quite like what the archiveClasses = true setting of maven-war-plugin does. I understand that the gradle war plugin doesn't seem to do this (as per this stackoverflow question). Is there a way to do this manually? Say by manipulating the gradle jar task to collect the required parts from the WEB-INF folder? When I just use the default jar task it doesn't get the resources from the WEB-INF directory. The

How to add facets to an IntelliJ Java/Gradle project to create a self-sufficient war

五迷三道 提交于 2020-01-03 04:24:07
问题 Background Download and install IntelliJ 12.04 Community Edition Create project from external source (point to Gradle build script) Specify JDK 7 as project's SDK Note: Project is open source at github: Netflix/karyon Problem Want to simply war the project. In playing on the commercial version with GAE plugin installed, I was able to specify the Web Application facet, and create the war via the artifact functionality. With the setup described above, the only available facet is Android.

Generating WAR and EAR artifacts inside the same Gradle project

删除回忆录丶 提交于 2020-01-02 05:46:20
问题 Suppose that I have a Gradle web project with a standard web project layout src/main/webapp . Project myproject-web , build.gradle : apply plugin: 'java' apply plugin: 'eclipse-wtp' apply plugin: 'war' I know that I can wrap the resulting .war file generated by myproject-web inside an .ear if I define a secondary project (say, myproject-ear ) which applies the ear plugin and references myproject-web as a dependency: Project myproject-ear , build.gradle : deploy project(':myproject-web') I

Running a web application (WAR) with embedded jetty server

穿精又带淫゛_ 提交于 2020-01-01 09:24:10
问题 I have made a very basic web application that has only one html page. I exported it as a war. Now I created an embedded jetty server. public class SimplestServer { public static void main(String[] args) throws Exception{ Server server = new Server(8000); WebAppContext webapp = new WebAppContext(); webapp.setContextPath("/"); webapp.setWar("C:\\Users\\User\\Desktop\\jetty\\JettyWar.war"); server.setHandler(webapp); server.start(); server.join(); } } I created a jar for this embedded server.

maven WAR plugin skips resources?

北城余情 提交于 2020-01-01 04:55:31
问题 Now this is downright bizarre: I have a number of folders/files I want copied into my WAR, here's the relevant part of the POM: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webResources> <resource><directory>../common-web-content/src/main/resources</directory></resource> <resource><directory>../pqm-web-content/src/main/resources</directory><filtering>true</filtering></resource> <resource><directory>../common-presentation/src

Spring MVC Maven Modules

本秂侑毒 提交于 2019-12-31 07:39:09
问题 Let's say that I want to have 3 maven modules: parent login webapp I want to have Java classes & jsp files in both modules (login & webapp). My workaround partially works, it builds one WAR file, web pages are rendered, looks fine, but when I try to use API (interfaces from login module) in webapp module - classes can not be found. I think that something is wrong with POM files. POMs are almost the same, the main difference between login & webapp poms - that webapp has dependency with login.

Tomcat unable to find jsp in war file

人走茶凉 提交于 2019-12-31 01:25:30
问题 I recently switched one of my static html files to a Spring controller that uses a JSP to render its view. I use jetty to test locally and local testing shows the page rendering fine. Upon deploying to our test server, which uses Tomcat 6.0.26, I get the following exception: javax.servlet.ServletException: Could not get RequestDispatcher for [/WEB-INF/jsp/index.jsp]: check that this file exists within your WAR org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel

Java WAR - Load Spring beans from an external JAR

强颜欢笑 提交于 2019-12-30 10:05:03
问题 I would like to load inside my Spring MVC Web Application (packaged as WAR) some Spring framework beans annotated with @Service from an external jar, which is in charge of accessing a database and located in the classpath under /WEB-INF/lib. If possible, it would be desirable to load them automatically using the @Autowired annotation. I have followed successfully the solution in this link1: this.ctx = new ClassPathXmlApplicationContext("services-context.xml"); this.myAService = ctx.getBean(

Deploy WAR in embedded Tomcat 7

会有一股神秘感。 提交于 2019-12-29 06:13:54
问题 I currently need to create a server in order to run a number of unit test. To simplify this process I would like to embed Tomcat into my code and load an instance of Tomcat (which in turn loads my WAR file) before running the unit test (using the @BeforeClass notation). My issue is how can I deploy my WAR file into the embedded Tomcat? As you might notice I cannot use the tomcat maven plugin since I want it to run with the automated tests. 回答1: This code works with Tomcat 8.0: File

Deploy WAR in embedded Tomcat 7

折月煮酒 提交于 2019-12-29 06:13:07
问题 I currently need to create a server in order to run a number of unit test. To simplify this process I would like to embed Tomcat into my code and load an instance of Tomcat (which in turn loads my WAR file) before running the unit test (using the @BeforeClass notation). My issue is how can I deploy my WAR file into the embedded Tomcat? As you might notice I cannot use the tomcat maven plugin since I want it to run with the automated tests. 回答1: This code works with Tomcat 8.0: File