sofastack / sofa-jarslink

Jarslink is a sofa ark plugin used to manage multi-application deployment
Apache License 2.0
3.05k stars 705 forks source link

按照文档“启动 SOFABoot 应用”出现“Failed to execute goal com.mycila:license-maven-plugin:3.0:remove” 错误 #93

Closed larrychao closed 5 years ago

larrychao commented 6 years ago

按照官方文档介绍的sofaboot-sample-with-isle 运行 SOFABoot出现Failed to execute goal com.mycila:license-maven-plugin:3.0:remove 始终过不去

错误内容: Failed to execute goal com.mycila:license-maven-plugin:3.0:remove (default) on project sofa-boot-run: Execution default of goal com.mycila:license-maven-plugin:3.0:remove failed: Cannot read header document /Users/XXX/CODE/ThirdParty/sofa-boot/sofaboot-samples/sofaboot-sample-with-isle/sofa-boot-run/../../HEADER. Cause: Resource /Users/XXX/CODE/ThirdParty/sofa-boot/sofaboot-samples/sofaboot-sample-with-isle/sofa-boot-run/../../HEADER not found in file system, classpath or URL: no protocol: /Users/XXX/CODE/ThirdParty/sofa-boot/sofaboot-samples/sofaboot-sample-with-isle/sofa-boot-run/../../HEADER -> [Help 1] [ERROR]

错误信息中的XXX是我的用户名

pom文件的plugin如下

`

com.mycila
            <artifactId>license-maven-plugin</artifactId>
            <version>${license.maven.plugin}</version>
            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>remove</goal>
                        <goal>format</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <quiet>true</quiet>
                <header>${main.user.dir}/HEADER</header> 这里的HEADER找不到,不知道这个HEADER是什么用意
                <includes>
                    <include>**/src/main/java/**</include>
                    <include>**/src/test/java/**</include>
                </includes>
                <strictCheck>true</strictCheck>
                <mapping>
                    <java>SLASHSTAR_STYLE</java>
                </mapping>
            </configuration>
        </plugin>`

我尝试清理本地仓库中 com.mycila 依然无效

Environment

QilongZhang commented 6 years ago

@larrychao 是哪个工程? 另外是在哪个目录中执行该命令的呢

larrychao commented 6 years ago

@QilongZhang 我用得失SOFABoot 2.4.0的代码 运行的工程是sofa-boot-run 2.4.0, 2.5.0的存在相同的问题 是不是不能单独运行? 因为我直接sofa-boot-run的父项目sofaboot-sample-with-isle就是正确的

QilongZhang commented 5 years ago

@larrychao sofa-boot-run 是 sofaboot-sample-with-isle 工程的子模块,在代码工程配置了 license-maven-plugin 插件,会用到 SOFABoot 工程个目录中的 HEADER 文件。推荐直接在 sofaboot-sample-with-isle 使用 mvn clean install ,如果在单独的子模块执行 mvn 命令,因为相对路径的问题,会导致 license 插件找不到 HEADER 文件。