[jboss-user] [JBoss Tools] - Re: target/project.war different from project.war that is Run On Server
Tanya Ruttenberg
do-not-reply at jboss.com
Thu Apr 12 10:27:14 EDT 2012
Tanya Ruttenberg [https://community.jboss.org/people/daxxy] created the discussion
"Re: target/project.war different from project.war that is Run On Server"
To view the discussion, visit: https://community.jboss.org/message/729614#729614
--------------------------------------------------------------
This original problem is showing up again - though the details are different and I'm pretty sure this time it's not my mistake.
The file starts in src/main/resources/META-INF/persistence.xml
In the maven build, the persistence.xml is showing up in the right place, under META-INF.The eclipse build doesn't include the persistence.xml at all.
To coax maven into including persistence.xml into the WAR I include this in the pom.xml
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<!-- Java EE 6 doesn't require web.xml, Maven needs to catch up! -->
<failOnMissingWebXml>false</failOnMissingWebXml>
<webResources>
<resource>
<directory>src/main/resources/META-INF</directory>
<!-- override the destination directory for this resource -->
<targetPath>META-INF</targetPath>
<includes>
<include>persistence.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
and this
<resources>
<resource>
<directory>src/resources/META-INF</directory>
<excludes>
<exclude>persistence.xml</exclude>
</excludes>
</resource>
</resources>
mvn package puts it into contacts-as7.war/META-INF
Run On Server doesn't put it anywhere and I get this error when I deploy
Can't find a persistence unit named null in deployment "contacts-as7.war"
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/729614#729614]
Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120412/fa534411/attachment-0001.html
More information about the jboss-user
mailing list