I decided to split a dynamic web application into two dynamic web applications, a core part and project specific part. If I run maven I get a JAR-file for the core-project due to its pom.xml.
However, with WTP I don't seem to be able to convince Eclipse to deploy the core project as a JAR-file. If I edit the target filename in the project's "Deployment Assembly" from blah.war
to blah.jar
, close and reopen the project properties it's a WAR-file again.
So I decided to try to make the core project a web fragment module (I hadn't noticed it when I split the original project).开发者_开发问答 If I deselect "Dynamic Web Module" and select "Web Fragment Module" in the project facets I'm not allowed to click "Apply" or "OK" as they are greyed out.
What do I do now? In the end I want WTP to write a JAR-file of the core project to the lib-folder of the web-app.
EDIT:
I created a new Web Fragment Project and tried to find the obvious differences to my dynamic web project. The only obvious difference was in .settings/org.eclipse.wst.common.project.facet.core.xml
as it was
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.6"/>
<installed facet="jst.web" version="2.4"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
and is now:
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="java"/>
<fixed facet="jst.webfragment"/>
<installed facet="java" version="1.6"/>
<installed facet="jst.webfragment" version="3.0"/>
</faceted-project>
Is it correct to overwrite that file and assume everything else is still working as designed (speaking of Eclipse here)? I noticed that Eclipse now suggests a JAR-file now in the "Deployment Assembly" and also creates it, but just because that is working doesn't necessarily mean that I didn't break anything else.
Since I haven't had any problems and nobody argued I guess my described way of doing this has worked.
精彩评论