Add maven dependency? [message #22501] |
Wed, 04 March 2009 08:56 |
Eclipse User |
|
|
|
Originally posted by: sadsdfd.asds.com
I have made a maven parent project and two child maven modules. I would like
to add a dependency to the maven parent that the children should enherit.
I right click the maven parent project and choose Properties -> Java Build
Path -> Libraries.
I then press the the Add External JARs... and choose the .jar file. But the
dependency is not located under the Maven Dependencies but instead it gets
added as "Referenced Libraries".
How do I add a new Maven Dependency without doing it manually in the pom.xml
file?
|
|
|
|
Re: Add maven dependency? [message #23224 is a reply to message #22545] |
Mon, 23 March 2009 13:55 |
Eclipse User |
|
|
|
Originally posted by: sadsdfd.asds.com
I have tried that but it still gets located under "Referenced Libraries" and
not under the "Maven Dependencies" section.
"Eugene Kuleshov" <eu@md.pp.ru> wrote in message
news:golrlt$9ef$1@build.eclipse.org...
>
> You should use popup menu "Maven / Add Dependency" on your project or
> pom.xml. Also, pom editor provides a structured form-based UI for editing
> of all sections of the pom.xml
>
> regards,
> Eugene
>
>
> JS wrote:
>> I have made a maven parent project and two child maven modules. I would
>> like to add a dependency to the maven parent that the children should
>> enherit.
>>
>> I right click the maven parent project and choose Properties -> Java
>> Build Path -> Libraries.
>>
>> I then press the the Add External JARs... and choose the .jar file. But
>> the dependency is not located under the Maven Dependencies but instead it
>> gets added as "Referenced Libraries".
>>
>> How do I add a new Maven Dependency without doing it manually in the
>> pom.xml file?
|
|
|
Re: Add maven dependency? [message #23345 is a reply to message #23224] |
Mon, 23 March 2009 15:09 |
Eclipse User |
|
|
|
Originally posted by: igor.ifedorenko.com
Just to clarify, you need to add required dependencies to
<dependencies/> section of pom.xml file of the parent project. The
easiest way to do this is by using m2e GUI as Eugene has suggested, but
you should see/make changes in plain text (or xml) editor as well. Also
note that Maven dependencies are identified using
groupId/artifactId/version "coordinates", so you should see something
like this in pom.xml file.
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-plexus</artifactId>
<version>1.0-alpha-6-SNAPSHOT</version>
</dependency>
You should not modify project java build path directly.
--
Regards,
Igor
JS wrote:
> I have tried that but it still gets located under "Referenced Libraries"
> and not under the "Maven Dependencies" section.
>
>
> "Eugene Kuleshov" <eu@md.pp.ru> wrote in message
> news:golrlt$9ef$1@build.eclipse.org...
>>
>> You should use popup menu "Maven / Add Dependency" on your project or
>> pom.xml. Also, pom editor provides a structured form-based UI for
>> editing of all sections of the pom.xml
>>
>> regards,
>> Eugene
>>
>>
>> JS wrote:
>>> I have made a maven parent project and two child maven modules. I
>>> would like to add a dependency to the maven parent that the children
>>> should enherit.
>>>
>>> I right click the maven parent project and choose Properties -> Java
>>> Build Path -> Libraries.
>>>
>>> I then press the the Add External JARs... and choose the .jar file.
>>> But the dependency is not located under the Maven Dependencies but
>>> instead it gets added as "Referenced Libraries".
>>>
>>> How do I add a new Maven Dependency without doing it manually in the
>>> pom.xml file?
>
|
|
|
Powered by
FUDForum. Page generated in 0.03095 seconds