Package org.apache.maven.plugin.ide

Examples of org.apache.maven.plugin.ide.IdeDependency


        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

        writer.startElement( ELT_BUILD_SPEC );

        for ( Iterator it = buildCommands.iterator(); it.hasNext(); )
        {
            ( (BuildCommand) it.next() ).print( writer );
        }

        writer.endElement(); // buildSpec

        writer.startElement( ELT_NATURES );

        for ( Iterator it = projectnatures.iterator(); it.hasNext(); )
        {
            writer.startElement( ELT_NATURE );
            writer.writeText( (String) it.next() );
            writer.endElement(); // name
        }

        writer.endElement(); // natures

        boolean addLinks = !config.getProjectBaseDir().equals( config.getEclipseProjectDirectory() );

        if ( addLinks || ( config.isPde() && dependencies.length > 0 ) || linkedResources.size() > 0 )
        {
            writer.startElement( "linkedResources" ); //$NON-NLS-1$
            // preserve the symbolic links
            if ( linkedResources.size() > 0 )
            {
                for ( Iterator it = linkedResources.iterator(); it.hasNext(); )
                {
                    ( (LinkedResource) it.next() ).print( writer );
                }
            }

            if ( addLinks )
            {

                addFileLink( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
                             config.getProject().getFile() );

                addSourceLinks( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
                                config.getProject().getCompileSourceRoots() );
                addResourceLinks( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
                                  config.getProject().getBuild().getResources() );

                addSourceLinks( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
                                config.getProject().getTestCompileSourceRoots() );
                addResourceLinks( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
                                  config.getProject().getBuild().getTestResources() );

            }

            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


        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

        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( " " + dep.getFile().getName() );
            }
        }
        // only insert the name of the property if there are local libraries
        return bundleClasspathSb.toString();
    }
View Full Code Here

                                                                         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() );
View Full Code Here

                        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 );
                            }
                        }
View Full Code Here

    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

    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

        if ( !config.isPde() )
        {
            List duplicates = new ArrayList();
            for ( int j = 0; j < config.getDepsOrdered().length; j++ )
            {
                IdeDependency dep = config.getDepsOrdered()[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

        writer.startElement( ELT_BUILD_SPEC );

        for ( Iterator it = buildCommands.iterator(); it.hasNext(); )
        {
            ( (BuildCommand) it.next() ).print( writer );
        }

        writer.endElement(); // buildSpec

        writer.startElement( ELT_NATURES );

        for ( Iterator it = projectnatures.iterator(); it.hasNext(); )
        {
            writer.startElement( ELT_NATURE );
            writer.writeText( (String) it.next() );
            writer.endElement(); // name
        }

        writer.endElement(); // natures

        boolean addLinks = !config.getProjectBaseDir().equals( config.getEclipseProjectDirectory() );

        if ( addLinks || ( config.isPde() && config.getDepsOrdered().length > 0 ) )
        {
            writer.startElement( "linkedResources" ); //$NON-NLS-1$

            if ( addLinks )
            {

                addFileLink( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
                             config.getProject().getFile() );

                addSourceLinks( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
                                config.getProject().getCompileSourceRoots() );
                addResourceLinks( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
                                  config.getProject().getBuild().getResources() );

                addSourceLinks( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
                                config.getProject().getTestCompileSourceRoots() );
                addResourceLinks( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
                                  config.getProject().getBuild().getTestResources() );

            }

            if ( config.isPde() )
            {
                for ( int j = 0; j < config.getDepsOrdered().length; j++ )
                {
                    IdeDependency dep = config.getDepsOrdered()[j];

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

        IdeDependency[] deps = config.getDepsOrdered();
        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

        // annoying. For now just sort them by using groupId/artifactId
        Arrays.sort( deps );

        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( " " + dep.getFile().getName() );
            }
        }
        // only insert the name of the property if there are local libraries
        return bundleClasspathSb.toString();
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.plugin.ide.IdeDependency

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.