• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ModelBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.maven.model.building.ModelBuilder的典型用法代码示例。如果您正苦于以下问题:Java ModelBuilder类的具体用法?Java ModelBuilder怎么用?Java ModelBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ModelBuilder类属于org.apache.maven.model.building包,在下文中一共展示了ModelBuilder类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: configure

import org.apache.maven.model.building.ModelBuilder; //导入依赖的package包/类
@Override
    public void configure(Binder binder) {
        binder.bind(PluginDependenciesResolver.class).to(NbPluginDependenciesResolver.class);
        binder.bind(Roles.componentKey(RepositoryConnectorFactory.class, "offline")).to(OfflineConnector.class);
        //#212214 the EnhancedLocalRepositoryManager will claim artifact is not locally present even if file is there but some metadata is missing
        //we just replace it with the simple variant that relies on file's presence only. 
        //I'm a bit afraid to remove the binding altogether, that's why we map simple to enhanced.
        binder.bind(Roles.componentKey(LocalRepositoryManagerFactory.class, "enhanced")).to(SimpleLocalRepositoryManagerFactory.class);
        
        //exxperimental only.
//        binder.bind(InheritanceAssembler.class).to(NbInheritanceAssembler.class);
        binder.bind(ModelBuilder.class).to(NBModelBuilder.class);
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ExtensionModule.java


示例2: complexModelBuilding

import org.apache.maven.model.building.ModelBuilder; //导入依赖的package包/类
/**
 *
 * TODO: This does not currently work.
 *
 */
@SuppressWarnings("unused")
private static Model complexModelBuilding(File file) throws Exception {

    ModelBuilder builder = new DefaultModelBuilder();
    ModelBuildingRequest request = new DefaultModelBuildingRequest();
    request.setProcessPlugins(false);
    request.setPomFile(file);
    // request.setModelResolver(new ModelResolver() {});
    request.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);

    //noinspection UnnecessaryLocalVariable
    Model model = builder.build(request).getEffectiveModel();
    return model;
}
 
开发者ID:NovaOrdis,项目名称:playground,代码行数:20,代码来源:Main.java


示例3: createModel

import org.apache.maven.model.building.ModelBuilder; //导入依赖的package包/类
public static Model createModel(File pom) throws ModelBuildingException, ComponentLookupException
{
	ModelBuilder builder = mavenContainer.lookup(ModelBuilder.class);
	ModelBuildingRequest req = new DefaultModelBuildingRequest();
	req.setProcessPlugins(false);
	req.setModelResolver(new RepoModelResolver());
	req.setPomFile(pom);
	return builder.build(req).getEffectiveModel();
}
 
开发者ID:bnavetta,项目名称:tycho-gen,代码行数:10,代码来源:Maven.java


示例4: getRepositorySystem

import org.apache.maven.model.building.ModelBuilder; //导入依赖的package包/类
public RepositorySystem getRepositorySystem()
{

   final DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
   locator.setServices(ModelBuilder.class, new DefaultModelBuilderFactory().newInstance());
   // Installing Wagon to fetch from HTTP repositories
   locator.setServices(WagonProvider.class, new ManualWagonProvider());
   locator.addService(TransporterFactory.class, WagonTransporterFactory.class);
   locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
   final RepositorySystem repositorySystem = locator.getService(RepositorySystem.class);
   return repositorySystem;
}
 
开发者ID:forge,项目名称:furnace,代码行数:13,代码来源:MavenContainer.java


示例5: loadPomFromFile

import org.apache.maven.model.building.ModelBuilder; //导入依赖的package包/类
public Model loadPomFromFile(File pomFile, String... profiles)
{
   RepositorySystem system = mavenContainer.getRepositorySystem();
   Settings settings = mavenContainer.getSettings();
   DefaultRepositorySystemSession session = mavenContainer.setupRepoSession(system, settings);
   final DefaultModelBuildingRequest request = new DefaultModelBuildingRequest()
            .setSystemProperties(System.getProperties())
            .setPomFile(pomFile)
            .setActiveProfileIds(settings.getActiveProfiles());
   ModelBuilder builder = new DefaultModelBuilderFactory().newInstance();
   ModelBuildingResult result;
   try
   {
      request.setModelResolver(new MavenModelResolver(system, session,
               MavenRepositories.getRemoteRepositories(mavenContainer, settings)));
      result = builder.build(request);
   }
   // wrap exception message
   catch (ModelBuildingException e)
   {
      String pomPath = request.getPomFile().getAbsolutePath();
      StringBuilder sb = new StringBuilder("Found ").append(e.getProblems().size())
               .append(" problems while building POM model from ").append(pomPath).append("\n");

      int counter = 1;
      for (ModelProblem problem : e.getProblems())
      {
         sb.append(counter++).append("/ ").append(problem).append("\n");
      }

      throw new RuntimeException(sb.toString());
   }
   return result.getEffectiveModel();
}
 
开发者ID:forge,项目名称:furnace,代码行数:35,代码来源:ProjectHelper.java


示例6: initService

import org.apache.maven.model.building.ModelBuilder; //导入依赖的package包/类
public void initService( ServiceLocator locator )
{
    setLogger( locator.getService( Logger.class ) );
    setRemoteRepositoryManager( locator.getService( RemoteRepositoryManager.class ) );
    setVersionResolver( locator.getService( VersionResolver.class ) );
    setArtifactResolver( locator.getService( ArtifactResolver.class ) );
    setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) );
    modelBuilder = locator.getService( ModelBuilder.class );
    if ( modelBuilder == null )
    {
        setModelBuilder( new DefaultModelBuilderFactory().newInstance() );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:14,代码来源:DefaultArtifactDescriptorReader.java


示例7: setModelBuilder

import org.apache.maven.model.building.ModelBuilder; //导入依赖的package包/类
public DefaultArtifactDescriptorReader setModelBuilder( ModelBuilder modelBuilder )
{
    if ( modelBuilder == null )
    {
        throw new IllegalArgumentException( "model builder has not been specified" );
    }
    this.modelBuilder = modelBuilder;
    return this;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:10,代码来源:DefaultArtifactDescriptorReader.java


示例8: constructModel

import org.apache.maven.model.building.ModelBuilder; //导入依赖的package包/类
private Model constructModel(File file, Model model) {
  ModelBuilder modelBuilder = MODEL_BUILDER_FACTORY.newInstance();

  try {
    ModelBuildingRequest req = new DefaultModelBuildingRequest().setPomFile(file);
    ModelBuildingResult modelBuildingResult = modelBuilder.build(req);

    Model constructed = Preconditions.checkNotNull(modelBuildingResult.getRawModel());

    return merge(model, constructed);
  } catch (ModelBuildingException e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:facebook,项目名称:buck,代码行数:15,代码来源:Pom.java


示例9: getRepositorySystem

import org.apache.maven.model.building.ModelBuilder; //导入依赖的package包/类
public RepositorySystem getRepositorySystem()
{

   final DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
   locator.setServices(ModelBuilder.class, new DefaultModelBuilderFactory().newInstance());
   // Installing Wagon to fetch from HTTP repositories
   locator.setServices(WagonProvider.class, new ManualWagonProvider());
   locator.addService(RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class);
   final RepositorySystem repositorySystem = locator.getService(RepositorySystem.class);
   return repositorySystem;
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:12,代码来源:MavenContainer.java


示例10: loadPomFromFile

import org.apache.maven.model.building.ModelBuilder; //导入依赖的package包/类
public Model loadPomFromFile(File pomFile, String... profiles)
{
   RepositorySystem system = mavenContainer.getRepositorySystem();
   Settings settings = mavenContainer.getSettings();
   DefaultRepositorySystemSession session = mavenContainer.setupRepoSession(system, settings);
   final DefaultModelBuildingRequest request = new DefaultModelBuildingRequest()
            .setSystemProperties(System.getProperties())
            .setPomFile(pomFile)
            .setActiveProfileIds(settings.getActiveProfiles());
   ModelBuilder builder = new DefaultModelBuilderFactory().newInstance();
   ModelBuildingResult result;
   try
   {
      request.setModelResolver(new MavenModelResolver(system, session, mavenContainer
               .getEnabledRepositoriesFromProfile(settings)));
      result = builder.build(request);
   }
   // wrap exception message
   catch (ModelBuildingException e)
   {
      String pomPath = request.getPomFile().getAbsolutePath();
      StringBuilder sb = new StringBuilder("Found ").append(e.getProblems().size())
               .append(" problems while building POM model from ").append(pomPath).append("\n");

      int counter = 1;
      for (ModelProblem problem : e.getProblems())
      {
         sb.append(counter++).append("/ ").append(problem).append("\n");
      }

      throw new RuntimeException(sb.toString());
   }
   return result.getEffectiveModel();
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:35,代码来源:ProjectHelper.java



注:本文中的org.apache.maven.model.building.ModelBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Polyline类代码示例发布时间:2022-05-22
下一篇:
Java ImageHyperlink类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap