- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有公司的 maven 存储库。我有 super 公司pom.xml
与部分 <repository>
和 <pluginRepository>
指向公司 repo 协议(protocol)。公司super pom是分离神器。
我开发我的 maven 项目。父 pom 是公司 super pom。为了在干净的环境中通过构建,我需要再次定义 <repository>
在我的项目主页中,因为 Maven 必须知道在哪里可以找到父 pom(参见 Catch-22)
我很不高兴在我的项目中再次定义公司存储库,但我接受了。
在我的项目中,我使用公司插件。问题是 Maven 找不到公司插件。这很奇怪,因为 maven 使用 <pluginRepository>
找到了 super pom但不使用插件存储库来查找插件!所以我必须再次定义 <pluginRepository>
super pom:
<repositories>
<repository>
<id>company-repo</id>
<url>http://mycompany.com/repo</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>company-repo</id>
<url>http://mycompany.com/repo</url>
</pluginRepository>
</pluginRepositories>
我的项目pom:
<!-- required to find company super pom - unhappy but accepted-->
<repositories>
<repository>
<id>company-repo</id>
<url>http://mycompany.com/repo</url>
</repository>
</repositories>
<!-- required to find company plugin - unhappy and hard to accept-->
<pluginRepositories>
<pluginRepository>
<id>company-repo</id>
<url>http://mycompany.com/repo</url>
</pluginRepository>
</pluginRepositories>
问题:是否可以避免在每个 Maven 项目中重复配置插件仓库?也许我应该改变我的设计/配置/其他什么?
有什么有趣的,<pluginRepositories>
如果通过相对路径而不是通过存储库访问 super pom,则不需要。
maven 3.3.3
更新:
如果我删除 <pluginRepositories>
从我的项目 pom 然后 effective-pom 不会将 company-repo 显示为插件存储库。我希望。
最佳答案
最简单的是 setup your settings.xml
file like this:
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
使用存储库管理器让生活更轻松...除此之外,您当然可以使用 single pom which could be made .但是对于开发人员来说,使用父级不能改变,你不能改变 CI 解决方案(比如 Jenkins)来配置他们适当的 settings.xml
关于maven - 当通过存储库访问父 pom 时,将忽略父 pom 中的 <pluginRepository>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34063476/
我正在使用 Maven 3.x,我的父 pom 和子 pom 中有以下结构。 父类 com.mygoogle.sample workorder 1.0-SNAPSHOT pom 1.0-SN
我已将各个项目中的所有存储库配置重构为一个父 pom,该父 pom 是为了对存储库和分发管理等内容进行单点配置的特定目的而创建的。据我了解,这应该是最佳实践。将我的父 pom 部署到 Nexus 服务
我尝试使用 mvn help:effective-pom 命令在示例应用程序上生成有效的 pom。 http://books.sonatype.com/mvnref-book/reference/po
在一个项目中,我们有一个名为时间戳的属性,它没有在父 POM 和子 POM 中定义,但仍然可以在 pom.xml 中访问。任何线索将不胜感激。 最佳答案 它可以由插件设置(如 https://www.
我在使用“uploadArchives”上传存档时收到“无法初始化 POM pom-default.xml:无法验证 POM”。我也尝试了 maven-publish 插件,但仍然没有成功。我们将不胜
我创建了一个程序,使用 HTML5 canvas 绘制一个 pom pom,参数大小、x、y、蓬松度和颜色。 pom pom 是通过从中心出来的画线创建的,参数蓬松度决定了从中心出来的股数。我有一个确
我正在关注maven的教程。我有一个非常简单的项目,里面有几个模块。在模块 pom 上,我想通过 ${parent.groupid} 和 ${parent.version} 引用主项目 pom 版本和
当我构建我的项目时,我收到以下警告: [INFO] ------------------------------------------------------------------------ [
我正在尝试构建一个 Maven 项目。我的其他团队成员能够毫无问题地构建它。我收到以下错误: [WARNING] The POM for org.hectorclient:hector-core:ja
我目前正在为 Maven 苦苦挣扎:我有一个由几个嵌套模块组成的复杂项目,对于其中一些模块,我在 POM 中有类似的配置。 我想让它干净。实际上,我想定义一个“runnable-jar”通用配置并在某
我正在将 maven Artifact 推送到 nexus,对于版本号小于子 POM 的父 POM 是否有任何影响? 最佳答案 据我所知没有。多模块项目中的模块版本可能以任何可能的方式有所不同。但是,
我在 Eclipse (Helios) 中有一个项目,带有 Maven pom.xml。我的项目是一个将使用 Hibernate、MySQL 的 Web 应用程序。 但是我在正确处理 pom.xml
repository我的 build.grade 部分已: mavenLocal() //maven { url { 'http://192.168.2
在多模块项目结构中 myApp |-moduleA |---pom.xml |-moduleB |---pom.xml |-pom.xml 如果我在 parent.pom 中有以下属性 4
我为 Maven 插件编写了代码,用于更新 pom 文件中的版本号。但是,当我尝试保存新的 pom 时,它被保存为有效的 pom。有没有办法将其保存为解析之前的样子?谢谢! private Maven
我有一个父 pom 在 pluginManagement 中定义了插件的一些配置项,其中有一个特定的配置。我不想在 child pom 中。 我尝试覆盖我的子 pom 中的其他配置项,这有效,但“删除
我不确定这是否受 Maven 支持。我很感激我能得到的任何帮助。 我有一个定义依赖项和排除项的父 pom。我无法更改父 pom: foo bar 1.0
当前场景: 父pom有一个distributionManagement部分,里面定义了两个repositories(releases和snapshots);引用如下: 父 pom:
似乎有几种方法可以在多项目构建中构建父 pom,我想知道是否有人对每种方式的优点/缺点有任何想法。 拥有父 pom 的最简单方法是将其放在项目的根目录中,即 myproject/ myprojec
我想在我的 Maven 项目中定义一个本地存储库。 我有一个 super pom 和几个子模块。我的文件结构是: /root /repository /child po
我是一名优秀的程序员,十分优秀!