Did anyone get a resolution to this ? I'm getting exactly the same error. Only solution I could find was going back to version 2.0 of war plugin
On 03/07/06, SkipWalker <[EMAIL PROTECTED]> wrote:
So my basic question is, how do I get some of my webapp files in my war project to be filtered with my pom.version value? I've done what I think I need to do, but the build appears to be executing the plugin twice or something, creating errors. There some configuration tweak that I can't figure out to get this to work. So here's what I have. I have a war project in my maven 2.0.4 multi-project build. I have a few files in src/main/webapp that I need to filter in the ${pom.version} value. This apparently was a bug with version 2.0 of the plugin ( see bug http://jira.codehaus.org/browse/MWAR-41 ). Hemce, I changed my version to the recently released 2.0.1. Also, see this thread . So, I modified my pom.xml to use to use the 2.0.1 plugin via the following configuration. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.0.1</version> <configuration> <!-- we need to filter the resources so the correct version gets into the jsp links --> <webResources> <resource> <directory>${basedir}/src/main/webapp</directory> <filtering>true</filtering> <includes> <include>**/web.xml</include> <include>**/context.xml</include> <include>**/*.jsp</include> </includes> </resource> </webResources> <archive> <manifestEntries> <Implementation-Build>${pom.version} (r${buildNumber})</Implementation-Build> </manifestEntries> </archive> </configuration> </plugin> This appears to work sort of. In the build it appears to be doing the webResource filtering twice. This wouldn't be so bad, but it causes in error when the thing tries to set the Implementation-Build the second time it does the copy. Here's a snippet of the build output. It says the webResources are being copied, and then the next line it says the webResources are being copied again. This appears to be the reason why it fails. Something is causing the build to try and produce the manifest twice. [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-war-plugin:2.0.1:war' --> [DEBUG] (f) manifestEntries = {Implementation-Build=1.0-BETA (r1956)} [DEBUG] (f) archive = [EMAIL PROTECTED] [DEBUG] (f) archiveClasses = false [DEBUG] (s) classesDirectory = C:\Builds\mywebapp\manual\work\branches\checkout\30Jun06-1.0beta\www\target\classes [DEBUG] (f) filters = [] [DEBUG] (f) outputDirectory = C:\Builds\mywebapp\manual\work\branches\checkout\30Jun06-1.0beta\www\target [DEBUG] (f) primaryArtifact = true [DEBUG] (s) project = [EMAIL PROTECTED] [DEBUG] (f) warName = mywebapp-1.0-BETA [DEBUG] (s) warSourceDirectory = C:\Builds\mywebapp\manual\work\branches\checkout\30Jun06-1.0beta\www\src\main\webapp [DEBUG] (s) directory = C:\Builds\mywebapp\manual\work\branches\checkout\30Jun06-1.0beta\www/src/main/webapp [DEBUG] (s) filtering = true [DEBUG] (s) includes = [**/web.xml, **/context.xml, **/*.jsp] [DEBUG] (f) webResources = [Lorg.apache.maven.model.Resource;@1dfd868 [DEBUG] (s) webappDirectory = C:\Builds\mywebapp\manual\work\branches\checkout\30Jun06-1.0beta\www\target\mywebapp-1.0-BETA [DEBUG] (f) workDirectory = C:\Builds\mywebapp\manual\work\branches\checkout\30Jun06-1.0beta\www\target\war\work [DEBUG] -- end configuration -- [INFO] [war:war] [INFO] Exploding webapp... [INFO] Copy webapp webResources to C:\Builds\mywebapp\manual\work\branches\checkout\30Jun06-1.0beta\www\target\mywebapp-1.0-BETA [INFO] Copy webapp webResources to C:\Builds\mywebapp\manual\work\branches\checkout\30Jun06-1.0beta\www\target\mywebapp-1.0-BETA [INFO] Assembling webapp www in C:\Builds\mywebapp\manual\work\branches\checkout\30Jun06-1.0beta\www\target\mywebapp-1.0-BETA ... [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error assembling WAR Embedded error: The attribute "Implementation-Build" may not occur more than once in the same section [INFO] ------------------------------------------------------------------------ -- View this message in context: http://www.nabble.com/war-plugin-2.0.1-webResources-pom.*-filtering-tf1886910.html#a5158779 Sent from the Maven - Users forum at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]