Package org.drools.compiler.kproject.xml

Examples of org.drools.compiler.kproject.xml.PomModel


            // will be null if the provided pom is invalid
            return;
        }

        try {
            PomModel tempPomModel = MinimalPomParser.parse( "pom.xml",
                                                            new ByteArrayInputStream( pomXml ) );
            validatePomModel( tempPomModel ); // throws an exception if invalid
            pomModel = tempPomModel;
        } catch ( Exception e ) {
            results.addMessage( Level.ERROR,
View Full Code Here


           
            if ( file != null ) {
                FileInputStream fis = null;
                try {
                    fis = new FileInputStream( file ) ;
                    PomModel pomModel = MinimalPomParser.parse( rootPath + "/pom.xml",
                                                                    fis);
                   
                    KieBuilderImpl.validatePomModel( pomModel ); // throws an exception if invalid
                   
                    ReleaseIdImpl gav = (ReleaseIdImpl) pomModel.getReleaseId();
                   
                    String str =  KieBuilderImpl.generatePomProperties( gav );
                    log.info( "Recursed up folders,  found and used pom.xml " + file );
                   
                    return str;
View Full Code Here

        if ( file != null ) {
            FileInputStream fis = null;
            try {
                fis = new FileInputStream( file ) ;
                PomModel pomModel = PomModel.Parser.parse( rootPath + "/pom.xml", fis);

                KieBuilderImpl.validatePomModel( pomModel ); // throws an exception if invalid

                ReleaseIdImpl gav = (ReleaseIdImpl) pomModel.getReleaseId();

                String str =  KieBuilderImpl.generatePomProperties( gav );
                log.info( "Recursed up folders,  found and used pom.xml " + file );

                return str;
View Full Code Here

    public PomModel getPomModel() {
        if (pomModel == null) {
            try {
                byte[] pomXml = getPomXml();
                if( pomXml != null ) {
                    PomModel tempPomModel = PomModel.Parser.parse("pom.xml", new ByteArrayInputStream(pomXml));
                    validatePomModel(tempPomModel); // throws an exception if invalid
                    pomModel = tempPomModel;
                }
            } catch( Exception e ) {
                // nothing to do as it was not possible to retrieve pom.xml
View Full Code Here

    public PomModel getPomModel() {
        if (pomModel == null) {
            try {
                byte[] pomXml = getPomXml();
                if( pomXml != null ) {
                    PomModel tempPomModel = PomModel.Parser.parse("pom.xml", new ByteArrayInputStream(pomXml));
                    validatePomModel(tempPomModel); // throws an exception if invalid
                    pomModel = tempPomModel;
                }
            } catch( Exception e ) {
                // nothing to do as it was not possible to retrieve pom.xml
View Full Code Here

           
            if ( file != null ) {
                FileInputStream fis = null;
                try {
                    fis = new FileInputStream( file ) ;
                    PomModel pomModel = MinimalPomParser.parse( rootPath + "/pom.xml",
                                                                    fis);
                   
                    KieBuilderImpl.validatePomModel( pomModel ); // throws an exception if invalid
                   
                    ReleaseIdImpl gav = (ReleaseIdImpl) pomModel.getReleaseId();
                   
                    String str =  KieBuilderImpl.generatePomProperties( gav );
                    log.info( "Recursed up folders,  found and used pom.xml " + file );
                   
                    return str;
View Full Code Here

                // is available() safe?
                fileData.mark( fileData.available() );

                //Attempt to load JAR's POM information from it's pom.xml file
                PomModel pomModel = null;
                try {
                    String pomXML = GuvnorM2Repository.loadPOMFromJar( fileData );
                    if ( pomXML != null ) {
                        pomModel = PomModel.Parser.parse( "pom.xml",
                                                          new ByteArrayInputStream( pomXML.getBytes() ) );
                    }
                } catch ( Exception e ) {
                    log.info( "Failed to parse pom.xml for GAV information. Falling back to pom.properties.",
                              e );
                }

                //Attempt to load JAR's POM information from it's pom.properties file
                if ( pomModel == null ) {
                    try {
                        fileData.reset();
                        String pomProperties = GuvnorM2Repository.loadPOMPropertiesFromJar( fileData );
                        if ( pomProperties != null ) {
                            final ReleaseId releaseId = ReleaseIdImpl.fromPropertiesString( pomProperties );
                            if ( releaseId != null ) {
                                pomModel = new PomModel();
                                pomModel.setReleaseId( releaseId );
                            }
                        }
                    } catch ( Exception e ) {
                        log.info( "Failed to parse pom.properties for GAV information." );
                    }
                }

                //If we were able to get a POM model we can get the GAV
                if ( pomModel != null ) {
                    String groupId = pomModel.getReleaseId().getGroupId();
                    String artifactId = pomModel.getReleaseId().getArtifactId();
                    String version = pomModel.getReleaseId().getVersion();

                    if ( isNullOrEmpty( groupId ) || isNullOrEmpty( artifactId ) || isNullOrEmpty( version ) ) {
                        return NO_VALID_POM;
                    } else {
                        gav = new GAV( groupId,
View Full Code Here

    public PomModel getPomModel() {
        if (pomModel == null) {
            try {
                byte[] pomXml = getPomXml();
                if( pomXml != null ) {
                    PomModel tempPomModel = PomModel.Parser.parse("pom.xml", new ByteArrayInputStream(pomXml));
                    validatePomModel(tempPomModel); // throws an exception if invalid
                    pomModel = tempPomModel;
                }
            } catch( Exception e ) {
                // nothing to do as it was not possible to retrieve pom.xml
View Full Code Here

    public PomModel getPomModel() {
        if (pomModel == null) {
            try {
                byte[] pomXml = getPomXml();
                if( pomXml != null ) {
                    PomModel tempPomModel = MinimalPomParser.parse("pom.xml",
                            new ByteArrayInputStream(pomXml));
                    validatePomModel(tempPomModel); // throws an exception if invalid
                    pomModel = tempPomModel;
                }
            } catch( Exception e ) {
View Full Code Here

            // will be null if the provided pom is invalid
            return;
        }

        try {
            PomModel tempPomModel = MinimalPomParser.parse( "pom.xml",
                                                            new ByteArrayInputStream( pomXml ) );
            validatePomModel( tempPomModel ); // throws an exception if invalid
            pomModel = tempPomModel;
        } catch ( Exception e ) {
            results.addMessage( Level.ERROR,
View Full Code Here

TOP

Related Classes of org.drools.compiler.kproject.xml.PomModel

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.