Examples of Pom


Examples of org.springframework.roo.project.maven.Pom

            }
            return result;
        }

        String topLevelPath;
        Pom module = projectOperations.getFocusedModule();

        if (value.contains(MODULE_PATH_SEPARATOR)) {
            final String moduleName = value.substring(0,
                    value.indexOf(MODULE_PATH_SEPARATOR));
            module = projectOperations.getPomFromModuleName(moduleName);
View Full Code Here

Examples of org.springframework.roo.project.maven.Pom

            final List<Completion> completions, final String existingData,
            final String optionContext) {
        if (!projectOperations.isFocusedProjectAvailable()) {
            return;
        }
        final Pom targetModule;
        final String heading;
        final String prefix;
        final String formattedPrefix;
        final String typeName;
        if (existingData.contains(MODULE_PATH_SEPARATOR)) {
            // Looking for a type in another module
            final String targetModuleName = existingData.substring(0,
                    existingData.indexOf(MODULE_PATH_SEPARATOR));
            targetModule = projectOperations
                    .getPomFromModuleName(targetModuleName);
            heading = "";
            prefix = targetModuleName + MODULE_PATH_SEPARATOR;
            formattedPrefix = decorate(
                    targetModuleName + MODULE_PATH_SEPARATOR, FG_CYAN);
            typeName = StringUtils.substringAfterLast(existingData,
                    MODULE_PATH_SEPARATOR);
        }
        else {
            // Looking for a type in the currently focused module
            targetModule = projectOperations.getFocusedModule();
            heading = targetModule.getModuleName();
            prefix = "";
            formattedPrefix = "";
            typeName = existingData;
        }
        final String topLevelPackage = typeLocationService
                .getTopLevelPackageForModule(targetModule);
        final String basePackage = resolveTopLevelPackageSymbol(typeName,
                topLevelPackage);

        addCompletionsForOtherModuleNames(completions, targetModule);

        if (!"pom".equals(targetModule.getPackaging())) {
            addCompletionsForTypesInTargetModule(completions, optionContext,
                    targetModule, heading, prefix, formattedPrefix,
                    topLevelPackage, basePackage);
        }
    }
View Full Code Here

Examples of org.springframework.roo.project.maven.Pom

    @Test
    public void testGetFocusedModuleWhenChildModuleHasFocus() {
        // Set up
        when(mockPomManagementService.getFocusedModuleName()).thenReturn(
                "child");
        final Pom mockChildPom = mock(Pom.class);
        final ProjectMetadata mockChildMetadata = mock(ProjectMetadata.class);
        when(mockChildMetadata.getPom()).thenReturn(mockChildPom);
        when(
                mockMetadataService.get(ProjectMetadata
                        .getProjectIdentifier("child"))).thenReturn(
View Full Code Here

Examples of org.springframework.roo.project.maven.Pom

        when(mockDependency.getType()).thenReturn(DependencyType.JAR);
        when(mockDependency.getVersion()).thenReturn(VERSION);
        when(mockMetadataService.get(ProjectMetadata.getProjectIdentifier("")))
                .thenReturn(mockProjectMetadata);

        final Pom pom = mock(Pom.class);
        when(pom.getPath()).thenReturn(POM_PATH);
        when(mockProjectMetadata.getPom()).thenReturn(pom);

        final Collection<Dependency> dependencies = Arrays.asList(
                mockDependency, mockDependency);
        when(pom.isAnyDependenciesRegistered(dependencies)).thenReturn(true);
        when(pom.isDependencyRegistered(mockDependency)).thenReturn(true);

        // Invoke
        projectOperations.removeDependencies("", dependencies);

        // Check
View Full Code Here

Examples of org.springframework.roo.project.maven.Pom

    public String getName() {
        return FeatureNames.GAE;
    }

    public boolean isInstalledInModule(final String moduleName) {
        final Pom pom = projectOperations.getPomFromModuleName(moduleName);
        if (pom == null) {
            return false;
        }
        for (final Plugin buildPlugin : pom.getBuildPlugins()) {
            if ("appengine-maven-plugin".equals(buildPlugin.getArtifactId())) {
                return true;
            }
        }
        return false;
View Full Code Here

Examples of org.springframework.roo.project.maven.Pom

    public String getName() {
        return FeatureNames.DATABASE_DOT_COM;
    }

    public boolean isInstalledInModule(final String moduleName) {
        final Pom pom = projectOperations.getPomFromModuleName(moduleName);
        if (pom == null) {
            return false;
        }
        for (final Plugin buildPlugin : pom.getBuildPlugins()) {
            if ("com.force.sdk".equals(buildPlugin.getArtifactId())) {
                return true;
            }
        }
        return false;
View Full Code Here

Examples of org.springframework.roo.project.maven.Pom

        when(mockModulePath.getLogicalPath()).thenReturn(logicalPath);
        return mockModulePath;
    }

    private Pom getMockPom(final String rootPath) {
        final Pom mockPom = mock(Pom.class);
        when(mockPom.getRoot()).thenReturn(rootPath);
        return mockPom;
    }
View Full Code Here

Examples of org.springframework.roo.project.maven.Pom

    private void setUpModulePaths() {
        final PhysicalPath mockModuleSourcePath = getMockModulePath(true,
                mockSourcePath);
        final PhysicalPath mockModuleNonSourcePath = getMockModulePath(false,
                mockNonSourcePath);
        final Pom mockPom = mock(Pom.class);
        when(mockPom.getPhysicalPaths()).thenReturn(
                Arrays.asList(mockModuleSourcePath, mockModuleNonSourcePath));
        when(mockPomManagementService.getPoms()).thenReturn(
                Arrays.asList(mockPom));
    }
View Full Code Here

Examples of org.springframework.roo.project.maven.Pom

                modulePathIds);
    }

    @Test
    public void testGetIdentifierForNewModuleWithEmptyRelativePath() {
        final Pom mockParentPom = getMockPom(POM_PATH);
        when(mockPomManagementService.getFocusedModule()).thenReturn(
                mockParentPom);
        final String expectedIdentifier = FileUtils.getSystemDependentPath(
                POM_PATH, NEW_MODULE, PATH_RELATIVE_TO_POM) + File.separator;
        assertIdentifier(null, NEW_MODULE, "", expectedIdentifier);
View Full Code Here

Examples of org.springframework.roo.project.maven.Pom

        return dependencies;
    }

    private JsfImplementation getExistingOrDefaultJsfImplementation(
            final Element configuration) {
        final Pom pom = projectOperations
                .getPomFromModuleName(projectOperations.getFocusedModuleName());
        JsfImplementation existingJsfImplementation = null;
        for (final JsfImplementation value : JsfImplementation.values()) {
            final Element jsfDependencyElement = XmlUtils.findFirstElement(
                    JSF_IMPLEMENTATION_XPATH + "[@id = '" + value.name() + "']"
                            + DEPENDENCY_XPATH, configuration);
            if (jsfDependencyElement != null
                    && pom.isDependencyRegistered(new Dependency(
                            jsfDependencyElement))) {
                existingJsfImplementation = value;
                break;
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.