@Override protected void configure() { bind(ModelLocator.class).to(DefaultModelLocator.class).in(Singleton.class); bind(ModelReader.class).to(DefaultModelReader.class).in(Singleton.class); bind(ModelValidator.class).to(DefaultModelValidator.class).in(Singleton.class); bind(RepositoryConnectorFactory.class).to(BasicRepositoryConnectorFactory.class) .in(Singleton.class); bind(ArtifactDescriptorReader.class) // .to(DefaultArtifactDescriptorReader.class).in(Singleton.class); bind(VersionResolver.class) // .to(DefaultVersionResolver.class).in(Singleton.class); bind(VersionRangeResolver.class) // .to(DefaultVersionRangeResolver.class).in(Singleton.class); bind(MetadataGeneratorFactory.class).annotatedWith(Names.named("snapshot")) // .to(SnapshotMetadataGeneratorFactory.class).in(Singleton.class); bind(MetadataGeneratorFactory.class).annotatedWith(Names.named("versions")) // .to(VersionsMetadataGeneratorFactory.class).in(Singleton.class); bind(TransporterFactory.class).annotatedWith(Names.named("http")) .to(HttpTransporterFactory.class).in(Singleton.class); bind(TransporterFactory.class).annotatedWith(Names.named("file")) .to(FileTransporterFactory.class).in(Singleton.class); }
public POMManager(String inputResource, Project project) { this(project, false); try { //source ModelReader reader = EmbedderFactory.getProjectEmbedder().lookupComponent(ModelReader.class); sourceModel = reader.read(FileUtil.loadResource(inputResource), Collections.singletonMap(ModelReader.IS_STRICT, false)); } catch (IOException ex) { Exceptions.printStackTrace(ex); } }
private static Model getModel() { ModelReader modelReader = new DefaultModelReader(); try { return modelReader.read(new File("pom.xml"), null); } catch (IOException cause) { throw new RuntimeException(cause); } }
@Override protected void setUp() throws Exception { super.setUp(); reader = lookup( ModelReader.class ); writer = lookup( ModelWriter.class ); assembler = lookup( InheritanceAssembler.class ); }
public DefaultModelProcessor setModelReader( ModelReader reader ) { this.reader = reader; return this; }
protected ModelReader newModelReader() { return new DefaultModelReader(); }