Allow project to provide custom deployment files (web.xml, jboss-web.xml, ...) #4

Closed
dlecan opened this Issue Mar 26, 2012 · 6 comments

Projects

None yet

2 participants

@dlecan
Member
dlecan commented Mar 26, 2012

web.xml
jboss-web.xml
...

@dlecan dlecan was assigned Apr 23, 2012
@dlecan
Member
dlecan commented Jun 19, 2012

Assets will have to be stored in PROJECT_ROOT/war.
Everything located in this folder will be embedded in the WAR file at root.
Eg: war/WEB-INF/jboss-web.xml will become WEB-INF/jboss-web.xml in the WAR file.

@dlecan dlecan closed this in 293fe19 Jun 26, 2012
@samspycher
Contributor

Hi,

I would like to customize the MANIFEST.MF with this strategy, because I am creating an OSGI WAB and not only a WAR.

Unfortunately I get this error when packaging:

[error] {file:[project-path]/}[project-name]/*📦 java.util.zip.ZipException: duplicate entry: META-INF/MANIFEST.MF
[error] Total time: 5 s, completed Aug 6, 2012 11:28:55 AM

Ideally, I would like custom files from the war/ subdirectory to overwrite existing files. Would this be acceptable in your view?

Perhaps you can suggest a workaround for the current release?

Thanks,
Sam

@dlecan
Member
dlecan commented Aug 7, 2012

Customizing manifest is an interesting use case, but I didn't think about
it :-)

Unfortunately you can't easily customize it with Play2war 0.7 because it is
hard written.

Please fill in a separate issue as a bug. I will fix it for 0.7.1 (release
around August the 20th-25th).

Until this date, you can try to set up in your SBT build a post war task:

  • unzip war
  • generate the new manifest
  • replace old manifest by the new one
  • re-zip the war
    Le 6 août 2012 11:54, "Sam Spycher" <
    reply@reply.github.com>
    a écrit :

Hi,

I would like to customize the MANIFEST.MF with this strategy, because I am
creating an OSGI WAB and not only a WAR.

Unfortunately I get this error when packaging:

[error] {file:[project-path]/}[project-name]/*📦
java.util.zip.ZipException: duplicate entry: META-INF/MANIFEST.MF
[error] Total time: 5 s, completed Aug 6, 2012 11:28:55 AM

Ideally, I would like custom files from the war/ subdirectory to overwrite
existing files. Would this be acceptable in your view?

Perhaps you can suggest a workaround for the current release?

Thanks,
Sam


Reply to this email directly or view it on GitHub:
#4 (comment)

@samspycher
Contributor

I forked and patched myself, although I must admit the Scala code is probably hideous to any knowledgeable Scala developer :)

-> Shall I still submit a bug? I don't mind at all if you prefer to do this yourself, but I am also happy to submit a pull request.

@dlecan
Member
dlecan commented Aug 9, 2012

Please submit a pull request.
Thanks for the contribution

How is generated your manifest?

@samspycher
Contributor

We generate our OSGI bundle manifests (see http://en.wikipedia.org/wiki/OSGi#Bundles) with the maven bundle plugin: http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html. Using bundles instead of straightforward jars allows us to do crazy things with our applications, check it out! :)

Unfortunately our target container Virgo seems to be having problems with jars generated from this plugin. My suspicion is that this is a servlet 3 issue on Virgo, and has nothing to do with your plugin itself (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=385610)

Pull request:
#71

A note to the code: I don't have much experience at all on Scala, and couldn't figure out how to do the case distinction with the option variable more elegantly... perhaps you can improve this? Also, I made the search for MANIFEST.MF case-insensitive, since the spec for jar seems to reserve other cases also (see http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html, search for 'case-insensitive'), and I am unsure if certain containers would possibly also accept different casing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment