Package org.apache.maven.dotnet

Examples of org.apache.maven.dotnet.InitializationException


                        }
                    }
                }
                catch ( ClassNotFoundException e )
                {
                    throw new InitializationException(
                        "NMAVEN-061-007: Unable to create AssemblyInfoMarshaller: Class Name = " + className, e );
                }
                catch ( InstantiationException e )
                {
                    throw new InitializationException(
                        "NMAVEN-020-003: Unable to create AssemblyInfoMarshaller: Class Name = " + className, e );
                }
                catch ( IllegalAccessException e )
                {
                    throw new InitializationException(
                        "NMAVEN-020-004: Unable to create AssemblyInfoMarshaller: Class Name = " + className, e );
                }
            }
        }
    }
View Full Code Here


                String scope = artifact.getScope();
                if ( type.equals( ArtifactType.MODULE.getPackagingType() ) )
                {
                    if ( !ArtifactScope.COMPILE.isMatchByString( scope ) )
                    {
                        throw new InitializationException( "Module must be of compile scope: Scope = " + scope );
                    }
                    moduleDependencies.add( artifact );
                }
            }
        }
        addLibraryArtifactsToTarget( project.getCompileArtifacts(), compileLibraryDependencies );
        addLibraryArtifactsToTarget( project.getTestArtifacts(), testLibraryDependencies );
        addLibraryArtifactsToTarget( project.getRuntimeArtifacts(), runtimeLibraryDependencies );

        Enumeration<URL> resources =
            this.getClass().getClassLoader().getResources( "/META-INF/nmaven/annotation-resources.txt" );

        while ( resources.hasMoreElements() )
        {
            URL url = resources.nextElement();
            BufferedReader reader = new BufferedReader( new InputStreamReader( url.openStream() ) );
            String annotatedClass;
            while ( ( annotatedClass = reader.readLine() ) != null )
            {
                String className = null;
                try
                {
                    Class c = Class.forName( annotatedClass );
                    className = c.getName();
                    CompilerAnnotation annotation = (CompilerAnnotation) c.getAnnotation( CompilerAnnotation.class );
                    if ( annotation != null && isMatchBetween( (DotnetCompilerConfig) compilerConfig, annotation ) )
                    {
                        classCompiler = (ClassCompiler) c.newInstance();
                        classCompiler.init( this );
                    }
                }
                catch ( ClassNotFoundException e )
                {
                    throw new InitializationException(
                        "NMAVEN-061-007: Unable to create NetCompiler: Class Name = " + className, e );
                }
                catch ( InstantiationException e )
                {
                    throw new InitializationException(
                        "NMAVEN-061-005: Unable to create NetCompiler: Class Name = " + className, e );
                }
                catch ( IllegalAccessException e )
                {
                    throw new InitializationException(
                        "NMAVEN-061-006: Unable to create NetCompiler: Class Name = " + className, e );
                }
            }
        }

        if ( classCompiler == null && compilerExistsCheck )
        {
            throw new InitializationException( "Could not find compiler" );
        }
        String basedir =
            project.getBuild().getDirectory() + File.separator + BuildDirectories.ASSEMBLY_RESOURCES + File.separator;
        linkedResources = new File( basedir, "linkresource" ).exists() ? new HashSet<File>(
            Arrays.asList( new File( basedir, "linkresource" ).listFiles() ) ) : new HashSet<File>();

        embeddedResources = new File( basedir, "resource" ).exists() ? new HashSet<File>(
            Arrays.asList( new File( basedir, "resource" ).listFiles() ) ) : new HashSet<File>();
        win32resources = new File( basedir, "win32res" ).exists() ? new HashSet<File>(
            Arrays.asList( new File( basedir, "win32res" ).listFiles() ) ) : new HashSet<File>();
        File win32IconDir = new File( basedir, "win32icon" );
        if ( win32IconDir.exists() )
        {
            File[] icons = win32IconDir.listFiles();
            if ( icons.length > 1 )
            {
                throw new InitializationException(
                    "NMAVEN-061-002: There is more than one win32icon in resource directory: Number = " + icons
                        .length );
            }
            if ( icons.length == 1 )
            {
View Full Code Here

                targetArtifacts.add( artifact );
            }
            else if ( type.startsWith( "dotnet:gac" ) &&
                !( artifact.getScope().equals( "provided" ) || artifact.getScope().equals( "system" ) ) )
            {
                throw new InitializationException( "Gac dependency scope must be specified as provided or system" );
            }
        }
    }
View Full Code Here

        {
            return new File( "/usr/lib/mono/gac/" ).getAbsolutePath();
        }
        else
        {
            throw new InitializationException(
                "NMAVEN-061-003: Could not locate Global Assembly Cache for Mono. Try setting the MONO_ROOT environmental variable." );
        }
    }
View Full Code Here

        File gacFile = new File( gacRoot, artifact.getArtifactId() + File.separator + artifact.getVersion() + "__" +
            artifact.getClassifier() + File.separator + artifact.getArtifactId() + ".dll" );

        if ( assemblyExistsCheck && !gacFile.exists() )
        {
            throw new InitializationException(
                "NMAVEN-061-004: Could not find GAC dependency: File = " + gacFile.getAbsolutePath() );
        }
        artifact.setFile( gacFile );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.dotnet.InitializationException

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.