Package org.apache.maven

Examples of org.apache.maven.MavenException


        setUserPluginsDir( new File( mavenSession.getRootContext().getUserPluginsDir() ) );

        if ( !getPluginsDir().isDirectory()
            || ( ( getPluginsDir().listFiles() != null ) && ( getPluginsDir().listFiles().length == 0 ) ) )
        {
            throw new MavenException( "Maven was badly installed. Please reinstall it." );
        }

        if ( LOGGER.isDebugEnabled() )
        {
            LOGGER.debug( "Set plugin source directory to " + getPluginsDir().getAbsolutePath() );
View Full Code Here


            jellyScriptHousing.setScript( script );
        }
        catch ( Exception e )
        {
            // FIXME: exception? Yuck!
            throw new MavenException( "Error parsing driver.jelly", e );
        }

        return jellyScriptHousing;
    }
View Full Code Here

                    mapArtifactIdToPluginHousing( artifactId, housing );
                }
                else
                {
                    throw new MavenException( "Not a valid plugin file: " + file );
                }

                LOGGER.debug( "Installing plugin: " + housing );
                // By default, not caching the plugin - its a per execution installation
                housing.parse( transientMapper );
                // Should only be putting in the transientMapper - but it is not consistent with isLoaded
                housing.parse( mapper );
                if ( cache )
                {
                    FileUtils.copyFileToDirectory( file, userPluginsDir );
                    cacheManager.registerPlugin( pluginName, housing );
                    housing.parse( cacheManager );
                    cacheManager.saveCache( unpackedPluginsDir );
                }
            }
            else
            {
                throw new MavenException( "Not a valid JAR file: " + file );
            }
        }
        catch ( IOException e )
        {
            throw new MavenException( "Error installing plugin", e );
        }
    }
View Full Code Here

                {
                    return initialiseHousingPluginContext( housing, baseContext );
                }
                catch ( Exception e )
                {
                    throw new MavenException( "Error initialising plugin context", e );
                }
            }
        }
        throw new UnknownPluginException( id );
    }
View Full Code Here

                unzipper.setDest( unzipDir );
                unzipper.execute();
            }
            catch ( IOException e )
            {
                throw new MavenException( "Unable to extract plugin: " + jarFile, e );
            }
        }
        return unzipDir;
    }
View Full Code Here

            return script;
        }
        catch ( Exception e )
        {
            // FIXME: exception? Yuck!
            throw new MavenException( "Error parsing: " + jellyScriptHousing.getSource(), e );
        }
    }
View Full Code Here

        {
            LOGGER.warn( getMessage( "directory.nonexistant.warning", unpackedPluginsDir ) );

            if ( !unpackedPluginsDir.mkdirs() )
            {
                throw new MavenException( getMessage( "cannot.create.directory.warning", unpackedPluginsDir ) );
            }
        }

        if ( !unpackedPluginsDir.isDirectory() )
        {
            throw new MavenException( getMessage( "not.directory.warning", unpackedPluginsDir ) );
        }

        if ( !unpackedPluginsDir.canWrite() )
        {
            throw new MavenException( getMessage( "not.writable.warning", unpackedPluginsDir ) );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.MavenException

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.