Package org.apache.sling.maven.projectsupport.bundlelist.v1_0_0

Examples of org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle


    private final void initBundleList() throws IOException, XmlPullParserException, MojoExecutionException {
        initArtifactDefinitions();
        if (BundleListUtils.isCurrentArtifact(project, defaultBundleList)) {
            initializedBundleList = readBundleList(bundleListFile);
        } else {
            initializedBundleList = new BundleList();
            if (includeDefaultBundles) {
                Artifact defBndListArtifact = getArtifact(defaultBundleList.getGroupId(),
                        defaultBundleList.getArtifactId(), defaultBundleList.getVersion(), defaultBundleList.getType(),
                        defaultBundleList.getClassifier());
                getLog().info("Using bundle list file from " + defBndListArtifact.getFile().getAbsolutePath());
View Full Code Here


     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="zip"
     */
    private ZipArchiver zipArchiver;

    public void execute() throws MojoExecutionException, MojoFailureException {
        final BundleList initializedBundleList;
        if (bundleListFile.exists()) {
            try {
                initializedBundleList = readBundleList(bundleListFile);
            } catch (IOException e) {
                throw new MojoExecutionException("Unable to read bundle list file", e);
View Full Code Here

            final Version oldVersion = new Version(converter.getVersion(current.getVersion()));
            if ( newVersion.compareTo(oldVersion) > 0 ) {
                current.setVersion(newBnd.getVersion());
            }
        } else {
            StartLevel startLevel = null;
            if ( mergeStartLevel == null || newBnd.getStartLevel() != 0) {
                startLevel = getOrCreateStartLevel(newBnd.getStartLevel());
            } else {
                startLevel = getOrCreateStartLevel(mergeStartLevel.getStartLevel());
            }
            startLevel.getBundles().add(newBnd);
        }
    }
View Full Code Here

            if (sl.getStartLevel() == startLevel) {
                return sl;
            }
        }

        StartLevel sl = new StartLevel();
        getStartLevels().add(sl);
        sl.setRawLevel(startLevel);
        return sl;
    }
View Full Code Here

            getLog().info("");
        }
    }

    private BundleList readBundleList(File file) throws IOException, XmlPullParserException {
        BundleListXpp3Reader reader = new BundleListXpp3Reader();
        FileInputStream fis = new FileInputStream(file);
        try {
            return reader.read(fis);
        } finally {
            fis.close();
        }
    }
View Full Code Here

    public static boolean isCurrentArtifact(MavenProject project, ArtifactDefinition def) {
        return (def.getGroupId().equals(project.getGroupId()) && def.getArtifactId().equals(project.getArtifactId()));
    }
   
    public static BundleList readBundleList(File file) throws IOException, XmlPullParserException {
        BundleListXpp3Reader reader = new BundleListXpp3Reader();
        FileInputStream fis = new FileInputStream(file);
        try {
            return reader.read(fis);
        } finally {
            fis.close();
        }
    }
View Full Code Here

        "someFile.properties"
    };
   
    @BeforeClass
    public static void parseBundleList() throws Exception {
        final BundleListXpp3Reader reader = new BundleListXpp3Reader();
        final InputStream is = BundleListContentProviderTest.class.getClassLoader().getResourceAsStream(TEST_BUNDLE_LIST);
        assertNotNull("Expecting " + TEST_BUNDLE_LIST + " to be found", is);
        try {
            bundleList = reader.read(is);
        } finally {
            is.close();
        }
    }
View Full Code Here

            throw new MojoFailureException(String.format("Bundle list file %s does not exist.", bundleListFile.getAbsolutePath()));
        }

        interpolateProperties(initializedBundleList, this.project, this.mavenSession);

        final BundleListXpp3Writer writer = new BundleListXpp3Writer();
        try {
            this.bundleListOutput.getParentFile().mkdirs();
            writer.write(new FileWriter(bundleListOutput), initializedBundleList);
        } catch (IOException e) {
            throw new MojoExecutionException("Unable to write bundle list", e);
        }

        // if this project is a partial bundle list, it's the main artifact
View Full Code Here

*/
public class OutputBundleListMojo extends AbstractUsingBundleListMojo {

    @Override
    protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
        BundleListXpp3Writer writer = new BundleListXpp3Writer();
        try {
            writer.write(new OutputStreamWriter(System.out), getInitializedBundleList());
        } catch (IOException e) {
            throw new MojoExecutionException("Unable to write bundle list", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.