You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Julien Graglia <jg...@netceler.com> on 2008/11/03 17:37:33 UTC

Access pom information from outside maven context

Hi,

I'd like to access to the org.apache.maven.project.MavenProject or
org.apache.maven.model.Model from 'outside' of the maven plugin
environment.

I dont want to (I can't) write a maven plugin that get thoses deps
injected by plexus or Spring.
I need to access pom's information from an external java program.
I know how to do that in a maven plugin context but not from outside.

I try to do it by hand (new DefaultArtifactRepositoryFactory, new
DefaultArtifactResolver, new DefaultArtifactTransformationManager, new
DefaultWagonManager, new DefaultArtifact...) but whith IoC, private
members and all thoses interfaces, it's quite difficult to get it to
work...

Do you any idea how to do that?

Thx,
-- 
Julien Graglia
NetCeler


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


Re: Access pom information from outside maven context

Posted by Julien Graglia <jg...@netceler.com>.
Le lundi 03 novembre 2008 à 16:43 +0000, Mark Hobson a écrit :
> If you just want to introspect POM metadata then have a look at maven-runtime:
> 
> http://maven.apache.org/shared/maven-runtime/
> 
> Mark
Thx Mark, that sounds great! 
I will certainly  use that in another project (to list versions of
installed artifacts...)

But in this problem I want to launch a 'pure' (*) java class who can
access a repository and list the available versions of an
groupid:artifactId, and get the pom of an artifact (as Xml ou
mavenProject or Model, or...)

* : ie. not a maven plugin. sth like
java -cp xxx.jar:lib/ MyClass com.xxx:an-artifact:0.5 -f
configfileThatListrepositories


> 
> 2008/11/3 Julien Graglia <jg...@netceler.com>:
> > Hi,
> >
> > I'd like to access to the org.apache.maven.project.MavenProject or
> > org.apache.maven.model.Model from 'outside' of the maven plugin
> > environment.
> >
> > I dont want to (I can't) write a maven plugin that get thoses deps
> > injected by plexus or Spring.
> > I need to access pom's information from an external java program.
> > I know how to do that in a maven plugin context but not from outside.
> >
> > I try to do it by hand (new DefaultArtifactRepositoryFactory, new
> > DefaultArtifactResolver, new DefaultArtifactTransformationManager, new
> > DefaultWagonManager, new DefaultArtifact...) but whith IoC, private
> > members and all thoses interfaces, it's quite difficult to get it to
> > work...
> >
> > Do you any idea how to do that?
> >
> > Thx,
> > --
> > Julien Graglia
> > NetCeler
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

-- 
Julien Graglia
NetCeler


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


Re: Access pom information from outside maven context

Posted by Mark Hobson <ma...@gmail.com>.
If you just want to introspect POM metadata then have a look at maven-runtime:

http://maven.apache.org/shared/maven-runtime/

Mark

2008/11/3 Julien Graglia <jg...@netceler.com>:
> Hi,
>
> I'd like to access to the org.apache.maven.project.MavenProject or
> org.apache.maven.model.Model from 'outside' of the maven plugin
> environment.
>
> I dont want to (I can't) write a maven plugin that get thoses deps
> injected by plexus or Spring.
> I need to access pom's information from an external java program.
> I know how to do that in a maven plugin context but not from outside.
>
> I try to do it by hand (new DefaultArtifactRepositoryFactory, new
> DefaultArtifactResolver, new DefaultArtifactTransformationManager, new
> DefaultWagonManager, new DefaultArtifact...) but whith IoC, private
> members and all thoses interfaces, it's quite difficult to get it to
> work...
>
> Do you any idea how to do that?
>
> Thx,
> --
> Julien Graglia
> NetCeler
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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