[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] EAR, RAD, m2e

One of IBM mailing lists or forums seems like more appropriate place to
discuss RAD specific issues.

--
Regards,
Igor

On 2013-07-22 7:19 PM, Ilko Iliev wrote:
Hi,

ok, as I can see you are trying to get it working with the recommended
Pom ... Honestly speaking I don't know if / how this exactly works. Our
projects are using the standard maven name conventions and we are using
the option "Publish with resources on server" in order to get this work.
In RAD we have the options under Maven / JavaEE integration both turned
off ("Generate application.xml..." and "Maven archiver generates ...").
We are using flat project structure, if this somehow matters. "Use
workspace resolution" is on.

Some excerpts from the poms, related to the RAD specifics / config:

plugin declarations:

<plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-war-plugin</artifactId>
                     <version>${maven-war-plugin.version}</version>
                     <configuration>
                         <failOnMissingWebXml>false</failOnMissingWebXml>
                         <!-- workaround for issue MWAR-296:
http://jira.codehaus.org/browse/MWAR-296 -->

<outputFileNameMapping>@{artifactId}@-@{baseVersion}@-@{classifier}@.@{extension}@</outputFileNameMapping>
                          <archive>
                             <manifest>
                                   <addClasspath>true</addClasspath>
                                   <!-- Workaround for Maven bug
#MJAR-156 (https://jira.codehaus.org/browse/MJAR-156) -->

<useUniqueVersions>false</useUniqueVersions>
                               </manifest>
                               <manifestEntries>
                                   <Built-By>build-master</Built-By>

<Build-version>${project.version}</Build-version>
                               </manifestEntries>
                           </archive>
                     </configuration>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-ejb-plugin</artifactId>
                     <version>${maven-ejb-plugin.version}</version>
                     <configuration>
                         <ejbVersion>${ejb.spec.version}</ejbVersion>
                         <archive>
                             <manifest>
                                 <addClasspath>true</addClasspath>
                             </manifest>
                         </archive>
                     </configuration>
                 </plugin>
<plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-ear-plugin</artifactId>
                     <version>${maven-ear-plugin.version}</version>
                     <configuration>
                         <version>${ear.spec.version}</version>
                     </configuration>
                 </plugin>


in the web projects:

<build>
         <!-- avoid the Broken output dir rule warning -->
         <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>


in the ear projects we still generate the application.xml even if it is not strictly necessary for some projects anymore, but "never change a running system":

<build>
       <finalName>xxxEAR</finalName>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-ear-plugin</artifactId>
         <configuration>
             <generateApplicationXml>true</generateApplicationXml>
             <archive>
                 <manifestEntries>
                     <Build-version>${project.version}</Build-version>
                 </manifestEntries>
             </archive>
             <modules>
                 <webModule>
                     <groupId>xxx</groupId>
                     <artifactId>xxx-web</artifactId>
                     <contextRoot>xxx</contextRoot>
                 </webModule>
                 <ejbModule>
                     <groupId>xxx</groupId>
                     <artifactId>xxx-ejb</artifactId>
                 </ejbModule>
             </modules>
               <description>XXX application</description>
         </configuration>
       </plugin>
     </plugins>
   </build>

classpath config:

we are using the approach as described in
http://maven.apache.org/plugins/maven-war-plugin/examples/war-manifest-guide.html
to filter the resources landing in WEB-INF/lib and referenced from the
EAR level. So, actually all dependencies, shared across ejb/war are
defined in the dependency section of the ear-pom. All necessary deps for
the web only are listed in the dependency section of the web-pom,
however the ear entries are defined as optional, causing manifest.mf to
be generated correctly and avoiding duplicate them in WEB-INF/lib.

RAD metadata - related only if you are using SCM with other devs:

using the above approach causes the classpath settings to be generated
different in case that developer1 has the project1 in her workspace and
developer2 not. In this situation maintaining .settings in the SCM will
always lead to conflicts. We simply removed all the metadata and maven
generated resources and are relaying on "the import as maven project" to
generated them correct - I think this is in general the recommended
approach, but I just mention it here.

WAS WTE deployment:

is is done via the tool - Add / Remove project, etc. Because we have
"Publish with resources on server" we can see what's actually deployed
on the server. As I mentioned after a release and update of the pom
versions we always have to make "Clean" publish on the server in order
to get consistent deployment.

The inconsistency in the errors you mention is somehow normal ;-) -
sometimes we get weird errors in the poms, especially in the web-poms,
but Update Maven Project helps in any case.

So, good luck!


On Mon, Jul 22, 2013 at 11:23 AM, Sander Verhagen <verhagen@xxxxxxxxxx <mailto:verhagen@xxxxxxxxxx>> wrote:

    Hi,


Thanks for your response, Ilko.

    I'm on 8.5.1 and I hadn't checked the infocenter page. You may have
    been particularly referencing "Recommended POM entries for projects
    targeting WebSphere® Application Server". I added some of that to my
    project but am getting similar results as before. (It seemingly
    being slightly inconsistent with its errors and other bombs makes it
    harder to focus and thus pinpoint the issue.) That page doesn't say
    a whole lot about EARs to begin with. Do you have a working example
    of your EAR (dependent on EJB) project?

    What are recommended choices for generateApplicationXml and
    includeLibInApplicationXml?

    As for the maven-subclipse-connector, no Subversion here :-(

    Best regards, Sander.



    Sander Verhagen
    [ Verhagen@xxxxxxxxxx ]


On 20-7-2013 1:23, Ilko Iliev wrote:

        Hi Sander,

        could you please provide the versions of the product you are using.
        Apparently, if you are on 8.5.1 RAD have you checked the infocenter
        about the maven integration -
        http://pic.dhe.ibm.com/__infocenter/radhelp/v8r5/topic/__com.ibm.etools.maven.doc/__topics/maven_intro.html
        <http://pic.dhe.ibm.com/infocenter/radhelp/v8r5/topic/com.ibm.etools.maven.doc/topics/maven_intro.html>
        - this is a new feature as from v8.5.1 in RAD. We are still on
        8.5.0 and
        are using the m2e + m2e-wtp plugins manually installed. The most
        important part to make the deployment to WAS WTE work is either to
        follow the recommendations for maven project configuration as
        described
        in the link above OR to use the maven native name conventions
        for the
        artifacts, however in this case only "Publish to server with
        resources
        on server" does work (otherwise you get NoClassDefFoundErrors or
        similar
        at publish time). And after version changes we have to make
        "Clean" on
        the server to get everything updated - we've opened PMR for this
        with
        IBM but we haven't got resolution yet.
        As for import maven project - we've tried it only from SVN with the
        provided maven-subclipse-connector. Here we have the issue that
        if you
        try this from the Package Explorer you get some weird error, but
        if you
        try this directly in the SVN explorer view everything works,
        which is ok
        for us at the moment.

        Hope this helps a bit,
        Ilko


On Sat, Jul 20, 2013 at 1:44 AM, Sander Verhagen <verhagen@xxxxxxxxxx <mailto:verhagen@xxxxxxxxxx> <mailto:verhagen@xxxxxxxxxx <mailto:verhagen@xxxxxxxxxx>>> wrote:

             Hi all,


I searched through this list's archives, I browsed the web, I played with IBM's examples ("RAD_m2e-Nov(update Jun 2012).pdf"), but I'm still at a loss. The group's help would be much appreciated!

             I have a multi-module Maven project that ultimately builds
        into EAR
             files, containing EJBs, WARs and utility JARs. I'm focusing
        on a
             specific EAR and trying to move from command-line to RAD.

             I could not find a comprehensive tutorial or anything
        pertaining to
             EAR files and running WTP server (Servers tab). So that
        would be a
             help, or your suggestions for my specific issue would be a
        great
             help and much appreciated!

             Following works:
             - Command-line: cd ..._EAR; mvn clean install; "Import EAR
        file"
             (i.e. binary) in RAD; drag the project to my WAS/WTP server
        (Servers
             tab)

             Following doesn't work:
             - "Import Existing Maven Projects" (i.e. source project) in
        RAD;
             drag the project to my WAS/WTP server (Servers tab)

             It finally fails with the following error:
             [7/19/13 14:16:50:115 PDT] 00001808 InstallSchedu I
        ADMA5014E: The
             installation of application MYCOMPANY_SERVICE_CUSTOMER_EAR
        failed.
             [7/19/13 14:16:50:115 PDT] 00001808 SystemErr     R

        org.eclipse.jst.j2ee.____commonarchivecore.internal.____exception.____NoModuleFileException:

             A file does not exist for module element having uri:
             MYCOMPANY_EXCEPTIONS.jar

             However, it appears that this dependency is nicely
        referenced from
             the org.eclipse.wst.common.____component file:

             <dependent-module archiveName="MYCOMPANY_____EXCEPTIONS.jar"
             deploy-path="/"

        handle="module:/classpath/var/____M2_REPO/com/my-company/java/____utility/MYCOMPANY___EXCEPTIONS/__0.0.1-XXX/__MYCOMPANY___EXCEPTIONS-0.0.1-__XXX.jar">
                  <dependency-type>uses</____dependency-type>

             </dependent-module>

             There is also a bunch of errors that I that I don't know
        what to do
             with, as follows: E

        org.eclipse.jst.j2ee.____commonarchivecore.internal.____strategy.LoadStrategyImpl

             openNestedArchive(String) An error occurred while opening a
        nested
             archive: IWAE0023E Unable to open module file
             "commons-beanutils-core.jar" in EAR file

        "C:/workspace/xxx/.metadata/.____plugins/org.eclipse.wst.____server.core/tmp0\MYCOMPANY_____SERVICE_CUSTOMER_EAR"


There is also a bunch of warnings that I chose to ignore for now, as follows: W

        org.eclipse.jst.j2ee.____commonarchivecore.internal.____impl.EARFileImpl

             openNestedArchive - module An error occurred while opening
        a nested
             archive: IWAE0006E Archive is not a valid Application
        Client JAR
             File because the deployment descriptor can not be found (case
             sensitive): META-INF/application-client.____xml


This is the EAR plugin configuration that I'm using:

             <plugin>
                <groupId>org.apache.maven.____plugins</groupId>
                <artifactId>maven-ear-plugin</____artifactId>

                <version>2.8</version>
                <configuration>
                  <archive>
                    <manifest>
                      <addClasspath>true</____addClasspath>

                    </manifest>
                  </archive>
                  <skinnyWars>false</skinnyWars>

          <includeLibInApplicationXml>____true</____includeLibInApplicationXml>
                  <displayName>${project.____artifactId}</displayName>
                  <fileNameMapping>no-version</____fileNameMapping>
                  <modules>
                    <ejbModule>
                      <groupId>com.my-company...</____groupId>

          <artifactId>MYCOMPANY_SERVICE_____CUSTOMER_EJB</artifactId>
                      <moduleId>EjbModule_____1316615955479</moduleId>

                    </ejbModule>
                  </modules>
                  <security/>
                </configuration>
             </plugin>


As said, your help is much appreciated! Best regards, Sander.



             --


Sander Verhagen [ Verhagen@xxxxxxxxxx ] ___________________________________________________ m2e-users mailing list m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx> <mailto:m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>> https://dev.eclipse.org/____mailman/listinfo/m2e-users <https://dev.eclipse.org/__mailman/listinfo/m2e-users> <https://dev.eclipse.org/__mailman/listinfo/m2e-users <https://dev.eclipse.org/mailman/listinfo/m2e-users>>







        _________________________________________________
        m2e-users mailing list
        m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>
        https://dev.eclipse.org/__mailman/listinfo/m2e-users
        <https://dev.eclipse.org/mailman/listinfo/m2e-users>

    _________________________________________________
    m2e-users mailing list
    m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>
    https://dev.eclipse.org/__mailman/listinfo/m2e-users
    <https://dev.eclipse.org/mailman/listinfo/m2e-users>




_______________________________________________ m2e-users mailing list m2e-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/m2e-users