MavenReleasePrePrepareMojo.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:maven-tools 作者:
/**
 * set ESB artifact version in artifact.xml file
 * 
 * @param prop
 *            properties in release.properties file
 * @param repoType
 *            type of the repository
 * @param artifactXml
 * @throws FactoryConfigurationError
 * @throws Exception
 */

private void setESBArtifactVersion(Properties prop, String repoType, File artifactXml)
                                                                                      throws FactoryConfigurationError,
                                                                                      Exception {
    File pomFile = new File(artifactXml.getParent() + File.separator + POM_XML);
    MavenProject mavenProject=getMavenProject(pomFile); 
    String releaseVersion = prop.getProperty(PROJECT + repoType + "."+mavenProject.getGroupId() + ":" + mavenProject.getArtifactId());
    ESBProjectArtifact projectArtifact = new ESBProjectArtifact();
    projectArtifact.fromFile(artifactXml);
    for (ESBArtifact artifact : projectArtifact.getAllESBArtifacts()) {
        if (artifact.getVersion() != null && artifact.getType() != null) {              
            if (releaseVersion != null) {
                artifact.setVersion(releaseVersion);
            }
        }
    }
    projectArtifact.toFile();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号