Examples of IdeDependency


Examples of com.alibaba.citrus.maven.eclipse.base.ide.IdeDependency

    /** {@inheritDoc} */
    public String getProjectNameForArifact(Artifact artifact) {
        IdeDependency[] workspaceArtefacts = getWorkspaceArtefacts();
        for (int index = 0; workspaceArtefacts != null && index < workspaceArtefacts.length; index++) {
            IdeDependency workspaceArtefact = workspaceArtefacts[index];
            if (workspaceArtefact.isAddedToClasspath()
                && workspaceArtefact.getGroupId().equals(artifact.getGroupId())
                && workspaceArtefact.getArtifactId().equals(artifact.getArtifactId())) {
                if (workspaceArtefact.getVersion().equals(artifact.getBaseVersion())) {
                    return workspaceArtefact.getEclipseProjectName();
                }
            }
        }
        MavenProject reactorProject = getReactorProject(artifact);
        if (reactorProject != null) {
View Full Code Here

Examples of com.alibaba.citrus.maven.eclipse.base.ide.IdeDependency

     * @return <code>true</code> if the artifact is produced by a reactor projectart.
     */
    private boolean isAvailableAsAWorkspaceProject(Artifact artifact) {
        IdeDependency[] workspaceArtefacts = getWorkspaceArtefacts();
        for (int index = 0; workspaceArtefacts != null && index < workspaceArtefacts.length; index++) {
            IdeDependency workspaceArtefact = workspaceArtefacts[index];
            if (workspaceArtefact.getGroupId().equals(artifact.getGroupId())
                && workspaceArtefact.getArtifactId().equals(artifact.getArtifactId())) {
                if (workspaceArtefact.getVersion().equals(artifact.getBaseVersion())) {
                    workspaceArtefact.setAddedToClasspath(true);
                    getLog().debug("Using workspace project: " + workspaceArtefact.getEclipseProjectName());
                    return true;
                } else {
                    getLog().info(
                            "Artifact "
                            + artifact.getId()
                            + " already available as a workspace project, but with different version. Expected: "
                            + artifact.getBaseVersion() + ", found: " + workspaceArtefact.getVersion());
                }
            }
        }
        return false;
    }
View Full Code Here

Examples of com.alibaba.citrus.maven.eclipse.base.ide.IdeDependency

        // referenced projects should not be added for plugins
        if (!config.isPde()) {
            List duplicates = new ArrayList();
            for (int j = 0; j < dependencies.length; j++) {
                IdeDependency dep = dependencies[j];
                // Avoid duplicates entries when same project is refered using multiple types
                // (ejb, test-jar ...)
                if (dep.isReferencedProject() && !duplicates.contains(dep.getEclipseProjectName())) {
                    writer.startElement("project"); //$NON-NLS-1$
                    writer.writeText(dep.getEclipseProjectName());
                    writer.endElement();
                    duplicates.add(dep.getEclipseProjectName());
                }
            }
        }

        writer.endElement(); // projects
View Full Code Here

Examples of com.alibaba.citrus.maven.eclipse.base.ide.IdeDependency

    protected void writeResourceLinksForPdeProject(XMLWriter writer, IdeDependency[] dependencies)
            throws MojoExecutionException {
        if (config.isPde()) {
            for (int j = 0; j < dependencies.length; j++) {
                IdeDependency dep = dependencies[j];

                if (dep.isAddedToClasspath() && !dep.isProvided() && !dep.isReferencedProject()
                    && !dep.isTestDependency() && !dep.isOsgiBundle()) {
                    String name = dep.getFile().getName();
                    addLink(writer, name, IdeUtils.fixSeparator(IdeUtils.getCanonicalPath(dep.getFile())),
                            LINK_TYPE_FILE);
                }
            }
        }
    }
View Full Code Here

Examples of com.alibaba.citrus.maven.eclipse.base.ide.IdeDependency

        // iterate relevant dependencies (non-test, non-provided, project)
        IdeDependency[] deps = config.getDeps();
        if (deps != null) {
            for (int i = 0; i < deps.length; i++) {
                final IdeDependency dependency = deps[i];
                log.debug("RadWebSettingsWriter: checking dependency " + dependency.toString());

                if (dependency.isReferencedProject() && !dependency.isTestDependency() && !dependency.isProvided()) {
                    log.debug("RadWebSettingsWriter: dependency " + dependency.toString()
                              + " selected for inclusion as lib-module");

                    String depName = dependency.getEclipseProjectName();
                    String depJar = dependency.getArtifactId() + ".jar";

                    writer.startElement(WEBSETTINGS_LIBMODULE);

                    writer.startElement(WEBSETTINGS_LM_JAR);
                    writer.writeText(depJar);
View Full Code Here

Examples of com.alibaba.citrus.maven.eclipse.base.ide.IdeDependency

        bundleClasspathSb.append(" .");

        IdeDependency[] deps = config.getDeps();

        for (int j = 0; j < deps.length; j++) {
            IdeDependency dep = deps[j];
            if (!dep.isProvided() && !dep.isReferencedProject() && !dep.isTestDependency() && !dep.isOsgiBundle()) {
                bundleClasspathSb.append("," + NEWLINE);

                log.debug("Adding artifact to manifest: " + dep.getArtifactId());

                bundleClasspathSb.append(" " + getDependencyPathForPde(dep.getFile().getName()));
            }
        }
        // only insert the name of the property if there are local libraries
        return bundleClasspathSb.toString();
    }
View Full Code Here

Examples of com.alibaba.citrus.maven.eclipse.base.ide.IdeDependency

        // Java API dependencies that may complete the classpath container must
        // be declared BEFORE all other dependencies so that container access rules don't fail
        // ----------------------------------------------------------------------
        IdeDependency[] depsToWrite = config.getDeps();
        for (int j = 0; j < depsToWrite.length; j++) {
            IdeDependency dep = depsToWrite[j];
            if (dep.isJavaApi()) {
                String depId = getDependencyId(dep);
                if (!addedDependencies.contains(depId)) {
                    addDependency(writer, dep);
                    addedDependencies.add(depId);
                }
            }
        }

        if (!config.isClasspathContainersLast()) {
            writeClasspathContainers(writer);
        }

        // ----------------------------------------------------------------------
        // The project's dependencies
        // ----------------------------------------------------------------------
        for (int j = 0; j < depsToWrite.length; j++) {
            IdeDependency dep = depsToWrite[j];

            if (dep.isAddedToClasspath()) {
                String depId = getDependencyId(dep);
                /* avoid duplicates in the classpath for artifacts with different types (like ejbs or test-jars) */
                if (!addedDependencies.contains(depId)) {
                    addDependency(writer, dep);
                    addedDependencies.add(depId);
View Full Code Here

Examples of com.alibaba.citrus.maven.eclipse.base.ide.IdeDependency

        if (project.getPackaging().equals(Constants.PROJECT_PACKAGING_WAR)) {
            deployDir = "/WEB-INF/lib";
        }
        // dependencies
        for (int j = 0; j < config.getDeps().length; j++) {
            IdeDependency dep = config.getDeps()[j];
            String type = dep.getType();

            // NB war is needed for ear projects, we suppose nobody adds a war dependency to a war/jar project
            // exclude test and provided and system dependencies outside the project
            if ((!dep.isTestDependency() && !dep.isProvided() && !dep.isSystemScopedOutsideProject(project))
                && (Constants.PROJECT_PACKAGING_JAR.equals(type) || Constants.PROJECT_PACKAGING_EJB.equals(type)
                    || "ejb-client".equals(type) || Constants.PROJECT_PACKAGING_WAR.equals(type))) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
            {
                addDependency(writer, dep, localRepository, config.getProject().getBasedir(), deployDir);
            }
View Full Code Here

Examples of com.alibaba.citrus.maven.eclipse.base.ide.IdeDependency

                                                                           null));
            String packaging = getValue(pom, ReadWorkspaceLocations.PACKAGING, "jar");

            logger.debug("found workspace artefact " + group + ":" + artifact + ":" + version + " " + packaging + " ("
                         + eclipseProjectName + ")" + " -> " + projectLocation.getAbsolutePath());
            return new IdeDependency(group, artifact, version, packaging, true, false, false, false, false, null,
                                     packaging, false, null, 0, eclipseProjectName);
        } else {
            logger.debug("ignored workspace project NO pom available " + projectLocation.getAbsolutePath());
            return null;
        }
View Full Code Here

Examples of com.alibaba.citrus.maven.eclipse.base.ide.IdeDependency

                    try {
                        File projectLocation =
                                getProjectLocation(workspaceConfiguration.getWorkspaceDirectory(), project);
                        if (projectLocation != null) {
                            logger.debug("read workpsace project " + projectLocation);
                            IdeDependency ideDependency = readArtefact(projectLocation, logger);
                            if (ideDependency != null) {
                                dependencies.add(ideDependency);
                            }
                        }
                    } catch (Exception e) {
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.