maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Moser, Christian" <...@metrohm.com>
Subject AW: get MavenProject reference from module path
Date Thu, 03 Feb 2011 16:09:16 GMT
Thanks brain!

Solved it with:

final MavenSession session = (MavenSession) helper.evaluate("${session}");
            final DefaultProjectBuilder defaultProjectBuilder = (DefaultProjectBuilder) helper.getComponent(ProjectBuilder.class);
            final Set<MavenProject> baseSysModules = new HashSet<MavenProject>();

            final Set<File> subSysComps = getSubSysCompsAsFile(baseSysProject);
            final Iterator<File> it = subSysComps.iterator();

            while (it.hasNext()) {
                File pomFile = it.next();
                ProjectBuildingResult request = defaultProjectBuilder.build(pomFile, session.getProjectBuildingRequest());
                baseSysModules.add(request.getProject());
            }

-----Urspr√ľngliche Nachricht-----
Von: Brian Fox [mailto:brianf@infinity.nu] 
Gesendet: Mittwoch, 2. Februar 2011 22:00
An: Maven Developers List
Betreff: Re: get MavenProject reference from module path

The projectbuilder comes to mind.

On Wed, Feb 2, 2011 at 11:29 AM, Moser, Christian <cmo@metrohm.com> wrote:
> I'm currently developing a custom enforcer rule.
>
>
>
> How can I get object references to all modules of a parent pom ?
>
>
>
> final List<String> modulesRelativePath = parentProject.getModules();
>
>
>
> delivers only the relative path to the project pom. I need something
> like :
>
>
>
> final List<MavenProject> subSystemProjects =
> baseSysProject.getProjectsFromModules();
>
>
>
> Is there any Helper class which could deliver a MavenProject reference
> by relativePath?
>
>
>
>
>
> Thanks Christian
>
>
>
>
>
>
>
>

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



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


Mime
View raw message