Hello Wayne,
> Two manifest files contained in resulting WAR file:
> /META-INF/MANIFEST.MF -- entirely generated by Maven, no data from
> /src/main/resources
> /WEB-INF/classes/META-INF/MANIFEST.MF -- a copy of my
> /src/main/resources file with no extra data from Maven
The matter is very strange. My two MANIFEST.MF files are all affected.
Since MANIFEST.MF is at /src/main/resources/META-INF, and
/src/main/resources is standard resource path, then all of content under dir
resources will be copied into dir classes.
On the other hand, I specify the MANIFEST.MF for war archive file, via the
following statements,
[...]
<configuration>
        <archive>
                <manifestFile>
                        src/main/resources/META-INF/MANIFEST.MF
                </manifestFile>
        </archive>
</configuration>
[...]
Maven has to obey my command, and add extra data into file
{WAR}/META-INF/MANIFEST.MF.
I think the flow is very natural.
But how to explain your result...?

a cup of Java, cheers!
Sha Jiang


Wayne Fay wrote:
> 
> I ran a little test myself just now and got the following results:
> 
> New manifest file added to /src/main/resources/META-INF/MANIFEST.MF
> "mvn clean package" executed against project
> 
> Two manifest files contained in resulting WAR file:
> /META-INF/MANIFEST.MF -- entirely generated by Maven, no data from
> /src/main/resources
> /WEB-INF/classes/META-INF/MANIFEST.MF -- a copy of my
> /src/main/resources file with no extra data from Maven
> 
> Seems to me that this is basically a bug in the WAR plugin, unless
> someone knows otherwise... I'd expect both files would have the same
> info in them and/or only one file would be created. It seems like the
> META-INF under /classes is probably invalid/not used according to the
> J2EE Specifications.
> 
> Wayne
> 
> On 10/31/06, jiangshachina <[EMAIL PROTECTED]> wrote:
>>
>> Hi Wayne,
>> I'm so sorry that I confused you :(
>> But I think you have understand my mind.
>> Your thinking is compatible with my question.
>>
>> > instead of this file going into {WAR}/META-INF/MANIFEST.MF as I'd
>> expect
>> > based on
>> > the JAR File specifications, the file is instead going into
>> > {WAR}/WEB-INF/classes/META-INF/MANIFEST.MF.
>> Both of {WAR}/META-INF/MANIFEST.MF and
>> {WAR}/WEB-INF/classes/META-INF/MANIFEST.MF are affected by the
>> MANIFEST.MF
>> file.
>>
>> a cup of Java, cheers!
>> Sha Jiang
>>
>>
>> Wayne Fay wrote:
>> >
>> > I'm afraid I still don't understand...
>> >
>> > I think you're trying to ask the following:
>> >
>> > I have added a MANIFEST.MF file to src/main/resources/META-INF as
>> > instructed. However, when I package my Webapp as a WAR, instead of
>> > this file going into {WAR}/META-INF/MANIFEST.MF as I'd expect based on
>> > the JAR File specifications, the file is instead going into
>> > {WAR}/WEB-INF/classes/META-INF/MANIFEST.MF.
>> >
>> > Why is this happening? And can I force the file to go into
>> > {WAR}/META-INF/MANIFEST.MF like I want, rather than under
>> > WEB-INF/classes?
>> >
>> > Is that what you're trying to ask??
>> >
>> > Wayne
>> >
>> > On 10/30/06, jiangshachina <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Hi Wayne,
>> >> I just think src/main/resources is default directory for MANIFEST.MF
>> >> file(at
>> >> least, in simply Application project) .
>> >> And what's general(not standard/default) directory for MANIFEST.MF?
>> >>
>> >> a cup of Java, cheers!
>> >> Sha Jiang
>> >>
>> >>
>> >> Wayne Fay wrote:
>> >> >
>> >> > Why in the world would you put the file in
>> src/main/resources/META-INF
>> >> > but then not want it copied into the proper place in the resulting
>> Web
>> >> > app WAR file?? I just don't understand the business/use case, can
>> you
>> >> > explain it a little better?
>> >> >
>> >> > If this is really want you want, you might be able to make it work
>> >> > with <excludes>. Refer to this page for more info on using
>> <excludes>:
>> >> >
>> >>
>> http://people.apache.org/~aramirez/maven-resources-plugin/examples/include-exclude.html
>> >> >
>> >> > Wayne
>> >> >
>> >> > On 10/30/06, jiangshachina <[EMAIL PROTECTED]> wrote:
>> >> >>
>> >> >> In Web application project, I want to put MANIFEST.MF into
>> >> >> main/resources/META-INF directory(it's the same as that in simply
>> >> >> application project).
>> >> >> And I don't want META-INF/MANIFEST.MF to be copied into
>> >> >> webapp_archive_file/WEB-INF/classes.
>> >> >> How can I achieve that? Use filter file?
>> >> >>
>> >> >> a cup of Java, cheers!
>> >> >> Sha Jiang
>> >> >>
>> >> >>
>> >> >> jiangshachina wrote:
>> >> >> >
>> >> >> > Of course, I can locate MANIFEST.MF to another directory.
>> >> >> > I just be curious of why application project have not the
>> trouble.
>> >> >> > And I cannot use standard directory structure.
>> >> >> >
>> >> >> > a cup of Java, cheers!
>> >> >> > Sha Jiang
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > jiangshachina wrote:
>> >> >> >>
>> >> >> >> I find another problem.
>> >> >> >> If the project is Web application, then META-INF/MANIFEST.MF
>> will
>> >> be
>> >> >> >> inserted into classes directory.
>> >> >> >> Obviously, Maven thinks META-INF/MANIFEST.MF is resource since
>> it's
>> >> in
>> >> >> >> src/main/resources directory(standard resource path).
>> >> >> >>
>> >> >> >> How can I cancel the problem?
>> >> >> >>
>> >> >> >> a cup of Java, cheers!
>> >> >> >> Sha Jiang
>> >> >> >>
>> >> >> >>
>> >> >> >> jiangshachina wrote:
>> >> >> >>>
>> >> >> >>> But I'm failed with the action.
>> >> >> >>> I have an simple application project, and put MANIFEST.MF file
>> >> into
>> >> >> >>> directory
>> >> >> >>> src/main/resources/META-INF
>> >> >> >>> the file has an entry "Main-Class"
>> >> >> >>>
>> >> >> >>> But Maven don't add the manifest automatically. I have to do
>> >> >> following,
>> >> >> >>> <build>
>> >> >> >>>    <plugins>
>> >> >> >>>            <plugin>
>> >> >> >>>                    <groupId>org.apache.maven.plugins</groupId>
>> >> >> >>>                    <artifactId>maven-jar-plugin</artifactId>
>> >> >> >>>                    <configuration>
>> >> >> >>>                            <archive>
>> >> >> >>>                                    <manifestFile>
>> >> >> >>>                                            
>> >> >> >>> src/main/resources/META-INF/MANIFEST.MF
>> >> >> >>>                                    </manifestFile>
>> >> >> >>>                            </archive>
>> >> >> >>>                    </configuration>
>> >> >> >>>            </plugin>
>> >> >> >>>    </plugins>
>> >> >> >>> </build>
>> >> >> >>>
>> >> >> >>> a cup of Java, cheers!
>> >> >> >>> Sha Jiang
>> >> >> >>>
>> >> >> >>>
>> >> >> >>> Paul Li-2 wrote:
>> >> >> >>>>
>> >> >> >>>> or you could just add the META-INF/MANIFEST.MF into your
>> >> resources
>> >> >> >>>> directory ;-)
>> >> >> >>>>
>> >> >> >>>> maven will automatically package it
>> >> >> >>>>
>> >> >> >>>> A bit lazy i know.
>> >> >> >>>>
>> >> >> >>>> Paul
>> >> >> >>>>
>> >> >> >>>> On 4/12/06, Wayne Fay <[EMAIL PROTECTED]> wrote:
>> >> >> >>>>> Give this a try...
>> >> >> >>>>>
>> >> >> >>>>> <build>
>> >> >> >>>>>  <plugins>
>> >> >> >>>>>   <plugin>
>> >> >> >>>>>     <groupId>org.apache.maven.plugins</groupId>
>> >> >> >>>>>     <artifactId>maven-jar-plugin</artifactId>
>> >> >> >>>>>     <configuration>
>> >> >> >>>>>       <archive>
>> >> >> >>>>>        
>> <manifestFile>src/main/resources/META-INF/MANIFEST.MF</
>> >> >> >>>>> manifestFile>
>> >> >> >>>>>
>> >> >> >>>>> Wayne
>> >> >> >>>>>
>> >> >> >>>>> On 4/11/06, Karthik Manimaran <[EMAIL PROTECTED]> wrote:
>> >> >> >>>>> > Hi,
>> >> >> >>>>> >
>> >> >> >>>>> > How can I include a custom manifest file for a jar file and
>> a
>> >> WAR
>> >> >> >>>>> file?
>> >> >> >>>>> >
>> >> >> >>>>> > Thanks and regards,
>> >> >> >>>>> > Karthik.
>> >> >> >>>>> >
>> >> >> >>>>> >
>> >> >> >>>>>
>> >> >> >>>>
>> >> >> >>>>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> >>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> >> >>>> For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>>
>> >> >> >>>
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> http://www.nabble.com/Custom-Manifest-file-tf1435329s177.html#a7087688
>> >> >> Sent from the Maven - Users mailing list archive 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]
>> >> >
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Custom-Manifest-file-tf1435329s177.html#a7088136
>> >> Sent from the Maven - Users mailing list archive 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]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Custom-Manifest-file-tf1435329s177.html#a7089049
>> Sent from the Maven - Users mailing list archive 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Custom-Manifest-file-tf1435329s177.html#a7090444
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to