求助 maven 相关问题,急啊!

我自定义一个类似spring-boot 的parent的项目,然后我找了个例子:https://github.com/alibaba/aliyun-spring-boot,然后开码。

  • 项目A
D:\CODING\JAVA\XINJI-SPRING-BOOT
│  .gitignore
│  pom.xml
├─xinji-spring-boot-dependencies
│      pom.xml
│
└─xinji-spring-boot-parent
        pom.xml

父子关系:
xinji-spring-boot > xinji-spring-boot-dependencies > xinji-spring-boot-parent

  • 项目B
D:\CODING\JAVA\XINJI-SPRING-BOOT-EXAMPLES
│  .gitignore                            
│  pom.xml    

父子关系:
xinji-spring-boot-parent > xinji-spring-boot-examples

问题:
xinji-spring-boot-dependencies 中 dependencyManagement 中维护的依赖在 xinji-spring-boot-examples POM 中找到不version。

加载项目报错:

com.alibaba.boot:nacos-config-spring-boot-autoconfigure:jar:unknown was not found in https://maven.aliyun.com/repository/public during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of alimaven has elapsed or updates are forced

奇怪的地方:

  1. xinji-spring-boot-examples 有效 POM 的 dependencyManagement 是有的

  2. spring-boot-dependencies 中依赖都正常

代码:

code.zip (122.3 KB)

2 个赞

XINJI-SPRING-BOOT项目 mvn clean install
XINJI-SPRING-BOOT-EXAMPLES 刷新重构

2 个赞

有时候也许是重启idea能解决

1 个赞

xinji-spring-boot项目pom中的build.plugins放在了profiles下,那就得默认激活xinji-release这个配置, 否则plugin不生效;我试了挪出到project下可以正常build

1 个赞

en xinji-spring-boot idea 勾选xinji-release然后点install也行,拿出来也行。主要问题在examples项目中无法继承父项目的version

1 个赞

帮顶

我SB了

怎么删帖啊,太丢人了!!!

我维护的是(是xxx-starter)

   <dependencyManagement>
        <dependencies>
            <!-- nacos 配置中心 -->
            <dependency>
                <groupId>com.alibaba.boot</groupId>
                <artifactId>nacos-config-spring-boot-starter</artifactId>
                <version>${nacos-spring-boot.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

然后我examples中引入的是(是xxx-autoconfigure)

    <dependencies>
        <dependency>
            <groupId>com.alibaba.boot</groupId>
            <artifactId>nacos-config-spring-boot-autoconfigure</artifactId>
            <!-- <version>0.2.12</version> -->
        </dependency>
    </dependencies>

被自己蠢哭了

1 个赞