Package net.flexmojos.oss.plugin.compiler.attributes

Examples of net.flexmojos.oss.plugin.compiler.attributes.MavenRuntimeException


            dest = FileUtils.createTempFile( baseRbSwc.getArtifactId(), requestedLocale, getOutputDirectory() );
            unzip.extract( "locale/" + baseRbSwc.getClassifier(), dest );
        }
        catch ( Exception e )
        {
            throw new MavenRuntimeException( "Unable to extract base locale", e );
        }

        File resourceBundleBaseDir = new File( dest, "locale/" + baseRbSwc.getClassifier() );
        List<String> bundles = new ArrayList<String>();
        for ( String bundle : resourceBundleBaseDir.list() )
        {
            bundles.add( bundle.replace( ".properties", "" ) );
        }

        ICompcConfiguration cfg = mock( ICompcConfiguration.class, RETURNS_NULL );
        when( cfg.getLoadConfig() ).thenReturn( getLoadConfig() );
        when( cfg.getIncludeResourceBundles() ).thenReturn( bundles );
        String output = PathUtil.path( baseRbSwc.getFile() ).replace( baseRbSwc.getClassifier(), rbSwc.getClassifier() );
        when( cfg.getOutput() ).thenReturn( output );

        ICompilerConfiguration compilerCfg = mock( ICompilerConfiguration.class, RETURNS_NULL );
        when( compilerCfg.getTheme() ).thenReturn( Collections.EMPTY_LIST );
        when( compilerCfg.getFontsConfiguration() ).thenReturn( getFontsConfiguration() );
        when( compilerCfg.getLocale() ).thenReturn( new String[] { requestedLocale } );
        when( compilerCfg.getSourcePath() ).thenReturn( new File[] { resourceBundleBaseDir } );
        when( compilerCfg.getExternalLibraryPath() ).thenReturn( this.getExternalLibraryPath() );
        when( compilerCfg.getLibraryPath() ).thenReturn( this.getLibraryPath( false ) );

        when( cfg.getCompilerConfiguration() ).thenReturn( compilerCfg );

        try
        {
            checkResult( compiler.compileSwc( cfg, true ) );
        }
        catch ( Exception e )
        {
            throw new MavenRuntimeException( "Unable to compile adapted resource bundle", e );
        }

        rbSwc.setFile( new File( output ) );
        rbSwc.setResolved( true );
        return rbSwc;
View Full Code Here


                return rbSwc;
            }
        }

        throw new MavenRuntimeException( "Unable to resolve resource bundle '" + beacon + "' for '" + requestedLocale
            + "'" );
    }
View Full Code Here

        }

        String[] versionStringParts = compatibilityVersion.split( "\\." );
        if ( versionStringParts.length != 3 )
        {
            throw new MavenRuntimeException( "compatibilityVersion (" + compatibilityVersion
                + ") isn't in the required <major>.<minor>.<revision> pattern." );
        }
        else
        {
            try
            {
                for ( int i = 0; i < 3; i++ )
                {
                    Integer.parseInt( versionStringParts[i] );
                }
            }
            catch ( NumberFormatException e )
            {
                throw new MavenRuntimeException( "compatibilityVersion contained a non-numeric segment", e );
            }
        }
        return compatibilityVersion;
    }
View Full Code Here

                {
                    resultRbSwc = doLocalizationChain( locales, requestedLocale, beacon, requestedRbSwc );
                }
                else
                {
                    throw new MavenRuntimeException( "Missing resource bundle '" + requestedRbSwc + "'" );
                }

                rbsSwc.add( resultRbSwc );
            }
        }
View Full Code Here

            getLog().info( "Installing resource bundle beacon: " + rbBeacon );
            projectHelper.attachArtifact( project, RB_SWC, rbBeacon );
        }
        catch ( IOException e )
        {
            throw new MavenRuntimeException( "Failed to create beacon resource bundle", e );
        }

        return localesRuntime;
    }
View Full Code Here

                namespaces.add( new MavenNamespace( uri, manifest ) );
            }
        }
        catch ( Exception e )
        {
            throw new MavenRuntimeException( "Unable to retrieve flex default namespaces!", e );
        }
        finally
        {
            IOUtil.close( cfg );
        }
View Full Code Here

        {
            bundles = FileUtils.fileRead( getResourceBundleListFile() );
        }
        catch ( IOException e )
        {
            throw new MavenRuntimeException( e );
        }

        return Arrays.asList( bundles.substring( 10 ).split( " " ) );
    }
View Full Code Here

                    FileUtils.copyURLToFile( MavenUtils.class.getResource( "/themes/" + themeName + "." + type ),
                                             sparkCss );
                }
                catch ( IOException ioE )
                {
                    throw new MavenRuntimeException( "Error copying " + themeName + "." + type + " file.", ioE );
                }
            }
        }
        return sparkCss;
    }
View Full Code Here

        {
            return SocketUtil.freePort();
        }
        catch ( IOException e )
        {
            throw new MavenRuntimeException( "Failed to allocate socket port", e );
        }
    }
View Full Code Here

                {
                    p = projectBuilder.build( p.getArtifact(), request ).getProject();
                }
                catch ( ProjectBuildingException e )
                {
                    throw new MavenRuntimeException( e.getMessage(), e );
                }

                deps.addAll( MavenUtils.getFilesSet( filter( allOf( filter ), p.getArtifacts() ) ) );
            }
View Full Code Here

TOP

Related Classes of net.flexmojos.oss.plugin.compiler.attributes.MavenRuntimeException

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.