Package org.pomizer.model

Examples of org.pomizer.model.Dependency


       
        if (null != dependenciesNode) {
            for (int i = 0; i < dependenciesNode.nodeCount(); i++) {
                Node dependecyNode = (Node) dependenciesNode.node(i);
                if (Node.ELEMENT_NODE == dependecyNode.getNodeType()) {
                    Dependency dependency = XmlUtils.readDependencyFromXml(dependecyNode, true);
                    if (-1 == dependencies.indexOf(dependency)) {
                        dependencies.add(dependency);
                    }
                }
            }
View Full Code Here


            Node dependecyNode = (Node) dependenciesNode.node(i);
            if (Node.ELEMENT_NODE == dependecyNode.getNodeType()) {
                if (pomDependenciesIndex < 0) {
                    throw new Exception("Unsynchronized dependencies list with XML on index: " + i);
                }
                Dependency dependency = pomDependeciesList.get(pomDependenciesIndex);
                if (-1 == dependencies.indexOf(dependency)) {
                    dependecyNode.detach();
                    pomDependeciesList.remove(pomDependenciesIndex);
                }
                pomDependenciesIndex--;
            }
        }
           
        for (int i = 0; i < dependencies.size(); i++) {
            Dependency dependency = dependencies.get(i);
            if (-1 == pomDependeciesList.indexOf(dependency)) {
                XmlUtils.addDependencyToXmlParent(dependenciesNode, dependency);
                pomDependeciesList.add(dependency);
            }
        }
View Full Code Here

        }
    }
   
    public static Dependency createDependecy(final String basePath, final String relativeFileName, final String version) {

        Dependency result = null;
       
        File jarFilePath = new File(basePath, relativeFileName);
       
        String groupId = MANUAL_GROUP_ID + "." + StringUtils.convertPathToObjectName(jarFilePath.getParent());
        String fileName = jarFilePath.getName();
        fileName = fileName.substring(0, fileName.length() - ".jar".length());
        String artifactId = fileName;
       
        result = new Dependency();
        result.groupId = groupId;
        result.artifactId = artifactId;
        result.version = version;
       
        return result;
View Full Code Here

        return result;
    }

    public static Dependency installJarFile(final String version, final String basePath, final String relativeFileName)
            throws Exception {
        Dependency result = null;

        boolean successful = false;

        File jarFilePath = new File(basePath, relativeFileName);
        if (!jarFilePath.exists()) {
View Full Code Here

    public static Dependency readDependencyFromXml(final Node node) {
        return readDependencyFromXml(node, false);
    }

    public static Dependency readDependencyFromXml(final Node node, final boolean usePomNamespace) {
        Dependency result = new Dependency();
        if (null != node) {
            result.groupId = getChildNodeTrimmedText(node, XmlConstants.ARTIFACT_GROUP_ID, usePomNamespace);
            result.artifactId = getChildNodeTrimmedText(node, XmlConstants.ARTIFACT_ID, usePomNamespace);
            result.version = getChildNodeTrimmedText(node, XmlConstants.ARTIFACT_VERSION, usePomNamespace);
        }
View Full Code Here

    public static void writeDependeciesToPomFile(final FileWriter fileWritter, final List<Dependency> dependencies)
            throws IOException {

        fileWritter.write("  <dependencies>\n");
        for (int i = 0; i < dependencies.size(); i++) {
            Dependency dependency = dependencies.get(i);
            fileWritter.write("    <dependency>\n");
            fileWritter.write("      <groupId>" + dependency.groupId + "</groupId>\n");
            fileWritter.write("      <artifactId>" + dependency.artifactId + "</artifactId>\n");
            fileWritter.write("      <version>" + dependency.version + "</version>\n");
            fileWritter.write("    </dependency>\n");
View Full Code Here

                        missingClassWithPackageErrors, missingClassErrors);

                for (int j = 0; j < newJarDependencies.size(); j++) {
                    JavaUtils.printToConsole(String.format("Installing file \"%s\" to local repository...",
                            newJarDependencies.get(j).name));
                    Dependency newDependency = MavenUtils.installJarFile(indeces.version,
                            indeces.basePaths[newJarDependencies.get(j).basePathIndex], newJarDependencies.get(j).name);
                    if (-1 == dependencies.indexOf(newDependency)) {
                        newDependency.jarIndex = newJarDependencies.get(j).index;
                        dependencies.add(newDependency);
                    }
View Full Code Here

    private static void assignJarIndexToDependency(final List<Dependency> dependencies, final IndexInfo indeces) {
        if (dependencies.size() > 0) {
            for (int i = 0; i < indeces.jarNames.length; i++) {
                int basePathIndex = indeces.jarNamesBasePathIndex[i];
                Dependency jarDependency = MavenUtils.createDependecy(indeces.basePaths[basePathIndex],
                        indeces.jarNames[i], indeces.version);
                int dependencyIndex = dependencies.indexOf(jarDependency);
                if (-1 < dependencyIndex) {
                    dependencies.get(dependencyIndex).jarIndex = i;
                }
View Full Code Here

TOP

Related Classes of org.pomizer.model.Dependency

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.