Package org.apache.maven.artifact.installer

Examples of org.apache.maven.artifact.installer.ArtifactInstallationException


            FileUtils.copyFile( source, destination );

        }
        catch ( IOException e )
        {
            throw new ArtifactInstallationException( "Error installing artifact: " + e.getMessage(), e );
        }
    }
View Full Code Here


            {            
    FileUtils.copyFileToDirectory( configExeFile, PathUtil.getUserAssemblyCacheFileFor( artifact,localRepository ).getParentFile() );  
            }
            catch ( IOException e )
            {
                throw new ArtifactInstallationException( "NPANDAY-001-006: Failed to install artifact: ID = " +
                    artifact.getId() + ", File = " +
                    ( ( artifact.getFile() != null ) ? artifact.getFile().getAbsolutePath() : "" ), e );
            }
        }

        if ( !artifact.getType().equals( "exe.config" ) )//TODO: Generalize for any attached artifact
        {
            MavenXpp3Reader reader = new MavenXpp3Reader();
            Model model;
            try
            {
                logger.debug( "NPANDAY-001-033: config file:" + artifact.getType());

                model = reader.read( new FileReader( pomFile ) );

                if ( configExeFile.exists() )
                {
                    Dependency dependency = new Dependency();
                    dependency.setGroupId( artifact.getGroupId() );
                    dependency.setArtifactId( artifact.getArtifactId() );
                    dependency.setVersion( artifact.getVersion() );
                    dependency.setType( ArtifactType.DOTNET_EXECUTABLE_CONFIG.getPackagingType() );
                    model.addDependency( dependency );
                }
            }
            catch ( XmlPullParserException e )
            {
                throw new ArtifactInstallationException( "NPANDAY-001-012: Unable to read pom file: " + pomFile.getAbsolutePath(), e);
            }
            catch ( IOException e )
            {
                throw new ArtifactInstallationException( "NPANDAY-001-013: Unable to read pom file: " + pomFile.getAbsolutePath(), e );
            }

        }
    }
View Full Code Here

            fileWriter = new FileWriter( tempFile );
            new MavenXpp3Writer().write( fileWriter, model );
        }
        catch ( IOException e )
        {
            throw new ArtifactInstallationException(
                "NPANDAY-001-015: Unable to read model: Message =" + e.getMessage(), e);
        }
        IOUtil.close( fileWriter );
        installArtifactWithPom( artifact, tempFile, false );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.installer.ArtifactInstallationException

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.