You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Edward Yakop <ed...@tokuii.com> on 2005/07/11 06:46:26 UTC

[m2] Problem with ear project.

Hi all,

I'm having difficulties setting up 'ear' project.
The following are the conditions:

The pom file:
--------------------------------------------------------------------------------
<project>
  <modelVersion>4.0.0</modelVersion>
  ...
  <packaging>ear</packaging>
  ...
</project>
--------------------------------------------------------------------------------

Directory structure:
--------------------------------------------------------------------------------
.
|-- pom.xml
`-- src
    `-- application
        `-- META-INF
            `-- application.xml
--------------------------------------------------------------------------------
Note: Why application.xml needs to be put under src/application, instead of 
src/main/application?

The problem comes when "m2 install" is called.
--------------------------------------------------------------------------------
[INFO] ----------------------------------------------------------------------------
[INFO] Building Sample Project - EAR
[INFO] ----------------------------------------------------------------------------
[ERROR] Nonexistent component: 
org.apache.maven.lifecycle.mapping.LifecycleMappingear
[ERROR] No lifecycle mapping for type 'ear': using defaults
[INFO] maven-resources-plugin: resolved to version 2.0-alpha-3 from local repository
[INFO] maven-compiler-plugin: resolved to version 2.0-alpha-3 from local repository
[INFO] maven-surefire-plugin: resolved to version 2.0-alpha-3 from local repository
[INFO] maven-jar-plugin: resolved to version 2.0-alpha-3 from local repository
[INFO] maven-source-plugin: resolved to version 2.0-alpha-2 from local repository
[INFO] maven-install-plugin: resolved to version 2.0-alpha-3 from local repository
[INFO] [resources:resources]
[INFO] sample-ejb: using locally installed snapshot
[INFO] sample-core: using locally installed snapshot
[INFO] sample-remoting: using locally installed snapshot
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [resources:testResources]
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] Setting reports dir: /home/efy/work/sample/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no test to run.

Results :
[surefire] Tests run: 0, Failures: 0, Errors: 0

[INFO] [jar:jar]
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /home/efy/work/sample/target/sample-ear-1.0-SNAPSHOT.jar
[INFO] [source:jar]
[INFO] Not producing source bundle for a SNAPSHOT build
[INFO] [install:install]
[INFO] Installing /home/efy/work/sample/target/sample-ear-1.0-SNAPSHOT.ear to 
/home/efy/.m2/repository/com/test/sample/1.0-SNAPSHOT/sample-ear-1.0-SNAPSHOT.ear
[INFO] ----------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ----------------------------------------------------------------------------
[INFO] Diagnosis: Error installing artifact
[INFO] ----------------------------------------------------------------------------
--------------------------------------------------------------------------------

Notice at the start of m2 output:
--------------------------------------------------------------------------------
[ERROR] Nonexistent component: 
org.apache.maven.lifecycle.mapping.LifecycleMappingear
[ERROR] No lifecycle mapping for type 'ear': using defaults
--------------------------------------------------------------------------------

And at the bottom of m2 output:
--------------------------------------------------------------------------------
[INFO] [jar:jar]
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /home/efy/work/sample/target/sample-ear-1.0-SNAPSHOT.jar
[INFO] [source:jar]
[INFO] Not producing source bundle for a SNAPSHOT build
[INFO] [install:install]
[INFO] Installing /home/efy/work/sample/target/sample-ear-1.0-SNAPSHOT.ear to 
/home/efy/.m2/repository/com/test/sample/1.0-SNAPSHOT/sample-ear-1.0-SNAPSHOT.ear
--------------------------------------------------------------------------------

Is the reason m2 produced jar is because "ear" is not part lifecycle mapping? 
And if that's the case, how do I patch the source code to make ear as one of the 
lifecycle mapping?

Regards,
Edward


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Problem with ear project.

Posted by Stephane Nicoll <st...@gmail.com>.
On 7/11/05, Kenney Westerhof <fo...@neonics.com> wrote:
> On Mon, 11 Jul 2005, Edward Yakop wrote:
> 
> > Hi all,
> >
> > I'm having difficulties setting up 'ear' project.
> > The following are the conditions:
> >
> > The pom file:
> > --------------------------------------------------------------------------------
> > <project>
> >   <modelVersion>4.0.0</modelVersion>
> >   ...
> >   <packaging>ear</packaging>
> >   ...
> > </project>
> > --------------------------------------------------------------------------------
> >
> > Directory structure:
> > --------------------------------------------------------------------------------
> > .
> > |-- pom.xml
> > `-- src
> >     `-- application
> >         `-- META-INF
> >             `-- application.xml
> > --------------------------------------------------------------------------------
> > Note: Why application.xml needs to be put under src/application, instead of
> > src/main/application?
> 
> Because the plugin developer decided so ;) 

And I finally saw you ;-)
This is fixed in http://jira.codehaus.org/browse/MNG-736

Thanks,
Stéphane

-- 
.::You're welcome ::.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Problem with ear project.

Posted by Kenney Westerhof <fo...@neonics.com>.
On Mon, 11 Jul 2005, Edward Yakop wrote:

> Hi all,
>
> I'm having difficulties setting up 'ear' project.
> The following are the conditions:
>
> The pom file:
> --------------------------------------------------------------------------------
> <project>
>   <modelVersion>4.0.0</modelVersion>
>   ...
>   <packaging>ear</packaging>
>   ...
> </project>
> --------------------------------------------------------------------------------
>
> Directory structure:
> --------------------------------------------------------------------------------
> .
> |-- pom.xml
> `-- src
>     `-- application
>         `-- META-INF
>             `-- application.xml
> --------------------------------------------------------------------------------
> Note: Why application.xml needs to be put under src/application, instead of
> src/main/application?

Because the plugin developer decided so ;) This plugin doesn't have a test
phase, so it's no use having the file in src/main/ (because
src/test/application is never consulted).

You can override this setting by specifying

<configuration>

<applicationXmlLocation>src/main/application/application.xml</applicationXmlLocation>
</configuration>

for the plugin.

[snip]

> Notice at the start of m2 output:
> --------------------------------------------------------------------------------
> [ERROR] Nonexistent component:
> org.apache.maven.lifecycle.mapping.LifecycleMappingear
> [ERROR] No lifecycle mapping for type 'ear': using defaults
> --------------------------------------------------------------------------------
>
> And at the bottom of m2 output:
> --------------------------------------------------------------------------------
> [INFO] [jar:jar]
> [WARNING] JAR will be empty - no content was marked for inclusion!
> [INFO] Building jar: /home/efy/work/sample/target/sample-ear-1.0-SNAPSHOT.jar
> [INFO] [source:jar]
> [INFO] Not producing source bundle for a SNAPSHOT build
> [INFO] [install:install]
> [INFO] Installing /home/efy/work/sample/target/sample-ear-1.0-SNAPSHOT.ear to
> /home/efy/.m2/repository/com/test/sample/1.0-SNAPSHOT/sample-ear-1.0-SNAPSHOT.ear
> --------------------------------------------------------------------------------
>
> Is the reason m2 produced jar is because "ear" is not part lifecycle mapping?

It will produce both. The ear is currently no valid packaging, and has no
lifecyle mapping associated with it, so jar (the default) is used.

> And if that's the case, how do I patch the source code to make ear as one of the
> lifecycle mapping?

You can patch
maven-core/src/main/resources/META-INF/plexus/components.xml but it
will get fixed eventually. But this is not necessary to get it to work.

As you can see in the lines below, the ear is installed:

> [INFO] Installing /home/efy/work/sample/target/sample-ear-1.0-SNAPSHOT.ear to
> /home/efy/.m2/repository/com/test/sample/1.0-SNAPSHOT/sample-ear-1.0-SNAPSHOT$


Currently, files in earSourceDirectory (src/application/) are included
in the ear, aswell as dependencies.

Maybe you can specify the complete POM? Did you check if the .ear file
exists, and what's in it?

For me the following worked:

      <plugin>
        <artifactId>maven-ear-plugin</artifactId>
        <version>2.0-beta-1-SNAPSHOT</version>
        <executions>
          <execution>
            <goals>
              <goal>generate-application-xml</goal>
              <goal>ear</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

and specifying some dependencies (as type ejb or war). Just a pom, nothing
else in the project.

-- Kenney

>
> Regards,
> Edward
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org