maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Sowatskey \(nsowatsk\)" <nsowa...@cisco.com>
Subject RE: M2 EJB basics
Date Thu, 09 Jun 2005 10:12:31 GMT
Thanks :-)

I have shown below what worked for me. A few questions though:

1 - I would normally (I think) wanted to have been able to refer to the file
called jboss-j2ee.jar in the $JBOSS_HOME/server/all/lib dir. Of course I can
copy and rename as I have below, but that doesn't seem right. What do other
people do here?

2 - It seems as though the relationship between a dependency and a jar is
1:1. If I wanted to just add all of the jars in a given directory, how would
I do that?

So, this is what did work for me.

In my pom.xml:

  <dependency>
      <groupId>jboss</groupId>
      <artifactId>j2ee</artifactId>
      <version>2.1</version>
    </dependency>

And, in my repository I copy the jboss-j2ee.jar to j2ee-2.1.jar and create a
pom, like this:

G:\nm_poc\ejb\jar>ls "D:\Documents and
Settings\nsowatsk\.m2\repository\jboss\j2
ee\2.1"
j2ee-2.1.jar     j2ee-2.1.pom   

G:\nm_poc\ejb\jar>more "D:\Documents and
Settings\nsowatsk\.m2\repository\jboss\
j2ee\2.1/j2ee-2.1.pom"

<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>jboss</groupId>
  <artifactId>j2ee</artifactId>
  <version>2.1</version>
</project>

So now I have:

G:\nm_poc\ejb\jar>m2 install
[INFO] inventory-service-pom: using locally installed snapshot
[INFO]
------------------------------------------------------------------------
---
[INFO] Building Inventory Service
[INFO]
------------------------------------------------------------------------
---
[INFO] maven-jar-plugin: resolved to version 2.0-alpha-2 from local
repository
[INFO] maven-resources-plugin: resolved to version 2.0-alpha-2 from local
repos
tory
[INFO] maven-compiler-plugin: resolved to version 2.0-alpha-2 from local
reposi
ory
[INFO] maven-surefire-plugin: resolved to version 2.0-alpha-2 from local
reposi
ory
[INFO] maven-install-plugin: resolved to version 2.0-alpha-2 from local
reposit
ry
[INFO] [resources:resources]
[INFO] [compiler:compile]
Compiling 17 source files to G:\nm_poc\ejb\jar\target\classes
[INFO]
------------------------------------------------------------------------
---
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
---
[INFO] Reason: Compilation failure
[INFO]
------------------------------------------------------------------------
---
[INFO]
G:\nm_poc\ejb\jar\src\main\java\com\cisco\nm\poc\inventory\ejb\Inventory
ession.java:[125,15]  InventoryQueryResponse(java.util.Collection) in
com.cisco
nm.poc.inventory.util.InventoryQueryResponse cannot be applied to ()

[INFO]
------------------------------------------------------------------------
---
[INFO] Total time: 6 seconds
[INFO] Finished at: Thu Jun 09 12:05:42 CEST 2005
[INFO] Final Memory: 1M/7M
[INFO]
------------------------------------------------------------------------
---

G:\nm_poc\ejb\jar>

-----Original Message-----
From: Nicolas Chalumeau [mailto:nicolas.chalumeau@gmail.com] 
Sent: Thursday, June 09, 2005 11:41 AM
To: Maven Users List; nsowatsk@cisco.com
Subject: Re: M2 EJB basics

Hi Nathan

2005/6/9, Nathan Sowatskey (nsowatsk) <nsowatsk@cisco.com>:
> Hi
> 
> It may be that I too much of a newbie to Maven to be considering M2, 
> but I am trying anyway :-)
> 
> In the example below I have some EJB code that won't compile as it 
> can't find the EJB jars.
> 
> What I can't see is how to set the location of the EJB jars though. If 
> this were Maven 1.x I would use properties as part of the solution, 
> but for M2 I just don't know where to start.
> 
> I half suspect that I need to create a dependency, but to what and 
> where and how I don't know.

You have the solution here : you need to add a j2ee-XX.jar dependency in
your pom for this project. But as it will not be on ibiblio you need to
download and install it in your m2 repository manually.

> 
> If someone wants to tell me that M2 is not ready for newbies, that's 
> fine and I will go look at 1.x. If someone can help me get this to 
> work though, then I will persevere and maybe help make M2 a better thing.

We all are newbies in M2 ;-) (only the great dev team is not...)

Nicolas,

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


Mime
View raw message