NutzCN Logo
问答 nutzboot打包时关于nutzboot:shade失败的问题
发布于 2021天前 作者 suyun 1363 次浏览 复制 上一个帖子 下一个帖子
标签:

根据这个命令提示:mvn clean package nutzboot:shade,首先执行clean,再执行package,最后执行nutzboot:shade时,出现错误:

D:\workIDE\JDK\JDK8\bin\java.exe -Dmaven.multiModuleProjectDirectory=F:\Programs_test\auth-2.0 -Dmaven.home=D:\workIDE\mavens\apache-maven-3.5.0 -Dclassworlds.conf=D:\workIDE\mavens\apache-maven-3.5.0\bin\m2.conf -javaagent:C:\Users\Suyun\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\191.6707.61\lib\idea_rt.jar=52857:C:\Users\Suyun\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\191.6707.61\bin -Dfile.encoding=UTF-8 -classpath D:\workIDE\mavens\apache-maven-3.5.0\boot\plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version2019.1.1 -s D:\workIDE\mavens\apache-maven-3.5.0\conf\settings.xml -Dmaven.repo.local=F:\Repository\Maven_Repo org.nutz.boot:nutzboot-maven-plugin:2.2.6:shade
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building auth 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz/1.r.67-SNAPSHOT/maven-metadata.xml
Downloaded: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz/1.r.67-SNAPSHOT/maven-metadata.xml (1.2 kB at 8.3 kB/s)
Downloading: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz-plugins-daocache/1.r.67-SNAPSHOT/maven-metadata.xml
Downloaded: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz-plugins-daocache/1.r.67-SNAPSHOT/maven-metadata.xml (1.2 kB at 18 kB/s)
Downloading: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutzmore/1.r.67-SNAPSHOT/maven-metadata.xml
Downloaded: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutzmore/1.r.67-SNAPSHOT/maven-metadata.xml (597 B at 13 kB/s)
Downloading: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz-plugins-websocket/1.r.67-SNAPSHOT/maven-metadata.xml
Downloaded: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz-plugins-websocket/1.r.67-SNAPSHOT/maven-metadata.xml (1.2 kB at 39 kB/s)
Downloading: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz-integration-jedis/1.r.67-SNAPSHOT/maven-metadata.xml
Downloaded: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz-integration-jedis/1.r.67-SNAPSHOT/maven-metadata.xml (1.2 kB at 31 kB/s)
Downloading: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz-integration-quartz/1.r.67-SNAPSHOT/maven-metadata.xml
Downloaded: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz-integration-quartz/1.r.67-SNAPSHOT/maven-metadata.xml (1.2 kB at 23 kB/s)
Downloading: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz-plugins-ngrok/1.r.67-SNAPSHOT/maven-metadata.xml
Downloaded: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz-plugins-ngrok/1.r.67-SNAPSHOT/maven-metadata.xml (1.2 kB at 14 kB/s)
Downloading: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz-integration-spring/1.r.67-SNAPSHOT/maven-metadata.xml
Downloaded: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutz-integration-spring/1.r.67-SNAPSHOT/maven-metadata.xml (1.2 kB at 34 kB/s)
[INFO] 
[INFO] --- nutzboot-maven-plugin:2.2.6:shade (default-cli) @ auth ---
Downloading: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutzboot-core/2.3-SNAPSHOT/maven-metadata.xml
Downloaded: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutzboot-core/2.3-SNAPSHOT/maven-metadata.xml (981 B at 26 kB/s)
Downloading: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutzboot-parent/2.3-SNAPSHOT/maven-metadata.xml
Downloaded: http://192.168.8.37:8081/repository/xgrun/org/nutz/nutzboot-parent/2.3-SNAPSHOT/maven-metadata.xml (598 B at 21 kB/s)
[ERROR] The project main artifact does not exist. This could have the following
[ERROR] reasons:
[ERROR] - You have invoked the goal directly from the command line. This is not
[ERROR]   supported. Please add the goal to the default lifecycle via an
[ERROR]   <execution> element in your POM and use "mvn package" to have it run.
[ERROR] - You have bound the goal to a lifecycle phase before "package". Please
[ERROR]   remove this binding from your POM such that the goal will be run in
[ERROR]   the proper phase.
[ERROR] - You removed the configuration of the maven-jar-plugin that produces the main artifact.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.013 s
[INFO] Finished at: 2019-05-05T18:44:25+08:00
[INFO] Final Memory: 17M/168M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.nutz.boot:nutzboot-maven-plugin:2.2.6:shade (default-cli) on project auth: Failed to create shaded artifact, project main artifact does not exist. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Process finished with exit code 1

2 回复

整个pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>nutz.remote</groupId>
    <artifactId>auth</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <nutzboot.version>2.2.6</nutzboot.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.nutz</groupId>
                <artifactId>nutzboot-parent</artifactId>
                <version>${nutzboot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-swagger</artifactId>
        </dependency>
       <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-nutz-mvc</artifactId>
        </dependency>
       <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-nutz-dao</artifactId>
        </dependency>
       <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-jetty</artifactId>
        </dependency>
       <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-jdbc</artifactId>
        </dependency>
       <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-redis</artifactId>
        </dependency>
       <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-quartz</artifactId>
        </dependency>
       <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-ngrok</artifactId>
        </dependency>
       <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-beetl</artifactId>
        </dependency>
       <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-ureport</artifactId>
        </dependency>
        <!--<dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.196</version>
        </dependency>-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.44</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-log4j12</artifactId>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>nutz</id>
            <url>http://jfrog.nutz.cn/artifactory/libs-release</url>
        </repository>
        <repository>
            <id>nutz-snapshots</id>
            <url>http://jfrog.nutz.cn/artifactory/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>nutz-snapshots</id>
            <url>http://jfrog.nutz.cn/artifactory/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                    <useIncrementalCompilation>false</useIncrementalCompilation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <configuration>
                    <additionalparam>-Xdoclint:none</additionalparam>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.nutz.boot</groupId>
                <artifactId>nutzboot-maven-plugin</artifactId>
                <version>${nutzboot.version}</version>
            </plugin>
        </plugins>
    </build>
</project>

用2.3.x系列, 不会有快照版引用

添加回复
请先登陆
回到顶部