Package org.apache.maven.artifact.ant.util

Examples of org.apache.maven.artifact.ant.util.AntBuildWriter


            if ( getDependencyRefsBuildFile() == null || getDependencyRefsBuildFile().equals( "default" ) )
            {
                setDependencyRefsBuildFile( DEFAULT_ANT_BUILD_FILE );
            }
            log( "Building ant file: " + getDependencyRefsBuildFile() );
            AntBuildWriter antBuildWriter = new AntBuildWriter();
            File antBuildFile = FileUtils.resolveFile( getProject().getBaseDir(), getDependencyRefsBuildFile() );
            try
            {
                antBuildWriter.openAntBuild( antBuildFile, "maven-dependencies", "init-dependencies" );
                antBuildWriter.openTarget( "init-dependencies" );
                antBuildWriter.writeEcho( "Loading dependency paths from file: " + antBuildFile.getAbsolutePath() );

                for ( Iterator<Artifact> i = result.getArtifacts().iterator(); i.hasNext(); )
                {
                    Artifact artifact = i.next();
                    String conflictId = artifact.getDependencyConflictId();
                    antBuildWriter.writeProperty( conflictId, artifact.getFile().getAbsolutePath() );
                    FileSet singleArtifactFileSet = (FileSet) getProject().getReference( conflictId );
                    antBuildWriter.writeFileSet( singleArtifactFileSet, conflictId );
                }

                if ( pathId != null )
                {
                    Path thePath = (Path) getProject().getReference( pathId );
                    antBuildWriter.writePath( thePath, pathId );
                }

                if ( filesetId != null )
                {
                    antBuildWriter.writeFileSet( dependencyFileSet, filesetId );
                }
                if ( sourcesFilesetId != null )
                {
                    antBuildWriter.writeFileSet( sourcesFileSet, sourcesFilesetId );
                }
                if ( javadocFilesetId != null )
                {
                    antBuildWriter.writeFileSet( sourcesFileSet, javadocFilesetId );
                }

                String versionsList = getProject().getProperty( versionsId );
                if ( versionsList != null )
                {
                    antBuildWriter.writeProperty( versionsId, versionsList );
                }

                antBuildWriter.closeTarget();
                antBuildWriter.closeAntBuild();
            }
            catch ( IOException e )
            {
                throw new BuildException ( "Unable to write ant build: " + e);
            }
View Full Code Here


            if ( getDependencyRefsBuildFile() == null || getDependencyRefsBuildFile().equals( "default" ) )
            {
                setDependencyRefsBuildFile( DEFAULT_ANT_BUILD_FILE );
            }
            log( "Building ant file: " + getDependencyRefsBuildFile() );
            AntBuildWriter antBuildWriter = new AntBuildWriter();
            File antBuildFile = FileUtils.resolveFile( getProject().getBaseDir(), getDependencyRefsBuildFile() );
            try
            {
                antBuildWriter.openAntBuild( antBuildFile, "maven-dependencies", "init-dependencies" );
                antBuildWriter.openTarget( "init-dependencies" );
                antBuildWriter.writeEcho( "Loading dependency paths from file: " + antBuildFile.getAbsolutePath() );

                for ( Iterator<Artifact> i = result.getArtifacts().iterator(); i.hasNext(); )
                {
                    Artifact artifact = i.next();
                    String conflictId = artifact.getDependencyConflictId();
                    antBuildWriter.writeProperty( conflictId, artifact.getFile().getAbsolutePath() );
                    FileSet singleArtifactFileSet = (FileSet) getProject().getReference( conflictId );
                    antBuildWriter.writeFileSet( singleArtifactFileSet, conflictId );
                }

                if ( pathId != null )
                {
                    Path thePath = (Path) getProject().getReference( pathId );
                    antBuildWriter.writePath( thePath, pathId );
                }

                if ( filesetId != null )
                {
                    antBuildWriter.writeFileSet( dependencyFileSet, filesetId );
                }
                if ( sourcesFilesetId != null )
                {
                    antBuildWriter.writeFileSet( sourcesFileSet, sourcesFilesetId );
                }
                if ( javadocFilesetId != null )
                {
                    antBuildWriter.writeFileSet( sourcesFileSet, javadocFilesetId );
                }

                String versionsList = getProject().getProperty( versionsId );
                if ( versionsList != null )
                {
                    antBuildWriter.writeProperty( versionsId, versionsList );
                }

                antBuildWriter.closeTarget();
                antBuildWriter.closeAntBuild();
            }
            catch ( IOException e )
            {
                throw new BuildException ( "Unable to write ant build: " + e);
            }
View Full Code Here

            if ( getDependencyRefsBuildFile() == null || getDependencyRefsBuildFile().equals( "default" ) )
            {
                setDependencyRefsBuildFile( DEFAULT_ANT_BUILD_FILE );
            }
            log( "Building ant file: " + getDependencyRefsBuildFile() );
            AntBuildWriter antBuildWriter = new AntBuildWriter();
            File antBuildFile = FileUtils.resolveFile( getProject().getBaseDir(), getDependencyRefsBuildFile() );
            try
            {
                antBuildWriter.openAntBuild( antBuildFile, "maven-dependencies", "init-dependencies" );
                antBuildWriter.openTarget( "init-dependencies" );
                antBuildWriter.writeEcho( "Loading dependency paths from file: " + antBuildFile.getAbsolutePath() );

                for ( Iterator<Artifact> i = result.getArtifacts().iterator(); i.hasNext(); )
                {
                    Artifact artifact = i.next();
                    String conflictId = artifact.getDependencyConflictId();
                    antBuildWriter.writeProperty( conflictId, artifact.getFile().getAbsolutePath() );
                    FileSet singleArtifactFileSet = (FileSet) getProject().getReference( conflictId );
                    antBuildWriter.writeFileSet( singleArtifactFileSet, conflictId );
                }

                if ( pathId != null )
                {
                    Path thePath = (Path) getProject().getReference( pathId );
                    antBuildWriter.writePath( thePath, pathId );
                }

                if ( filesetId != null )
                {
                    antBuildWriter.writeFileSet( dependencyFileSet, filesetId );
                }
                if ( sourcesFilesetId != null )
                {
                    antBuildWriter.writeFileSet( sourcesFileSet, sourcesFilesetId );
                }
                if ( javadocFilesetId != null )
                {
                    antBuildWriter.writeFileSet( sourcesFileSet, javadocFilesetId );
                }

                String versionsList = getProject().getProperty( versionsId );
                if ( versionsList != null )
                {
                    antBuildWriter.writeProperty( versionsId, versionsList );
                }

                antBuildWriter.closeTarget();
                antBuildWriter.closeAntBuild();
            }
            catch ( IOException e )
            {
                throw new BuildException ( "Unable to write ant build: " + e);
            }
View Full Code Here

            if ( getDependencyRefsBuildFile() == null || getDependencyRefsBuildFile().equals( "default" ) )
            {
                setDependencyRefsBuildFile( DEFAULT_ANT_BUILD_FILE );
            }
            log( "Building ant file: " + getDependencyRefsBuildFile());
            AntBuildWriter antBuildWriter = new AntBuildWriter();
            File antBuildFile = new File( getProject().getBaseDir(), getDependencyRefsBuildFile() );
            try
            {
                antBuildWriter.openAntBuild( antBuildFile, "maven-dependencies", "init-dependencies" );
                antBuildWriter.openTarget( "init-dependencies" );
                antBuildWriter.writeEcho( "Loading dependency paths from file: " + antBuildFile.getAbsolutePath() );
               
                Iterator i = result.getArtifacts().iterator();
                while i.hasNext() )
                {
                    Artifact artifact = (Artifact) i.next();
                    String conflictId = artifact.getDependencyConflictId();
                    antBuildWriter.writeProperty( conflictId, artifact.getFile().getAbsolutePath() );
                    FileSet singleArtifactFileSet = (FileSet)getProject().getReference( conflictId );
                    antBuildWriter.writeFileSet( singleArtifactFileSet, conflictId );
                }
               
                if ( pathId != null )
                {
                    Path thePath = (Path)getProject().getReference( pathId );
                    antBuildWriter.writePath( thePath, pathId );
                }
               
                if ( filesetId != null )
                {
                    antBuildWriter.writeFileSet( dependencyFileSet, filesetId );
                }
                if ( sourcesFilesetId != null )
                {
                    antBuildWriter.writeFileSet( sourcesFileSet, sourcesFilesetId );
                }
                if ( javadocFilesetId != null )
                {
                    antBuildWriter.writeFileSet( sourcesFileSet, javadocFilesetId );
                }
               
                String versionsList = getProject().getProperty( versionsId );
                antBuildWriter.writeProperty( versionsId, versionsList );
               
                antBuildWriter.closeTarget();
                antBuildWriter.closeAntBuild();
            }
            catch ( IOException e )
            {
                throw new BuildException ( "Unable to write ant build: " + e);
            }
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.ant.util.AntBuildWriter

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.