maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Halvor Platou <>
Subject Default implemenation of ModuleResolver?
Date Wed, 27 Mar 2013 11:28:57 GMT

I'm trying to use Maven as part of a java application to read the effective MavenModel of
a pom-project, and eventually fetch some dependencies. My problem is that not all parents
are available locally and I seem to need a ModelResolver.

Here is what I have so far:

DefaultModelBuildingRequest req = new DefaultModelBuildingRequest();
req.setPomFile(new File(pomFile));
DefaultModelBuilderFactory mbf = new DefaultModelBuilderFactory();
DefaultModelBuilder modelBuilder = mbf.newInstance();;

But the build throws an IllegalArgumentException: "no model resolver provided, cannot resolve
parent POM..."

I see that the DefaultModelBuildingRequest has a setModelResolver(). Are there any implementations
of ModelResolver available for use externally or do I have to implement one myself?

Halvor Platou
R&D Manager CyberSea Technology
Marine Cybernetics
Trondheim, Norway

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message