将工件部署到Nexus时,maven properties-maven-plugin不起作用

时间:2012-12-19 06:47:52

标签: java maven deployment maven-2 nexus

我正在使用properties-maven-plugin读取root目录下的外部属性文件来维护父模块的版本,因为我的项目中存在相当多的子模块,并且依赖树有点深。 当我在本地构建并将工件安装到本地存储库时它工作正常,但当我尝试使用“mvn clean deploy”将它们发布到Nexus时出现401错误。我很确定这是由不合格的工件名称(releaseurl / {external.version})引起的,external.version应该是从外部文件读取的属性。但是,当我在project.parent.version标记中明确声明版本时,它最终没有被读取并且它工作正常。有什么想法或解决方法吗?甚至在处理多模块项目时,在所有模块中尝试使用相同版本的父级和子级时,如何处理版本控制。

插件的maven pom如下所示,我在网上看到了一些有关阶段的评论,不确定如果更改初始化为其他内容它是否会起作用:

 <plugin>
    <groupId>org.codehaus.mojo</groupId>
        <artifactId>properties-maven-plugin</artifactId>
             <executions>
                 <execution>
                     <phase>initialize</phase>
                     <goals>
                         <goal>read-project-properties</goal>
                     </goals>
                     <configuration>
                            <files>
                                <file>external-file.properties</file>
                            </files>
                    </configuration>
                </execution>
            </executions>
    </plugin>

0 个答案:

没有答案