Java classpath for dynamic web project

Hi everyone, I have a very rare problem that needs to be solved.

Problem / Question:

I have a dynamic web project that is already built, and I have a war file for this project.

I need to apply some settings on top of the war file provided to me.

Using maven or ant, I can compile the user code I wrote and the ability to add the created class files to the war file.

But this happens to build the final war.

when I want to check my code in eclipse. the war file created and deployed in the jboss plugin contains only class files created from java files written by me ..........

Please help me how can I modify the .classpath file of my project so that the jboss publication can create a war file using a dependent war file that can be run on eclipse-jboss to check my user code ....

Thanks for the help.....

+4
source share
2 answers

Not a rare problem.

What you need to combine two web applications (wars) together. You have a customization warfare on which you need to overlay an existing web application.

It looks like you already solved it in terms of assembly and were looking for Eclipse support. To my knowledge, Eclipse does not have support for this. You probably need to manually complete the necessary configuration for this to happen.

+1
source

It seems strange to me to have two WAR files.

Perhaps you should consider packing your settings in a JAR and inserting this jar into the source WAR file.

Otherwise, another solution, and what I do often is to have three projects in your workspace.

  • PRJ-src (with your source sources / JAR / WAR)
  • PRJ-custo (which depends on the previous one); This project contains only new classes or custom spring xml files (with the introduction of my own classes
  • PRJ (merger of two previous projects)

I create an Ant task in a third project, which accepts the 1st project (PRJ-src) and combines with the second project (PRJ-custo). This should be possible with Maven.

Then this is the only project that I deploy on my application server (tomcat / jboss).

Hope this helps

+1
source

Source: https://habr.com/ru/post/1335036/


All Articles