Hi,
I assume it's a basic question but I haven't found an suitable answer yet on
google/bing and the mail archive so maybe I'm completely on the wrong track. I
hope to receive some feedback.
Problem is: I have a war which should run Websphere and I also on jetty or
tomcat. The war contains a business.jar, which holds Spring configuration,
beans etc.
The spring configuration is a bit different on Websphere compared to the jetty
or tomcat one.
the spring configuration file application.xml imports a few resources:
<!-- Hibernate- and taskApplicationContext are profile dependent -->
<import resource="hibernateApplicationContext.xml" />
<import resource="txContext.xml" />
<import resource="daoApplicationContext.xml" />
<import resource="serviceApplicationContext.xml" />
<import resource="taskApplicationContext.xml" />
The maven-jar-plugin in the pom generates my business.jar which holds the
application.xml along with the remaining xml files. The two platform specific
files (Hibernate- and taskApplicationContext.xml) are contained in different
directories the rest is kept at the root of src/main/resources
[cut]\src\main\resources>c:\programs\usr\local\wbin\find . -type f
c:\programs\usr\local\wbin\find . -type f
.\applicationContext.xml
.\daoApplicationContext.xml
.\ehcache.xml
.\jetty\hibernateApplicationContext.xml
.\jetty\taskApplicationContext.xml
.\ldapApplicationContext.xml
.\serviceApplicationContext.xml
.\txContext.xml
.\websphere\hibernateApplicationContext.xml
.\websphere\taskApplicationContext.xml
in the pom I've defined 2 profiles, each defining appserver.include:
<profiles>
<profile>
<id>websphere</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<appserver.include>websphere</appserver.include>
</properties>
</profile>
<profile>
<id>jetty</id>
<activation>
<property>
<name>appserver</name>
<value>jetty</value>
</property>
</activation>
<properties>
<appserver.include>jetty</appserver.include>
</properties>
</profile>
</profiles>
In the maven-jar-plugin I do:
<configuration>
<includes>
<include>/${appserver.include}/*</include>
</includes>
</configuration>
which I hope includes all files in the src\main\resources + the two files from
either the websphere or jetty directory, but i'm wrong on this. The jar does
not contain anything apart from the META-INF directory.
I hope somebody can help me.
Kind regards,
Jeroen