Package com.atlassian.maven.plugins.jgitflow.exception

Examples of com.atlassian.maven.plugins.jgitflow.exception.ProjectRewriteException


        {
            eol = CoreEol.getConfigValue(jGitFlowProvider.gitFlow().git().getRepository().getConfig()).getEol();
        }
        catch (JGitFlowException e)
        {
            throw new ProjectRewriteException("Error determining proper EOL!", e);
        }

        File pomFile = project.getFile();

        if (null == pomFile || !pomFile.exists() || !pomFile.canRead())
        {
            String pomPath = (null == pomFile) ? "null" : pomFile.getAbsolutePath();

            throw new ProjectRewriteException("pom file must be readable! " + pomPath);
        }

        //Document document = readPom(pomFile);
        DocumentDescriptor dd = readPom(pomFile, eol);
        Document document = dd.getDocument();
View Full Code Here


                writer.write(outtro);
            }
        }
        catch (IOException e)
        {
            throw new ProjectRewriteException("Error writing pom!", e);
        }
        finally
        {
            IOUtil.close(writer);
        }
View Full Code Here

            return new DocumentDescriptor(document, intro, outtro);
        }
        catch (IOException e)
        {
            throw new ProjectRewriteException("unable to read pom!", e);
        }
        catch (JDOMException e)
        {
            throw new ProjectRewriteException("unable to read pom!", e);
        }

    }
View Full Code Here

               
                artifactId = ReleaseUtil.interpolate(artifactIdElement.getTextTrim(),projectModel);
            }
            catch (ReleaseExecutionException e)
            {
                throw new ProjectRewriteException("error interpolating pom variable: " + e.getMessage(),e);
            }

            String artifactKey = ArtifactUtils.versionlessKey(groupId,artifactId);
            String mappedVersion = releaseVersions.get(artifactKey);
            String originalVersion = originalVersions.get(artifactKey);
           
            if(null != mappedVersion
                    && mappedVersion.endsWith(Artifact.SNAPSHOT_VERSION)
                    && !rawVersion.endsWith(Artifact.SNAPSHOT_VERSION)
                    && !updateDependencies)
            {
                continue;
            }
           
            if(null != mappedVersion)
            {
                if(rawVersion.equals(originalVersion))
                {
                    workLog.append(LF).append("updating ").append(artifactId).append(" to ").append(mappedVersion);
                    versionElement.setText(mappedVersion);
                    modified = true;
                }
                else if(rawVersion.matches("\\$\\{.+\\}"))
                {
                    String propName = rawVersion.substring(2,rawVersion.length() - 1);
                   
                    if(propName.startsWith("project.")
                            || propName.startsWith("pom.")
                            || "version".equals(propName)
                            )
                    {
                        if(!mappedVersion.equals(releaseVersions.get(projectId)))
                        {
                            workLog.append(LF).append("updating ").append(artifactId).append(" to ").append(mappedVersion);
                            versionElement.setText(mappedVersion);
                            modified = true;
                        }
                    }
                    else if(null != properties)
                    {
                        Element prop = properties.getChild(propName, ns);
                        if(null != prop)
                        {
                            String propValue = prop.getTextTrim();
                            if(propValue.equals(originalVersion))
                            {
                                workLog.append(LF).append("updating ").append(rawVersion).append(" to ").append(mappedVersion);
                                prop.setText(mappedVersion);
                                modified = true;
                            }
                            else if(!mappedVersion.equals(rawVersion))
                            {
                                if(!mappedVersion.matches("\\$\\{project.+\\}")
                                        && !mappedVersion.matches("\\$\\{pom.+\\}")
                                        && !"${version}".equals(mappedVersion))
                                {
                                    throw new ProjectRewriteException("The artifact (" + artifactKey + ") requires a "
                                            + "different version (" + mappedVersion + ") than what is found ("
                                            + propValue + ") for the expression (" + propName + ") in the "
                                            + "project (" + projectId + ").");
                                }
                            }
                        }
                        else
                        {
                            throw new ProjectRewriteException("Error updating version '" + rawVersion + "' for artifact " + artifactKey);
                        }
                    }
                }
            }
        }
View Full Code Here

       
        if(null == pomFile || !pomFile.exists() || !pomFile.canRead())
        {
            String pomPath = (null == pomFile) ? "null" : pomFile.getAbsolutePath();
           
            throw new ProjectRewriteException("pom file must be readable! " + pomPath);
        }
       
        //Document document = readPom(pomFile);
        DocumentDescriptor dd = readPom(pomFile);
        Document document = dd.getDocument();
View Full Code Here

                writer.write( outtro );
            }
        }
        catch (IOException e)
        {
            throw new ProjectRewriteException("Error writing pom!", e);
        }
        finally
        {
            IOUtil.close( writer );
        }
View Full Code Here

           
            return new DocumentDescriptor(document,intro,outtro);
        }
        catch (IOException e)
        {
            throw new ProjectRewriteException("unable to read pom!", e);
        }
        catch (JDOMException e)
        {
            throw new ProjectRewriteException("unable to read pom!", e);
        }

    }
View Full Code Here

            if (null == parentVersion)
            {
                if (parent.getVersion().equals(originalVersions.get(parentId)))
                {
                    throw new ProjectRewriteException("Release version for parent " + parent.getName() + " was not found");
                }
            }
            else
            {
                workLog.add("setting parent version to '" + parentVersion + "'");
View Full Code Here

        String projectId = ArtifactUtils.versionlessKey(project.getGroupId(), project.getArtifactId());
        String releaseVersion = releaseVersions.get(projectId);
       
        if(Strings.isNullOrEmpty(releaseVersion))
        {
            throw new ProjectRewriteException("Release version for " + project.getName() + " was not found");
        }
       
        if(null == versionElement)
        {
            String parentVersion = null;
View Full Code Here

                    String projectId = ArtifactUtils.versionlessKey(project.getGroupId(), project.getArtifactId());
                    String releaseVersion = releaseVersions.get(projectId);

                    if(Strings.isNullOrEmpty(releaseVersion))
                    {
                        throw new ProjectRewriteException("Release version for " + project.getName() + " was not found");
                    }
                   
                    String tagVersion = releaseVersion;
                   
                    if(releaseVersion.endsWith("-SNAPSHOT"))
View Full Code Here

TOP

Related Classes of com.atlassian.maven.plugins.jgitflow.exception.ProjectRewriteException

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.