You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Halvor Platou <Ha...@marinecyb.com> on 2013/03/27 12:28:57 UTC
Default implemenation of ModuleResolver?
Hi,
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();
modelBuilder.build(req);
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