Re: [m2] Maven2 building Eclipse plugins, features, and update sites

2006-01-07 Thread Milos Kleint
does eclipse provide ant tasks to do the plugin building?
I've done exactly the same for netbeans modules,
a bunch of mojos and a custom lifecycle, internally reusing the netbeans ant
tasks.
At least the lifecycle definition might be of interest you,
http://cvs.mevenide.codehaus.org/mojos/maven-nbm-plugin/

Regards

Milos Kleint

On 1/7/06, Jim Babka <[EMAIL PROTECTED]> wrote:
>
> I have been searching for this now for several days and have found
> nothing, so I thought I would ask here.  Is there a maven2 plugin that
> supports building of Eclipse plugins, features, and update sites?  Right
> now we have several Eclipse plugins that are built into ZIP files that
> can be unzipped into an Eclipse plugins directory.  However, there are
> several problems with this:
>
> 1. There's no support for updating the plugin.xml with the version
> information of the plugin's jar.
> 2. There's no support for putting the maven pom.xml dependencies (direct
> or transitive) into the plugin.xml.
> 3. There's no support for building an Eclipse feature that includes
> those plugins.
> 4. There's no support for building an Eclipse update site from the
> feature or for that matter deploying to an update site.
>
> Right now we have some hackery to at least get to the ZIP file, but
> unless there is something already existing, I see a bunch of long nights
> ahead while I write my own stuff.  The requirement is that we can have
> an update site automatically built/updated by our build system.
>
> So, is there anything that I can use here?  Even if there is an open
> source project that goes only part of the way, it would possibly give me
> a head start.
>
> Thanks in advance for any help that anyone can give me.
>
> Jim Babka
> Senior Software Engineer
> Main: (512) 334 3200
> Direct: (512) 334 3237
> Email: [EMAIL PROTECTED]
>
> Webify Solutions
> Enabling the On Demand Enterprise(tm)
> www.webifysolutions.com
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: [ANN] dependency-maven-plugin 1.0

2006-01-07 Thread Hervé BOUTEMY
I added a testcase : a sample report generated for maven-plugin-plugin
see http://jira.codehaus.org/browse/MPLUGIN-11 plugin-info.html attachement
 I'm interested in any suggestion to enhance the text (my english is not 
always very good ;) )

I really think this will help a lot for Maven adoption by "normal" users : 
please vote for the issue...

I'm looking forward to do the same addition to the "About xxx plugin" page

Le Jeudi 05 Janvier 2006 22:04, Hervé BOUTEMY a écrit :
> ok, filed MPLUGIN-11
> it contains a patch to add the text described to the plugin documentation
> report (even translated it into french :) )
>
> but it did not change the "About xxx plugin" page : I don't know where to
> go for that. If anybody can show me...
>
> Le Jeudi 05 Janvier 2006 08:42, Wim Deblauwe a écrit :
> > very good suggestion +1 for me also
> >
> > 2006/1/5, Hervé BOUTEMY <[EMAIL PROTECTED]>:
> > > > (The following is a little off-topic for dependency-maven-plugin
> > > > specifically, but I think it needs to be said.)
> > > >
> > > > For an experience Maven2 user, the value of these docs is immediately
> > > > obvious.
> > > >
> > > > For the newbie, however, there is still the feeling:
> > > >
> > > >"OK, so now what do I do."
> > >
> > > +1 (+2 if I could)
> > >
> > > a simple addition in the "About xxx plugin" generated file would do the
> > > trick.
> > > For example, if you see
> > > http://maven.apache.org/plugins/maven-site-plugin/index.html
> > >
> > >
> > > After the "Goals available:" table, simply add :
> > > "Configuration:
> > > To use this plugin, you will need to add to your pom :
> > >   
> > > org.apache.maven.plugins  (is this necessary
> > > ? perhaps not for org.apache.maven.plugins, but for other like
> > > org.codehaus.mojo...)
> > > maven-site-plugin
> > >   
> > > For more information, see "Guide to Conguring Plug-ins" (link to
> > > http://maven.apache.org/guides/mini/guide-configuring-plugins.html)"
> > >
> > >
> > > I think this would really help the newbie : personally, for example, it
> > > took
> > > me a long time to discover that naming convention for Maven plugins was
> > > "maven-xxx-plugin", but for Mojo plugins it is "xxx-maven-plugin".
> > > Carefully reading the plugin documentation would have been sufficient,
> > > but...
> > >
> > >
> > > Is there an existing JIRA entry, or should I create one ?
> > >
> > > -
> > > 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]

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



Re: [m2] best practices: cvs, modules, dependency

2006-01-07 Thread Valerio Schiavoni
Hi Yann,
in the last few days I experimented a bit with the solution you proposed,
also sharing my experience on irc:#maven, and I ended up having more doubts
than before.
if I choose the approach you proposed, every developer must checkout the
whole project, even if he's in charge of only one single module. More, since
we develop inside eclipse, the set of dependencies must be satisfied for all
modules contained in the project, which is something I don't think is
strictly necessary.

On the other site, the module approach will help the integration phase,
making easier to discover if some modules break others.

Also,  something that confused me is that using mvn eclipse:eclipse it
creates .classpath and .project ecliose files for the parent project and
also for submodules: this drives me to think that each module should be
developped independantly from others...

Opinions ?

Valerio


2005/12/27, Yann Le Du < [EMAIL PROTECTED]>:
>
> At first view, what you could do is :
>   * create a parent POM for your application
>   * create a module for each component
>   * create a pom.xml for each component
>
> I see no need to setup several internal repositories.
>
> For an example, you could have a look at how it's done in Maven itself :
> http://svn.apache.org/viewcvs.cgi/maven/components/trunk/
>
> Hope this helps,
> --
> Yann
>
> 2005/12/27, Valerio Schiavoni < [EMAIL PROTECTED]>:
> >
> > Hello,
> > we are developing 2 components. at this moment, they are subpackages of
> > the
> > same application, stored in one single cvs repository.
> > also, they share a big ant build file.
> >
> > we want to split them into independant projects, and take advantage of
> > maven
> > .
> >
> > so, what is the best way to approach the problem?:
> > -create 2 modules on the same cvs repository ?
> > -create 2 independendant pom.xml and if necessary define one to be
> > dependant
> > from the other one ?
> > --to do so, should I setup 2 internal maven repositories ?
> > -if we want to package the 2 components toghether, shoudl we create a
> > third
> > "global" pom, that includes both of the previous ones?
> > -are there any guidelines about setting up this kind of things?
> >
> > is there any issue i should consider first ? what is, in your opinion,
> the
> > best way (or, a good working way) to approach this situation?
> >
> > thanks,
> > valerio
> >
> > --
> > To Iterate is Human, to Recurse, Divine
> > James O. Coplien, Bell Labs
> >
> >
>
>


--
To Iterate is Human, to Recurse, Divine
James O. Coplien, Bell Labs


RE: [m2] - ${localRepository} values - weired problem

2006-01-07 Thread mvdp
Hi,

You need to use ${settings.localRepository}.

Martin

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Verzonden: vrijdag 6 januari 2006 20:59
Aan: Maven Users List
Onderwerp: [m2] - ${localRepository} values - weired problem


Hi All,

I using some antrun plugin, and i have this problem

lets say i have my local repository at C:\.M2 and my settings.xml has
entry like "/.M2/"

in my  i have some ant scripts steps, for one of them i want to add
all the jars localRepository as my class path, so  i add it like
   




 

.
   

coz, i don't  want to hard code my localRepository value here, but its not
working for me , and i'm getting this error

[ERROR] BUILD ERROR
[INFO]

[INFO] Error executing ant tasks
Embedded error: C:\Raghu\Shop\src\[local] -> file:\.M2 not found

why its trying to subsititute ${localReposiotry}  valu with file protocol
stuff.

Are is there anyother way to do it ? just by having classes in dependecies
section is not working so thats why i have to mention this classpath in
explicit

Any ideas? Please


Thanks,
Raghurajan G

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.15/223 - Release Date: 06-01-2006

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.15/223 - Release Date: 06-01-2006


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



Re: [m2] NPE in "mvn site" using maven from SVN

2006-01-07 Thread Arik Kfir
Hi,

Has anyone had a chance to look at this?

On 12/23/05, Arik Kfir <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've received the following exception while running "mvn site" on a
> multi-module project (using maven from SVN):
> java.lang.NullPointerException
> at 
> org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.getParentPrefix(DefaultDecorationModelInheritanceAssembler.java:255)
> at 
> org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.assembleModelInheritance(DefaultDecorationModelInheritanceAssembler.java:46)
> at 
> org.apache.maven.plugins.site.SiteMojo.getDecorationModel(SiteMojo.java:557)
> at 
> org.apache.maven.plugins.site.SiteMojo.getDecorationModel(SiteMojo.java:472)
> at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:348)
> at 
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:414)
> at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at 
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>
> I know you guys don't like us "commoners" using maven from SVN (wink)
> but I couldn't wait, seeing the JIRAs about making the site plugin
> reactor-aware closed...
>  ;-)
>
> Regards,
> _
> Arik Kfir[EMAIL PROTECTED]
>


--
Regards,
_
Arik Kfir[EMAIL PROTECTED]


Re: Using XDoclet2 Hibernate with Maven2

2006-01-07 Thread Grégory Joseph
Hi list,

On 06/01/06, Mike Perham <[EMAIL PROTECTED]> wrote:
> I don't know of anything which does Xdoclet2.

http://xdoclet.codehaus.org/Maven2+Plugin

Darryl,

What did you try, what is not working for you ?

Cheers,

g


> "Darryl L. Pierce" <[EMAIL PROTECTED]>
> 06/01/2006 15:14
> Por favor, responda a
> "Maven Users List" 
>
>
> Para
> Maven Users List 
> cc
>
> Asunto
> Using XDoclet2 Hibernate with Maven2
>
>
>
>
>
>
> I'm trying to quickly ramp up and use Maven2 on my project. I'm familiar
>
> with XDoclet and have used it with Ant previously. My team is bringing
> Maven2 into the project and I'm tasked with moving our XDoclet stuff
> over. However, I can't find any documentation that shows how to
> configure Hibernate in the pom.xml file (I did find the XDoclet2 Maven2
> plugin page) and call it with Maven2.
>
> Any help is greatly appreciated.
>
> --
> Darryl L. Pierce <[EMAIL PROTECTED]>
> Homepage: http://mcpierce.multiply.com/
> "McVeigh's lawyer got him the death penalty, which, quite frankly,
> I could have done." - Jon Stewart
>
>
> -
> 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]
>
>
>
> -
> 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]



(Maven2 + Webdoclet) struts actions inheritance

2006-01-07 Thread Druzhinin, Dmitry \(DB\)
Hi!

 

I have Struts actions hierarchy (some BaseAction being inherited by the
others). 

Base action class is shared by multiple projects hence it is separated
into a common artifact in Maven2 build. 

Now I need to generate struts-config.xml. And here I experience the
following problem: webdoclet (afaik xdoclet in general) needs to have
BaseAction in its classpath for generating struts config.

 

Afaik all maven2 plugins have only their dependencies and common maven
libs in their class realm when being launched. So it looks like I have
no chance to supply my BaseAction there.

 

Did anyone experience similar problem? Is there any good solution for
that? 

Is it generally possible to use xdoclet without supplying the whole
inheritance hierarchy in its classpath?

 

Thanks a lot in advance!

 

Best regards,

Dmitriy



Re: call for testers: scp wagon

2006-01-07 Thread Stephen Duncan
When putting them into your 2.0.1 lib directory, did you delete the
equivalent jars that were already there?

-Stephen

On 1/6/06, KC Baltz <[EMAIL PROTECTED]> wrote:
> This is failing for me.  I am continuing to get the "session is down" 
> exception.
> I'm not sure what debugging information you'd like to see.  I'm getting the 
> same basic stack trace I've always gotten with a root cause like this:
>
> Caused by: com.jcraft.jsch.JSchException: session is down
> at com.jcraft.jsch.Channel.connect(Unknown Source)
> at 
> org.apache.maven.wagon.providers.ssh.ScpWagon.put(ScpWagon.java:125)
> ... 22 more
>
> I tried downloading the jars you specified and putting them in my 2.0.1 lib 
> directory.  I also tried downloading the 2.0.x release (without modifying its 
> /lib directory) and that failed as well.
>
> My build is on Windows XP, the remote repository is Solaris 10.
>
> K.C.
>
>
>
>
>
> -Original Message-
> From: Brett Porter [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 04, 2006 11:34 PM
> To: Maven Users List
> Subject: call for testers: scp wagon
>
>
> Hi,
>
> In the lead up to the 2.0.2 release, I'd like anyone experiencing:
> [WAGONSSH-28] session is down
> [WAGONSSH-30] hangs during deployment
>
> to test the following wagon snapshots:
> http://snapshots.maven.codehaus.org/maven2/org/apache/maven/wagon/wagon-ssh/1.0-alpha-6-SNAPSHOT/wagon-ssh-1.0-alpha-6-20060105.062346-2.jar
> by including it in your $M2_HOME/lib directory.
>
> Please also include:
> http://snapshots.maven.codehaus.org/maven2/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-6-SNAPSHOT/wagon-provider-api-1.0-alpha-6-20060105.062346-7.jar
> and
> http://www.ibiblio.org/maven2/com/jcraft/jsch/0.1.24/jsch-0.1.24.jar
>
> Replace any existing wagon/jsch libraries.
>
> Another way to test is to pick up the following integration build instead:
> http://maven.zones.apache.org/~maven/builds/branches/maven-2.0.x/m2-20060105.071501.tar.gz
>
> With this build, you can also test scpexe and sftp if you were having
> any problems with them.
>
> Thanks!
> - Brett
>
> -
> 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]
>
>


--
Stephen Duncan Jr
www.stephenduncanjr.com

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



Re: Using XDoclet2 Hibernate with Maven2

2006-01-07 Thread Darryl L. Pierce

Grégory Joseph wrote:


http://xdoclet.codehaus.org/Maven2+Plugin

Darryl,

What did you try, what is not working for you ?
 

The page in question doesn't explain anything, it only says what to do 
for one particular case. For example, the first thing I need to do is 
incorporate Hibernate into our project. How do I do that based on this 
page's example? How do I define the merge directory, the output 
directory, etc?


--
Darryl L. Pierce <[EMAIL PROTECTED]>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly, 
I could have done." - Jon Stewart



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



Re: Using XDoclet2 Hibernate with Maven2

2006-01-07 Thread Grégory Joseph
Hi,

> The page in question doesn't explain anything, it only says what to do
> for one particular case.

For one sample case, I would say. Using other xdoclet2-plugins is
totally similar, and should be a no brainer if you'd know how xdoclet2
generally works. Other pages might help in this respect, although I'll
gladly hear your feedback, because we know they're probably
unsufficient.

> For example, the first thing I need to do is
> incorporate Hibernate into our project.

Incorporate? I fail to see the connection with xdoclet2 and/or maven,
here. However, if you mean "how to leverage xdoclet(2) to generate
hibernate mapping files", then again, I'll point you to the general
xdoclet2 docs and the xd2-hibernate-plugin specific docs (
http://xdoclet.codehaus.org/ and
http://xdoclet.codehaus.org/Hibernate+plugin - see the "hibernate
tags" and the "hibernate mapping plugin" pages in particular.)
Again, please comment on what to improve on these pages.

> How do I do that based on this
> page's example? How do I define the merge directory, the output
> directory, etc?

See above.

Please bear in mind the warning on top of
http://xdoclet.codehaus.org/Maven2+Plugin , help us improve it, and
feel free to join the xdoclet2-users and/or the xdoclet-plugins list
for xdoclet2-related information.


HTH,

greg

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



Re: Using XDoclet2 Hibernate with Maven2

2006-01-07 Thread Darryl L. Pierce

Grégory Joseph wrote:


For one sample case, I would say. Using other xdoclet2-plugins is
totally similar, and should be a no brainer if you'd know how xdoclet2
generally works. Other pages might help in this respect, although I'll
gladly hear your feedback, because we know they're probably
unsufficient.
 

I'm only familiar with XDoclet, so the page in question doesn't help me 
at all. It doesn't say how to invoke the targets or anything. Pardon my 
ignorance, but the whole Maven thing is new to me.



For example, the first thing I need to do is
incorporate Hibernate into our project.
   



Incorporate? I fail to see the connection with xdoclet2 and/or maven,
here.

Our build environment is Maven2. I'm trying to bring XDoclet2 into that 
environment. The page in question is showing how to do that.



However, if you mean "how to leverage xdoclet(2) to generate
hibernate mapping files", then again, I'll point you to the general
xdoclet2 docs and the xd2-hibernate-plugin specific docs (
http://xdoclet.codehaus.org/ and
http://xdoclet.codehaus.org/Hibernate+plugin - see the "hibernate
tags" and the "hibernate mapping plugin" pages in particular.)
Again, please comment on what to improve on these pages.

 

If the page gave an example commandline for invoking the XD2 targets, 
that would be nice.



How do I do that based on this
page's example? How do I define the merge directory, the output
directory, etc?
   



See above.

Please bear in mind the warning on top of
http://xdoclet.codehaus.org/Maven2+Plugin , help us improve it, and
feel free to join the xdoclet2-users and/or the xdoclet-plugins list
for xdoclet2-related information.

 

If the page answers the questions I've posted here that would be a great 
improvement. :)


--
Darryl L. Pierce <[EMAIL PROTECTED]>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly, 
I could have done." - Jon Stewart



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



Re: Using XDoclet2 Hibernate with Maven2

2006-01-07 Thread Srepfler Srgjan

Vote for this issue:
http://jira.codehaus.org/browse/XDOCLET-41
Maven2 must use better the feature of archetypes in order to facilitate 
the migration and adoption of it's technologies.


Srgjan

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



Re: [m2] - ${localRepository} values - weired problem

2006-01-07 Thread Brett Porter
Neither will work. You can't obtain the local repository in an
expression in the POM. FWIW, you DO NOT want to include the whole
local repository in your classpath. IT would be huge.

You should use the maven.[compile|runtime|test].classpath refid, and
list the appropriate dependencies.

- Brett

On 1/8/06, mvdp <[EMAIL PROTECTED]> wrote:
> Hi,
>
> You need to use ${settings.localRepository}.
>
> Martin
>
> -Oorspronkelijk bericht-
> Van: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Verzonden: vrijdag 6 januari 2006 20:59
> Aan: Maven Users List
> Onderwerp: [m2] - ${localRepository} values - weired problem
>
>
> Hi All,
>
> I using some antrun plugin, and i have this problem
>
> lets say i have my local repository at C:\.M2 and my settings.xml has
> entry like "/.M2/"
>
> in my  i have some ant scripts steps, for one of them i want to add
> all the jars localRepository as my class path, so  i add it like
>
> 
> 
> 
> 
>  
> 
> .
>
>
> coz, i don't  want to hard code my localRepository value here, but its not
> working for me , and i'm getting this error
>
> [ERROR] BUILD ERROR
> [INFO]
> 
> [INFO] Error executing ant tasks
> Embedded error: C:\Raghu\Shop\src\[local] -> file:\.M2 not found
>
> why its trying to subsititute ${localReposiotry}  valu with file protocol
> stuff.
>
> Are is there anyother way to do it ? just by having classes in dependecies
> section is not working so thats why i have to mention this classpath in
> explicit
>
> Any ideas? Please
>
>
> Thanks,
> Raghurajan G
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.14.15/223 - Release Date: 06-01-2006
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.14.15/223 - Release Date: 06-01-2006
>
>
> -
> 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]



release plugin with cvs provider??

2006-01-07 Thread dan tran
Any one with succussfull use of maven-release-plugin with your project in
cvs yet?

see http://jira.codehaus.org/browse/SCM-128

and http://jira.codehaus.org/browse/SCM-129

Advice is greatly appreciated.

-Dan


Re: [m2] How to get artifact and Maven project for dependencies and transitive dependencies

2006-01-07 Thread haginow2001-nabble
Thanks for the point Allan. However, I need to clarify that I'm not trying to 
resolve the dependencies within my plugin. My plugin does create a dependency 
report similar to project-info-reports:dependencies, however with the output as 
XML file, so that it can be rendered into various formats (e.g. XHTML, Plain 
text, PDF, etc.). I basically looked up the code in the plugin 
maven-project-info-reports-plugin, but it contains a lot of "TODOs". That's why 
I'm not sure if there is a better way to do the dependency resolution.

Thanks,
Chris

Allan Ramirez <[EMAIL PROTECTED]> wrote: Please try this link 
http://docs.codehaus.org/display/MAVENUSER/FAQs#FAQs-HowdoIgetaplugin%27sdependenciesfromaMojo%3F

-allan

[EMAIL PROTECTED] wrote:

>Hi,
>
>As part of my effort to write a customized dependency report (in XML), I 
>looked at the maven-project-reports-info-plugin to understand how the 
>dependency resolution works. I made a slight modification, as it somehow 
>didn't produce the results I wanted. I'm doing the following:
>
>To get a list of dependencies for a Maven project (List object contains a list 
>of Dependency objects):
>
>// get list of dependencies
>List dependencies = project.getDependencies();
>
>
>To get the project artifact associated with a dependency:
>
>// create project artifact for dependency
>Artifact depArtifact =
>artifactFactory
>.createProjectArtifact(dependency.getGroupId(), dependency
>.getArtifactId(), dependency.getVersion(),
>dependency.getScope());
>
>
>To get a Maven project object associated with an artifact (assuming that the 
>Artifact type is "pom"):
>
>// get project associated with artifact
> return mavenProjectBuilder.buildFromRepository(artifact,
> project.getRemoteArtifactRepositories(), localRepository);
>
>
>At last I'm resolving transitive dependencies by looking up the Maven project 
>object associated with a dependency, getting a list of dependencies from that 
>project object, getting the project artifact associated with each of those 
>dependencies (to get download URL and description). I can parse the dependency 
>tree by doing this recursively (though I'm stopping at level 1 at this point). 
>
>Can anybody tell me if there is a better way (and possibly a way which 
>guarantees that this still will work with Maven 2.1+) to do this work?
>
>Thanks,
>Chris
>
>
>  
>
>
>
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.1.371 / Virus Database: 267.14.14/222 - Release Date: 1/5/2006
>  
>

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



RE: [m2] How to get artifact and Maven project for dependencies and transitive dependencies

2006-01-07 Thread Brian E. Fox
Take a look at the http://mojo.codehaus.org/dependency-maven-plugin all
the code in there is about resolving dependencies and walking through
various dependency lists to filter type,scope, etc. I imagine all the
code you need will be in there. Basically you just need to call
project.getArtifacts and that will be all transitive included. 
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 9:59 PM
To: Maven Users List
Subject: Re: [m2] How to get artifact and Maven project for dependencies
and transitive dependencies

Thanks for the point Allan. However, I need to clarify that I'm not
trying to resolve the dependencies within my plugin. My plugin does
create a dependency report similar to project-info-reports:dependencies,
however with the output as XML file, so that it can be rendered into
various formats (e.g. XHTML, Plain text, PDF, etc.). I basically looked
up the code in the plugin maven-project-info-reports-plugin, but it
contains a lot of "TODOs". That's why I'm not sure if there is a better
way to do the dependency resolution.

Thanks,
Chris

Allan Ramirez <[EMAIL PROTECTED]> wrote: Please try this link
http://docs.codehaus.org/display/MAVENUSER/FAQs#FAQs-HowdoIgetaplugin%27
sdependenciesfromaMojo%3F

-allan

[EMAIL PROTECTED] wrote:

>Hi,
>
>As part of my effort to write a customized dependency report (in XML),
I looked at the maven-project-reports-info-plugin to understand how the
dependency resolution works. I made a slight modification, as it somehow
didn't produce the results I wanted. I'm doing the following:
>
>To get a list of dependencies for a Maven project (List object contains
a list of Dependency objects):
>
>// get list of dependencies
>List dependencies = project.getDependencies();
>
>
>To get the project artifact associated with a dependency:
>
>// create project artifact for dependency
>Artifact depArtifact =
>artifactFactory
>.createProjectArtifact(dependency.getGroupId(),
dependency
>.getArtifactId(), dependency.getVersion(),
>dependency.getScope());
>
>
>To get a Maven project object associated with an artifact (assuming
that the Artifact type is "pom"):
>
>// get project associated with artifact
> return mavenProjectBuilder.buildFromRepository(artifact,
> project.getRemoteArtifactRepositories(), localRepository);
>
>
>At last I'm resolving transitive dependencies by looking up the Maven
project object associated with a dependency, getting a list of
dependencies from that project object, getting the project artifact
associated with each of those dependencies (to get download URL and
description). I can parse the dependency tree by doing this recursively
(though I'm stopping at level 1 at this point). 
>
>Can anybody tell me if there is a better way (and possibly a way which
guarantees that this still will work with Maven 2.1+) to do this work?
>
>Thanks,
>Chris
>
>
>  
>
>---
>-
>
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.1.371 / Virus Database: 267.14.14/222 - Release Date: 
>1/5/2006
>  
>

-
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]



RE: [m2] How to get artifact and Maven project for dependencies and transitive dependencies

2006-01-07 Thread haginow2001-nabble
Brian,

Thanks for the pointer. I will take a look at the code of the plugin.

However, just a fyi:

project.getArtifacts() returns an empty list for me (even that I have 
dependencies defined, and I get them listed with my own plugin and with "mvn 
site"). 

The same with project.getDependencyArtifacts() (and I don't exactly understand 
what this should do anyways) except that it returns "null".

Thanks,
Chris


"Brian E. Fox" <[EMAIL PROTECTED]> wrote: Take a look at the 
http://mojo.codehaus.org/dependency-maven-plugin all
the code in there is about resolving dependencies and walking through
various dependency lists to filter type,scope, etc. I imagine all the
code you need will be in there. Basically you just need to call
project.getArtifacts and that will be all transitive included. 
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 9:59 PM
To: Maven Users List
Subject: Re: [m2] How to get artifact and Maven project for dependencies
and transitive dependencies

Thanks for the point Allan. However, I need to clarify that I'm not
trying to resolve the dependencies within my plugin. My plugin does
create a dependency report similar to project-info-reports:dependencies,
however with the output as XML file, so that it can be rendered into
various formats (e.g. XHTML, Plain text, PDF, etc.). I basically looked
up the code in the plugin maven-project-info-reports-plugin, but it
contains a lot of "TODOs". That's why I'm not sure if there is a better
way to do the dependency resolution.

Thanks,
Chris

Allan Ramirez  wrote: Please try this link
http://docs.codehaus.org/display/MAVENUSER/FAQs#FAQs-HowdoIgetaplugin%27
sdependenciesfromaMojo%3F

-allan

[EMAIL PROTECTED] wrote:

>Hi,
>
>As part of my effort to write a customized dependency report (in XML),
I looked at the maven-project-reports-info-plugin to understand how the
dependency resolution works. I made a slight modification, as it somehow
didn't produce the results I wanted. I'm doing the following:
>
>To get a list of dependencies for a Maven project (List object contains
a list of Dependency objects):
>
>// get list of dependencies
>List dependencies = project.getDependencies();
>
>
>To get the project artifact associated with a dependency:
>
>// create project artifact for dependency
>Artifact depArtifact =
>artifactFactory
>.createProjectArtifact(dependency.getGroupId(),
dependency
>.getArtifactId(), dependency.getVersion(),
>dependency.getScope());
>
>
>To get a Maven project object associated with an artifact (assuming
that the Artifact type is "pom"):
>
>// get project associated with artifact
> return mavenProjectBuilder.buildFromRepository(artifact,
> project.getRemoteArtifactRepositories(), localRepository);
>
>
>At last I'm resolving transitive dependencies by looking up the Maven
project object associated with a dependency, getting a list of
dependencies from that project object, getting the project artifact
associated with each of those dependencies (to get download URL and
description). I can parse the dependency tree by doing this recursively
(though I'm stopping at level 1 at this point). 
>
>Can anybody tell me if there is a better way (and possibly a way which
guarantees that this still will work with Maven 2.1+) to do this work?
>
>Thanks,
>Chris
>
>
>  
>
>---
>-
>
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.1.371 / Virus Database: 267.14.14/222 - Release Date: 
>1/5/2006
>  
>

-
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]





RE: [m2] How to get artifact and Maven project for dependencies and transitive dependencies

2006-01-07 Thread Brian E. Fox
This is probably because you need to have @requiresDependancyResolution
compile|test set in your mojo. The xxx-dependencies in the plugin I
mentioned have this set. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 10:51 PM
To: Maven Users List
Subject: RE: [m2] How to get artifact and Maven project for dependencies
and transitive dependencies

Brian,

Thanks for the pointer. I will take a look at the code of the plugin.

However, just a fyi:

project.getArtifacts() returns an empty list for me (even that I have
dependencies defined, and I get them listed with my own plugin and with
"mvn site"). 

The same with project.getDependencyArtifacts() (and I don't exactly
understand what this should do anyways) except that it returns "null".

Thanks,
Chris


"Brian E. Fox" <[EMAIL PROTECTED]> wrote: Take a look at the
http://mojo.codehaus.org/dependency-maven-plugin all the code in there
is about resolving dependencies and walking through various dependency
lists to filter type,scope, etc. I imagine all the code you need will be
in there. Basically you just need to call project.getArtifacts and that
will be all transitive included. 
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 9:59 PM
To: Maven Users List
Subject: Re: [m2] How to get artifact and Maven project for dependencies
and transitive dependencies

Thanks for the point Allan. However, I need to clarify that I'm not
trying to resolve the dependencies within my plugin. My plugin does
create a dependency report similar to project-info-reports:dependencies,
however with the output as XML file, so that it can be rendered into
various formats (e.g. XHTML, Plain text, PDF, etc.). I basically looked
up the code in the plugin maven-project-info-reports-plugin, but it
contains a lot of "TODOs". That's why I'm not sure if there is a better
way to do the dependency resolution.

Thanks,
Chris

Allan Ramirez  wrote: Please try this link
http://docs.codehaus.org/display/MAVENUSER/FAQs#FAQs-HowdoIgetaplugin%27
sdependenciesfromaMojo%3F

-allan

[EMAIL PROTECTED] wrote:

>Hi,
>
>As part of my effort to write a customized dependency report (in XML),
I looked at the maven-project-reports-info-plugin to understand how the
dependency resolution works. I made a slight modification, as it somehow
didn't produce the results I wanted. I'm doing the following:
>
>To get a list of dependencies for a Maven project (List object contains
a list of Dependency objects):
>
>// get list of dependencies
>List dependencies = project.getDependencies();
>
>
>To get the project artifact associated with a dependency:
>
>// create project artifact for dependency
>Artifact depArtifact =
>artifactFactory
>.createProjectArtifact(dependency.getGroupId(),
dependency
>.getArtifactId(), dependency.getVersion(),
>dependency.getScope());
>
>
>To get a Maven project object associated with an artifact (assuming
that the Artifact type is "pom"):
>
>// get project associated with artifact
> return mavenProjectBuilder.buildFromRepository(artifact,
> project.getRemoteArtifactRepositories(), localRepository);
>
>
>At last I'm resolving transitive dependencies by looking up the Maven
project object associated with a dependency, getting a list of
dependencies from that project object, getting the project artifact
associated with each of those dependencies (to get download URL and
description). I can parse the dependency tree by doing this recursively
(though I'm stopping at level 1 at this point). 
>
>Can anybody tell me if there is a better way (and possibly a way which
guarantees that this still will work with Maven 2.1+) to do this work?
>
>Thanks,
>Chris
>
>
>  
>
>---
>-
>
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.1.371 / Virus Database: 267.14.14/222 - Release Date: 
>1/5/2006
>  
>

-
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]






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



[m2] dependency-plugin: Doesn't copy transitive dependencies deeper than first level

2006-01-07 Thread haginow2001-nabble
If I'm not wrong, then the dependency-plugin doesn't copy transitive 
dependencies deeper than the first level (which are dependencies of 
dependencies of dependencies). 

For example: jdom has a dependency on jaxen which has a dependency on xom. 

A test project now has a dependency for jdom specified with scope compile. In 
that case I do not get xom copied into target/dependency.

Is there a way to configure the plugin so that it copies dependencies on all 
levels?

At last, I wish the plugin could be configured so that the dependencies could 
be copied into a tree rather than just as flattened tree.

Anybody any hint?

Thanks,
Chris
 


RE: [m2] dependency-plugin: Doesn't copy transitive dependencies deeper than first level

2006-01-07 Thread Brian E. Fox
It should get ALL transitive dependencies. I'll have to verify that
something isn't broken to cause this. As far as I know, there is no
difference between a transitive dependency on 1 level or 2, they should
all be in the artifacts list. The problem you see could have something
to do with the included scopes. Not every scope is transitively handled
the same way. Take a look here for the scope resolution:
http://maven.apache.org/guides/introduction/introduction-to-dependency-m
echanism.html


What would be the use case on the tree? Can you give me an example of
how you would expect the tree to look? 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 11:08 PM
To: users@maven.apache.org
Subject: [m2] dependency-plugin: Doesn't copy transitive dependencies
deeper than first level

If I'm not wrong, then the dependency-plugin doesn't copy transitive
dependencies deeper than the first level (which are dependencies of
dependencies of dependencies). 

For example: jdom has a dependency on jaxen which has a dependency on
xom. 

A test project now has a dependency for jdom specified with scope
compile. In that case I do not get xom copied into target/dependency.

Is there a way to configure the plugin so that it copies dependencies on
all levels?

At last, I wish the plugin could be configured so that the dependencies
could be copied into a tree rather than just as flattened tree.

Anybody any hint?

Thanks,
Chris
 



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



RE: [m2] dependency-plugin: Doesn't copy transitive dependencies deeper than first level

2006-01-07 Thread Brian E. Fox
I just verified with a local project, it is going much deeper than 1
level. I looked at the jdom pom...the jaxen dependency is optional.
Optional means don't transitively include, so any project including jdom
shouldn't get jaxen and thus anything jaxen includes. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 11:08 PM
To: users@maven.apache.org
Subject: [m2] dependency-plugin: Doesn't copy transitive dependencies
deeper than first level

If I'm not wrong, then the dependency-plugin doesn't copy transitive
dependencies deeper than the first level (which are dependencies of
dependencies of dependencies). 

For example: jdom has a dependency on jaxen which has a dependency on
xom. 

A test project now has a dependency for jdom specified with scope
compile. In that case I do not get xom copied into target/dependency.

Is there a way to configure the plugin so that it copies dependencies on
all levels?

At last, I wish the plugin could be configured so that the dependencies
could be copied into a tree rather than just as flattened tree.

Anybody any hint?

Thanks,
Chris
 



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



RE: [m2] How to get artifact and Maven project for dependencies and transitive dependencies

2006-01-07 Thread Brian E. Fox
You'd think as the author of the dependEncy plugin, I would know how to
spell dependEncy.
Change the resolution line to have an e instead of an a:
 * @requiresDependencyResolution compile
 
I tested this quickly and once that is corrected, it listed all my
dependEncies.



From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 11:28 PM
To: Brian E. Fox
Subject: RE: [m2] How to get artifact and Maven project for dependencies
and transitive dependencies


Nope, doesn't help. Let me show you a TestMojo I just created:



/**
 * Test Mojo
 *
 * @goal test
 * @requiresDependancyResolution compile
 */
public class TestMojo extends AbstractMojo {


/**
 * The Maven Project.
 *
 * @parameter expression="${project}"
 * @required
 * @readonly
 */
private MavenProject project = null;


/**
 * Execute Mojo.
 *
 * @throws MojoExecutionException If an error occurs.
 * @throws MojoFailureException If an error occurs.
 */
public void execute() throws MojoExecutionException,
MojoFailureException {

// get logger
Log logger = getLog();

Set artifacts = project.getArtifacts();
if (artifacts == null) {
logger.error("No artifacts");
} else {

logger.info("Starting to iterate through artifacts");

for (Iterator i = artifacts.iterator(); i.hasNext();) {
Artifact a = (Artifact) i.next();
logger.info("Artifact: " + a.getId());
}

}
logger.info("Done");


artifacts = project.getDependencyArtifacts();
if (artifacts == null) {
logger.error("No artifacts");
} else {

logger.info("Starting to iterate through artifacts");

for (Iterator i = artifacts.iterator(); i.hasNext();) {
Artifact a = (Artifact) i.next();
logger.info("Artifact: " + a.getId());
}

}
logger.info("Done");
}

}

The example dependencies in the POM are configured like:




log4j
log4j
1.2.13


dom4j
dom4j
1.6
compile


junit
junit
3.8.1
test


commons-dbcp
commons-dbcp
1.2



And all I get is: 

[INFO] [mhave:test]
[INFO] Starting to iterate through artifacts
[INFO] Done
[ERROR] No artifacts
[INFO] Done
[INFO]

-
---
[INFO] BUILD SUCCESSFUL
[INFO]

-



"Brian E. Fox" <[EMAIL PROTECTED]> wrote: 

This is probably because you need to have
@requiresDependancyResolution
compile|test set in your mojo. The xxx-dependencies in the
plugin I
mentioned have this set. 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 10:51 PM
To: Maven Users List
Subject: RE: [m2] How to get artifact and Maven project for
dependencies
and transitive dependencies

Brian,

Thanks for the pointer. I will take a look at the code of the
plugin.

However, just a fyi:

project.getArtifacts() returns an empty list for me (even that I
have
dependencies defined, and I get them listed with my own plugin
and with
"mvn site"). 

The same with project.getDependencyArtifacts() (and I don't
exactly
understand what this should do anyways) except that it returns
"null".

Thanks,
Chris


"Brian E. Fox" wrote: Take a look at the
http://mojo.codehaus.org/dependency-maven-plugin all the code in
there
is about resolving dependencies and walking through various
dependency
lists to filter type,scope, etc. I imagine all the code you need
will be
in there. Basically you just need to call project.getArtifacts
and that
will be all transitive included. 


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 9:59 PM
To: Maven Users List
Subject: Re: [m2] How to get artifact and Maven project for
dependencies
and transitive dependencies

Thanks for the point Allan. However, I need to clarify that I'm
not
trying to resolve the dependencies within my plugin. My plugin
does
create a dependency report similar to
project-info-reports:dependencies,
however with the output as XML file, so that it can be rendered
into
various formats (e.g. XHTML, Plain text, PDF, etc.).

RE: [m2] dependency-plugin: Doesn't copy transitive dependencies deeper than first level

2006-01-07 Thread haginow2001-nabble
Brian,

I actually did the test with dom4j 1.6 (not jdom as I mentioned - I always 
confuse those two). The dom4j 1.6 POM has a dependency on Jaxen specified as:


  jaxen
  jaxen
  1.1-beta-4


Jaxen 1.1-beta-4 has a dependency in the POM for XOM:


  xom
  xom
  1.0b3


But xom isn't copied over to target/dependency in my case.

One thing which is funny in my test case though is that Jaxen 1.1-beta-4 has a 
dependency declared on dom4j 1.5.2 (kinda circular dependency):


  dom4j
  dom4j
  1.5.2


Could that be causing an issue and make my test case invalid?

Chris





"Brian E. Fox" <[EMAIL PROTECTED]> wrote: I just verified with a local project, 
it is going much deeper than 1
level. I looked at the jdom pom...the jaxen dependency is optional.
Optional means don't transitively include, so any project including jdom
shouldn't get jaxen and thus anything jaxen includes. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 11:08 PM
To: users@maven.apache.org
Subject: [m2] dependency-plugin: Doesn't copy transitive dependencies
deeper than first level

If I'm not wrong, then the dependency-plugin doesn't copy transitive
dependencies deeper than the first level (which are dependencies of
dependencies of dependencies). 

For example: jdom has a dependency on jaxen which has a dependency on
xom. 

A test project now has a dependency for jdom specified with scope
compile. In that case I do not get xom copied into target/dependency.

Is there a way to configure the plugin so that it copies dependencies on
all levels?

At last, I wish the plugin could be configured so that the dependencies
could be copied into a tree rather than just as flattened tree.

Anybody any hint?

Thanks,
Chris
 



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





RE: [m2] How to get artifact and Maven project for dependencies and transitive dependencies

2006-01-07 Thread haginow2001-nabble
Indeed this fixes it and I start to see something going ... Thanks a lot!

Last question:

the diff between project.getDependencies() and project.getDependencyArtifacts() 
is basically that getDependencies() returns also transitive dependencies? I'm 
assuming it follows the guidelines as documented at 
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html.

Chris

"Brian E. Fox" <[EMAIL PROTECTED]> wrote: You'd think as the author of the 
dependEncy plugin, I would know how to
spell dependEncy.
Change the resolution line to have an e instead of an a:
 * @requiresDependencyResolution compile
 
I tested this quickly and once that is corrected, it listed all my
dependEncies.



From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 11:28 PM
To: Brian E. Fox
Subject: RE: [m2] How to get artifact and Maven project for dependencies
and transitive dependencies


Nope, doesn't help. Let me show you a TestMojo I just created:



/**
 * Test Mojo
 *
 * @goal test
 * @requiresDependancyResolution compile
 */
public class TestMojo extends AbstractMojo {


/**
 * The Maven Project.
 *
 * @parameter expression="${project}"
 * @required
 * @readonly
 */
private MavenProject project = null;


/**
 * Execute Mojo.
 *
 * @throws MojoExecutionException If an error occurs.
 * @throws MojoFailureException If an error occurs.
 */
public void execute() throws MojoExecutionException,
MojoFailureException {

// get logger
Log logger = getLog();

Set artifacts = project.getArtifacts();
if (artifacts == null) {
logger.error("No artifacts");
} else {

logger.info("Starting to iterate through artifacts");

for (Iterator i = artifacts.iterator(); i.hasNext();) {
Artifact a = (Artifact) i.next();
logger.info("Artifact: " + a.getId());
}

}
logger.info("Done");


artifacts = project.getDependencyArtifacts();
if (artifacts == null) {
logger.error("No artifacts");
} else {

logger.info("Starting to iterate through artifacts");

for (Iterator i = artifacts.iterator(); i.hasNext();) {
Artifact a = (Artifact) i.next();
logger.info("Artifact: " + a.getId());
}

}
logger.info("Done");
}

}

The example dependencies in the POM are configured like:




log4j
log4j
1.2.13


dom4j
dom4j
1.6
compile


junit
junit
3.8.1
test


commons-dbcp
commons-dbcp
1.2



And all I get is: 

[INFO] [mhave:test]
[INFO] Starting to iterate through artifacts
[INFO] Done
[ERROR] No artifacts
[INFO] Done
[INFO]

-
---
[INFO] BUILD SUCCESSFUL
[INFO]

-



"Brian E. Fox" 
 wrote: 

 This is probably because you need to have
@requiresDependancyResolution
 compile|test set in your mojo. The xxx-dependencies in the
plugin I
 mentioned have this set. 
 
 -Original Message-
 From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
 
 Sent: Saturday, January 07, 2006 10:51 PM
 To: Maven Users List
 Subject: RE: [m2] How to get artifact and Maven project for
dependencies
 and transitive dependencies
 
 Brian,
 
 Thanks for the pointer. I will take a look at the code of the
plugin.
 
 However, just a fyi:
 
 project.getArtifacts() returns an empty list for me (even that I
have
 dependencies defined, and I get them listed with my own plugin
and with
 "mvn site"). 
 
 The same with project.getDependencyArtifacts() (and I don't
exactly
 understand what this should do anyways) except that it returns
"null".
 
 Thanks,
 Chris
 
 
 "Brian E. Fox" wrote: Take a look at the
 http://mojo.codehaus.org/dependency-maven-plugin all the code in
there
 is about resolving dependencies and walking through various
dependency
 lists to filter type,scope, etc. I imagine all the code you need
will be
 in there. Basically you just need to call project.getArtifacts
and that
 will be all transitive included. 
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
 
 Sent: Saturday, January 07, 2006 9:59 PM
 To: Maven Users List
 Subject: Re: [m2] How to get artifact and Maven project for
dependencies
 and transitive dependencies
 
 Thanks for the point Allan. However, I need to clarify that I'm
not
 trying to resolve the dependencies within my plugin. My plugin
does
 create a dependency report similar to
project-info-reports:dependencies,
 however with the output as XML file, so that it 

dependencyResolution question

2006-01-07 Thread Brian E. Fox
Is it normal that a mojo with resolution set to compile has the
following behavior:
project.getArtifacts returns things in the compile scope including
transitive dependencies.
project.getDependencyArtifacts returns only the direct dependencies, but
also includes things in the test scope. 
 
I would have expected that things in the test scope would be excluded in
this case unless I change the resolution to test.


RE: [m2] How to get artifact and Maven project for dependencies and transitive dependencies

2006-01-07 Thread Brian E. Fox
" Last question:

the diff between project.getDependencies() and
project.getDependencyArtifacts() is basically that getDependencies()
returns also transitive dependencies?"

Yes. Although see my previous message under "dependencyResolution
question" because I noticed that test scope things where included in
getDependencyArtifacts.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 11:42 PM
To: Maven Users List
Subject: RE: [m2] How to get artifact and Maven project for dependencies
and transitive dependencies

Indeed this fixes it and I start to see something going ... Thanks a
lot!

Last question:

the diff between project.getDependencies() and
project.getDependencyArtifacts() is basically that getDependencies()
returns also transitive dependencies? I'm assuming it follows the
guidelines as documented at
http://maven.apache.org/guides/introduction/introduction-to-dependency-m
echanism.html.

Chris

"Brian E. Fox" <[EMAIL PROTECTED]> wrote: You'd think as the
author of the dependEncy plugin, I would know how to spell dependEncy.
Change the resolution line to have an e instead of an a:
 * @requiresDependencyResolution compile
 
I tested this quickly and once that is corrected, it listed all my
dependEncies.



From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 11:28 PM
To: Brian E. Fox
Subject: RE: [m2] How to get artifact and Maven project for dependencies
and transitive dependencies


Nope, doesn't help. Let me show you a TestMojo I just created:



/**
 * Test Mojo
 *
 * @goal test
 * @requiresDependancyResolution compile  */ public class TestMojo
extends AbstractMojo {


/**
 * The Maven Project.
 *
 * @parameter expression="${project}"
 * @required
 * @readonly
 */
private MavenProject project = null;


/**
 * Execute Mojo.
 *
 * @throws MojoExecutionException If an error occurs.
 * @throws MojoFailureException If an error occurs.
 */
public void execute() throws MojoExecutionException,
MojoFailureException {

// get logger
Log logger = getLog();

Set artifacts = project.getArtifacts();
if (artifacts == null) {
logger.error("No artifacts");
} else {

logger.info("Starting to iterate through artifacts");

for (Iterator i = artifacts.iterator(); i.hasNext();) {
Artifact a = (Artifact) i.next();
logger.info("Artifact: " + a.getId());
}

}
logger.info("Done");


artifacts = project.getDependencyArtifacts();
if (artifacts == null) {
logger.error("No artifacts");
} else {

logger.info("Starting to iterate through artifacts");

for (Iterator i = artifacts.iterator(); i.hasNext();) {
Artifact a = (Artifact) i.next();
logger.info("Artifact: " + a.getId());
}

}
logger.info("Done");
}

}

The example dependencies in the POM are configured like:




log4j
log4j
1.2.13


dom4j
dom4j
1.6
compile


junit
junit
3.8.1
test


commons-dbcp
commons-dbcp
1.2



And all I get is: 

[INFO] [mhave:test]
[INFO] Starting to iterate through artifacts [INFO] Done [ERROR] No
artifacts [INFO] Done [INFO]

-
---
[INFO] BUILD SUCCESSFUL
[INFO]

-



"Brian E. Fox" 
 wrote: 

 This is probably because you need to have @requiresDependancyResolution
compile|test set in your mojo. The xxx-dependencies in the plugin I
mentioned have this set. 
 
 -Original Message-
 From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
 
 Sent: Saturday, January 07, 2006 10:51 PM
 To: Maven Users List
 Subject: RE: [m2] How to get artifact and Maven project for
dependencies  and transitive dependencies
 
 Brian,
 
 Thanks for the pointer. I will take a look at the code of the plugin.
 
 However, just a fyi:
 
 project.getArtifacts() returns an empty list for me (even that I have
dependencies defined, and I get them listed with my own plugin and with
"mvn site"). 
 
 The same with project.getDependencyArtifacts() (and I don't exactly
understand what this should do anyways) except that it returns "null".
 
 Thanks,
 Chris
 
 
 "Brian E. Fox" wrote: Take a look at the
http://mojo.codehaus.org/dependency-maven-plugin all the code in there
is about resolving dependencies and walking through various dependency
lists to filter type,scope, etc. I imagine all the code you need will be
in there. Basically you just need to call project.getArti

RE: [m2] dependency-plugin: Doesn't copy transitive dependencies deeper than first level

2006-01-07 Thread Brian E. Fox
I think this is a maven bug. Since it hits the cyclic dom4j, it
completely stops including all the rest of jaxen dependencies. I removed
the dom4j in my local repo from the jaxen jar, and everything including
xom,xerces etc (the rest of the jaxen depends) are included.

 dom4j:dom4j:jar:1.5.2 (selected for compile)
[DEBUG] stax:stax-api:jar:1.0 (selected for compile)
[DEBUG] pull-parser:pull-parser:jar:2 (selected for compile)
[DEBUG] jaxme:jaxme-api:jar:0.3 (selected for compile)
[WARNING] 
  This artifact has been relocated to xml-apis:xml-apis:1.0.b2.


[DEBUG] xml-apis:xml-apis:jar:1.0.b2 (selected for compile)
[DEBUG] msv:xsdlib:jar:20030807 (selected for compile)
[DEBUG] xpp3:xpp3:jar:1.1.3.3 (selected for compile)
[DEBUG] dom4j:dom4j:jar:1.5.2 (removed - causes a cycle in the
graph)
[DEBUG] jaxen:jaxen:jar:1.1-beta-4 (selected for compile)
[DEBUG] msv:relaxngDatatype:jar:20030807 (selected for compile)

 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 11:38 PM
To: Maven Users List
Subject: RE: [m2] dependency-plugin: Doesn't copy transitive
dependencies deeper than first level

Brian,

I actually did the test with dom4j 1.6 (not jdom as I mentioned - I
always confuse those two). The dom4j 1.6 POM has a dependency on Jaxen
specified as:


  jaxen
  jaxen
  1.1-beta-4


Jaxen 1.1-beta-4 has a dependency in the POM for XOM:


  xom
  xom
  1.0b3


But xom isn't copied over to target/dependency in my case.

One thing which is funny in my test case though is that Jaxen 1.1-beta-4
has a dependency declared on dom4j 1.5.2 (kinda circular dependency):


  dom4j
  dom4j
  1.5.2


Could that be causing an issue and make my test case invalid?

Chris





"Brian E. Fox" <[EMAIL PROTECTED]> wrote: I just verified with a
local project, it is going much deeper than 1 level. I looked at the
jdom pom...the jaxen dependency is optional.
Optional means don't transitively include, so any project including jdom
shouldn't get jaxen and thus anything jaxen includes. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 11:08 PM
To: users@maven.apache.org
Subject: [m2] dependency-plugin: Doesn't copy transitive dependencies
deeper than first level

If I'm not wrong, then the dependency-plugin doesn't copy transitive
dependencies deeper than the first level (which are dependencies of
dependencies of dependencies). 

For example: jdom has a dependency on jaxen which has a dependency on
xom. 

A test project now has a dependency for jdom specified with scope
compile. In that case I do not get xom copied into target/dependency.

Is there a way to configure the plugin so that it copies dependencies on
all levels?

At last, I wish the plugin could be configured so that the dependencies
could be copied into a tree rather than just as flattened tree.

Anybody any hint?

Thanks,
Chris
 



-
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]



RE: [m2] dependency-plugin: Doesn't copy transitive dependencies deeper than first level

2006-01-07 Thread Brian E. Fox
http://jira.codehaus.org/browse/MNG-1944 

-Original Message-
From: Brian E. Fox [mailto:[EMAIL PROTECTED] 
Sent: Saturday, January 07, 2006 11:52 PM
To: Maven Users List; [EMAIL PROTECTED]
Subject: RE: [m2] dependency-plugin: Doesn't copy transitive
dependencies deeper than first level

I think this is a maven bug. Since it hits the cyclic dom4j, it
completely stops including all the rest of jaxen dependencies. I removed
the dom4j in my local repo from the jaxen jar, and everything including
xom,xerces etc (the rest of the jaxen depends) are included.

 dom4j:dom4j:jar:1.5.2 (selected for compile)
[DEBUG] stax:stax-api:jar:1.0 (selected for compile)
[DEBUG] pull-parser:pull-parser:jar:2 (selected for compile)
[DEBUG] jaxme:jaxme-api:jar:0.3 (selected for compile)
[WARNING]
  This artifact has been relocated to xml-apis:xml-apis:1.0.b2.


[DEBUG] xml-apis:xml-apis:jar:1.0.b2 (selected for compile)
[DEBUG] msv:xsdlib:jar:20030807 (selected for compile)
[DEBUG] xpp3:xpp3:jar:1.1.3.3 (selected for compile)
[DEBUG] dom4j:dom4j:jar:1.5.2 (removed - causes a cycle in the
graph)
[DEBUG] jaxen:jaxen:jar:1.1-beta-4 (selected for compile)
[DEBUG] msv:relaxngDatatype:jar:20030807 (selected for compile)

 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 11:38 PM
To: Maven Users List
Subject: RE: [m2] dependency-plugin: Doesn't copy transitive
dependencies deeper than first level

Brian,

I actually did the test with dom4j 1.6 (not jdom as I mentioned - I
always confuse those two). The dom4j 1.6 POM has a dependency on Jaxen
specified as:


  jaxen
  jaxen
  1.1-beta-4


Jaxen 1.1-beta-4 has a dependency in the POM for XOM:


  xom
  xom
  1.0b3


But xom isn't copied over to target/dependency in my case.

One thing which is funny in my test case though is that Jaxen 1.1-beta-4
has a dependency declared on dom4j 1.5.2 (kinda circular dependency):


  dom4j
  dom4j
  1.5.2


Could that be causing an issue and make my test case invalid?

Chris





"Brian E. Fox" <[EMAIL PROTECTED]> wrote: I just verified with a
local project, it is going much deeper than 1 level. I looked at the
jdom pom...the jaxen dependency is optional.
Optional means don't transitively include, so any project including jdom
shouldn't get jaxen and thus anything jaxen includes. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Saturday, January 07, 2006 11:08 PM
To: users@maven.apache.org
Subject: [m2] dependency-plugin: Doesn't copy transitive dependencies
deeper than first level

If I'm not wrong, then the dependency-plugin doesn't copy transitive
dependencies deeper than the first level (which are dependencies of
dependencies of dependencies). 

For example: jdom has a dependency on jaxen which has a dependency on
xom. 

A test project now has a dependency for jdom specified with scope
compile. In that case I do not get xom copied into target/dependency.

Is there a way to configure the plugin so that it copies dependencies on
all levels?

At last, I wish the plugin could be configured so that the dependencies
could be copied into a tree rather than just as flattened tree.

Anybody any hint?

Thanks,
Chris
 



-
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]




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