当前位置: 首页>>代码示例>>Java>>正文


Java Project类代码示例

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


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

示例1: testCreate

import aQute.bnd.build.Project; //导入依赖的package包/类
public void testCreate() throws Exception {
    Log log = new SystemStreamLog();
    Workspace workspace = printInfo("Building using BND Build..", log, getWorkspace(new File("/Users/tonit/devel/rebaze/workspaceBNDBridge")));
    Project workspaceProject = workspace.getProject("test-impl");
    log.info("Project nobundle    : " + workspaceProject.isNoBundles());

    File[] files = workspaceProject.build();
    if (files != null) {
        for (File f : files) {
            log.info("OUT " + f.getAbsolutePath());
        }
    }else{
        for (String err : workspaceProject.getErrors()) {
            log.error(err);
        }
        throw new RuntimeException("No output from build!");
    }
    Utils.printInfo("Build done: " + workspaceProject.getName(), log, workspace);
   
    workspace.close();
}
 
开发者ID:tonit,项目名称:pax-bnd-mavenplugin,代码行数:22,代码来源:WorkspaceTest.java

示例2: execute

import aQute.bnd.build.Project; //导入依赖的package包/类
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
    File[] files = null;

    try {
        Workspace workspace = printInfo("Building using BND Build..", getLog(), getWorkspace(new File(session.getExecutionRootDirectory())));
        Project workspaceProject = retrieveProject(workspace);
        getLog().info("Setting Maven Artifact Version to: " + workspaceProject.getBundleVersion());
        project.setVersion(workspaceProject.getBundleVersion());
        project.getArtifact().setVersion(workspaceProject.getBundleVersion());
        files = buildProject(workspaceProject);
        Utils.printInfo("Build done: " + workspaceProject.getName(), getLog(), workspace);
        workspace.close();
    } catch (Exception e) {
        throw new MojoExecutionException("Problem building the project.", e);
    }

    if (files.length != 1) {
        throw new MojoExecutionException("Ambiguous output from BND to attach as maven result");
    }
    // attach bundle to maven project
    File jarFile = files[0];

    Artifact mainArtifact = project.getArtifact();

    if ("bundle".equals(mainArtifact.getType())) {
        // workaround for MNG-1682: force maven to install artifact using
        // the "jar" handler
        mainArtifact.setArtifactHandler(m_artifactHandlerManager.getArtifactHandler("jar"));
    }
    mainArtifact.setFile(jarFile);
}
 
开发者ID:tonit,项目名称:pax-bnd-mavenplugin,代码行数:33,代码来源:BundleMojo.java

示例3: buildProject

import aQute.bnd.build.Project; //导入依赖的package包/类
private File[] buildProject(Project workspaceProject) throws Exception {
    File[] files = workspaceProject.build();
    List<String> errors = workspaceProject.getErrors();
    for (String error : errors) {
        getLog().error(error);
    }
    if (errors.size() > 0) {
        throw new MojoExecutionException("There are build errors!.");
    }
    return files;
}
 
开发者ID:tonit,项目名称:pax-bnd-mavenplugin,代码行数:12,代码来源:BundleMojo.java

示例4: execute

import aQute.bnd.build.Project; //导入依赖的package包/类
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
    Set<Artifact> artifacts = new HashSet<Artifact>();
    try {
        Workspace workspace = printInfo("Running the Pax BND Buildpath Mojo", getLog(), getWorkspace(new File(session.getExecutionRootDirectory())));
        Project workspaceProject = workspace.getProject(project.getArtifactId());
        if (project == null)
            throw new MojoExecutionException("Something is broken with your workspace. Cannot find " + project.getArtifactId() + "(from pom.xml) in BND Workspace.");

        for (Project dep : workspaceProject.getDependson()) {
            for (Container deliverable : dep.getDeliverables()) {
                getLog().info("+ " + deliverable.getFile().getAbsolutePath());
                artifacts.add(asArtifact(deliverable.getFile()));
            }
        }
        Collection<Container> cp = workspaceProject.getBuildpath();

        for (Container entry : cp) {
            getLog().info("+ " + entry.getFile().getAbsolutePath());
            artifacts.add(asArtifact(entry.getFile()));
        }
        workspace.close();
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    session.getCurrentProject().setResolvedArtifacts(artifacts);
}
 
开发者ID:tonit,项目名称:pax-bnd-mavenplugin,代码行数:29,代码来源:BuildpathhMojo.java

示例5: testFoo

import aQute.bnd.build.Project; //导入依赖的package包/类
public void testFoo() {
    try {
        File baseDir = new File("/Users/tonit/devel/rebaze/workspaceBNDBridge");
        System.out.println("Workspace is" + baseDir.getAbsolutePath());

        Workspace workspace = new Workspace(baseDir);
        for (Project project : workspace.getAllProjects()) {
            System.out.println("Project found: " + project.getName());

            for (Container container : project.getDeliverables()) {
                System.out.println(" + Deliverale " + container.getFile().getAbsolutePath());
            }

            Collection<Container> cp = project.getBuildpath();
            for (Container entry : cp) {
                System.out.println("+ " + entry.getFile().getAbsolutePath());
            }

            for (Container f : project.getClasspath()) {
                System.out.println("------> build file: " + f.getFile().getAbsolutePath());
            }
            for (Project dep : project.getDependson()) {
                System.out.println("Dep: " + dep.getName() + " --> " + dep.getOutput().getAbsolutePath());

            }
        }

        workspace.close();
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
 
开发者ID:tonit,项目名称:pax-bnd-mavenplugin,代码行数:34,代码来源:WorkspaceTest.java

示例6: DianneLauncher

import aQute.bnd.build.Project; //导入依赖的package包/类
public DianneLauncher(Project project) throws Exception {
	super(project);
}
 
开发者ID:ibcn-cloudlet,项目名称:dianne,代码行数:4,代码来源:DianneLauncher.java

示例7: retrieveProject

import aQute.bnd.build.Project; //导入依赖的package包/类
private Project retrieveProject(Workspace workspace) throws Exception, MojoExecutionException {
    Project workspaceProject = workspace.getProject(project.getArtifactId());
    if (project == null)
        throw new MojoExecutionException("Something is broken with your workspace. Cannot find " + project.getArtifactId() + "(from pom.xml) in BND Workspace.");
    return workspaceProject;
}
 
开发者ID:tonit,项目名称:pax-bnd-mavenplugin,代码行数:7,代码来源:BundleMojo.java


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