当前位置: 首页 > 知识库问答 >
问题:

在设置中移动maven轮廓。xml到pom。xml

夹谷俊远
2023-03-14

我正在使用maven3。我在设置中定义了一些特定于用户的配置文件和activeProfiles标记。xml和我想将它们移动到项目的pom。xml。但仅仅是从设置中复制配置文件和活动配置文件。xml到pom。xml不起作用并破坏了构建,因为它试图在maven central而不是artifactory中找到项目的父pom。这是我的设置。xml配置文件。Maven报告问题:找不到xxx:xxx:pom:19.2英寸https://repo.maven.apache.org/maven2已缓存在本地存储库中,在经过central的更新间隔或强制更新之前,不会重新尝试解析

有人能帮忙吗?

{

    <profiles>
        <profile>
          <id>group</id>
          <repositories>
            <repository>
              <id>nb_releases</id>
              <name>Releases</name>
              <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
                <checksumPolicy>fail</checksumPolicy>
              </releases>
              <snapshots>
                <enabled>false</enabled>
              </snapshots>
              <url>http://artifactory.xxxx.xxxx/nb-m2</url>
              <layout>default</layout>
            </repository>
          </repositories>
        </profile>

        <profile>
          <id>snapshots-group</id>
          <repositories>
            <repository>
              <id>nb_snapshots</id>
              <name>Snapshots</name>
              <releases>
                <enabled>false</enabled>
              </releases>
              <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>fail</checksumPolicy>
              </snapshots>
              <url>http://artifactory.xxxx.xxxx/nb-m2-snapshot</url>
              <layout>default</layout>
            </repository>
          </repositories>
        </profile>
        <profile>
          <id>plugins</id>
            <pluginRepositories>
              <pluginRepository>
                <id>nb_plugins</id>
                <name>Plugins</name>
                <releases>
                  <enabled>true</enabled>
                  <updatePolicy>never</updatePolicy>
                  <checksumPolicy>fail</checksumPolicy> 
                </releases>
                <snapshots>
                  <enabled>false</enabled>
                </snapshots>
                <url>http://artifactory.xxx.xxx/nb-m2</url>
                <layout>default</layout>
             </pluginRepository>
          </pluginRepositories>
      </profile>
    </profiles>
    <activeProfiles>
      <activeProfile>group</activeProfile>
      <activeProfile>snapshots-group</activeProfile>
      <activeProfile>plugins</activeProfile>
    </activeProfiles>
} 

共有1个答案

微生高谊
2023-03-14

标签<代码>

激活可在POM中使用的配置文件有不同的可能性:

https://maven.apache.org/guides/introduction/introduction-to-profiles.html

 类似资料:
  • 我是Maven的新手。我想使用以下设置: 1) 用于下载公共工件的远程存储库 2) 下载工件的共享本地存储库,通过将以下内容添加到设置中可以很好地工作。xml: 3) 现在,我还希望有一个用于从单个项目引用的工件的存储库,比如一个老式的“lib”文件夹。 因此,我在项目的pom中添加了以下内容。xml: 我已经将一些jar部署到“repo”文件夹中,但是当我将它们作为依赖项添加到pom.xml中时

  • 总体: 我试图为一个特定的spring配置文件运行gradle build任务,但在通过以下测试时出现了一个错误: 注意:我对生成尝试了相同的方法,但生成任务不存在build.SystemProperty方法。 因为我是新来的,如果你能和我分享你真正的解决方案,我会很感激。

  • 我有3个maven项目A、B、C。A是B的父项目,B是C的父项目。所有概要文件都在pom中定义。项目A的xml。 在项目C中,我试图根据所选概要文件在spring测试上下文中选择属性文件(在src/test/resources下)。对于回归测试,我们有两个属性文件: 本地应用程序测试。属性 在我们的Windows开发系统上,选定的配置文件将是“本地”的,相应地在服务器上也是如此。选择“本地”配置文

  • 我有两个Spring概要文件:和。我想在服务器环境中设置活动配置文件,但我不想在代码中设置它,以便在部署应用程序的任何地方,配置文件都是基于服务器中的配置文件加载的。我怎么能那样做?

  • 我正在使用MaterialComponents大纲TextInputLayout。我需要在提示文本上设置不同的颜色: “Main”提示(当TextInput中没有文本时)-->带有60%alpha的黑色 浮动提示-->与轮廓相同的颜色(即非活动时为colorPrimary,活动时为colorAccent) 我正在使用Android:TextColorHint设置主提示颜色,App:HintText

  • 主要内容:1. outline-style,2. outline-width,3. outline-color,4. outline,5. outline-offset轮廓(outline)是绘制于元素周围的一条线,位于边框的外围(紧贴着边框),主要用来突出显示某个元素,如下图所示: 图:轮廓(outline) 轮廓和边框看起来非常相似,但它们之间也并非没有区别,例如: 元素上下左右四个方向上边框的样式、宽度、颜色可以单独设置,而轮廓在元素四个方向的宽度、样式、颜色都是相同的,不能单独设置; 边