NutzCN Logo
问答 nutzboot部署问题
发布于 2229天前 作者 qq_856b85c9 2063 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

后台代码在windows10上已经全部写好,但是在项目部署的时候处理一些问题,希望群主能帮我解答一下。

首先先执行IDEA右侧的Liftcycle中的 maven project 的clean和compile以及package。这些都已经成功了
并且生成了对应的jar包。
但是接下来执行nutzboot中的shade就出现下面的问题。

[INFO] --- nutzboot-maven-plugin:2.2.1:shade (default-cli) @ wk-nb-service-cai ---
[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: 01:52 min
[INFO] Finished at: 2018-10-09T10:21:01+08:00
[INFO] Final Memory: 13M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.nutz.boot:nutzboot-maven-plugin:2.2.1:shade (default-cli) on project wk-nb-service-cai: 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
9 回复

mvn clean package nutzboot:shade

执行了上述 mvn clean package nutzboot:shade 之后


E:\Nutz\caibao\wk-app\wk-nb-service-sys>mvn clean package nutzboot:shade [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-parseable POM C:\Users\Administrator\.m2\repository\org\nutz\nutzboo 08-Nov-2014 19:04 207\r\n</pre><hr></body>... @888:18) @ C:\Us [ERROR] 'dependencies.dependency.version' for org.nutz:nutzboot-core:jar is miss [ERROR] 'dependencies.dependency.version' for org.nutz:nutzboot-starter-dubbo:ja [ERROR] 'dependencies.dependency.version' for org.slf4j:slf4j-log4j12:jar is mis [ERROR] 'dependencies.dependency.version' for junit:junit:jar is missing. @ cn.w @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project cn.wizzer.app:wk-nb-service-sys:5.0.6 (E:\Nutz\caibao\wk-a [ERROR] Non-parseable POM C:\Users\Administrator\.m2\repository\org\nutz\nut 08-Nov-2014 19:04 207\r\n</pre><hr></body>... @888:18) @ C [ERROR] 'dependencies.dependency.version' for org.nutz:nutzboot-core:jar is [ERROR] 'dependencies.dependency.version' for org.nutz:nutzboot-starter-dubb [ERROR] 'dependencies.dependency.version' for org.slf4j:slf4j-log4j12:jar is [ERROR] 'dependencies.dependency.version' for junit:junit:jar is missing. @ [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit [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 rea [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseExce

对pom.xml做过什么修改, 这些版本号应该是通过dependencyManagement导入管理的, 不应该缺失

是没有修改的啊

<?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <artifactId>wk-app</artifactId>
        <groupId>cn.wizzer.app</groupId>
        <version>5.0.6</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>wk-nb-service-cai</artifactId>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <dependencies>
        <dependency>
            <groupId>cn.wizzer</groupId>
            <artifactId>wk-framework</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>cn.wizzer.app</groupId>
            <artifactId>wk-model</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>cn.wizzer.app</groupId>
            <artifactId>wk-common</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-dubbo</artifactId>
        </dependency>
        <dependency>
            <groupId>com.101tec</groupId>
            <artifactId>zkclient</artifactId>
            <version>${zkclient.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-nutz-dao</artifactId>
            <version>${nutzboot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-jdbc</artifactId>
            <version>${nutzboot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-redis</artifactId>
            <version>${nutzboot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-wkcache</artifactId>
            <version>${nutzboot.version}</version>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>${druid.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.alibaba</groupId>
                    <artifactId>jconsole</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.alibaba</groupId>
                    <artifactId>tools</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql-connector-java.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutz-integration-jedis</artifactId>
            <version>1.r.67-SNAPSHOT</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <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>3.0.1</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <charset>UTF-8</charset>
                    <docencoding>UTF-8</docencoding>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.nutz.boot</groupId>
                <artifactId>nutzboot-maven-plugin</artifactId>
                <version>${nutzboot.version}</version>
            </plugin>
        </plugins>
    </build>


</project>

贴错了,刚才是其他的pom

<?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <artifactId>wk-app</artifactId>
        <groupId>cn.wizzer.app</groupId>
        <version>5.0.6</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <packaging>jar</packaging>
    <artifactId>wk-nb-service-sys</artifactId>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <dependencies>
        <dependency>
            <groupId>cn.wizzer</groupId>
            <artifactId>wk-framework</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>cn.wizzer.app</groupId>
            <artifactId>wk-model</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>cn.wizzer.app</groupId>
            <artifactId>wk-common</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-dubbo</artifactId>
        </dependency>
        <dependency>
            <groupId>com.101tec</groupId>
            <artifactId>zkclient</artifactId>
            <version>${zkclient.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-nutz-dao</artifactId>
            <version>${nutzboot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-jdbc</artifactId>
            <version>${nutzboot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-redis</artifactId>
            <version>${nutzboot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-wkcache</artifactId>
            <version>${nutzboot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzboot-starter-test-junit4</artifactId>
            <version>${nutzboot.version}</version>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>${druid.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.alibaba</groupId>
                    <artifactId>jconsole</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.alibaba</groupId>
                    <artifactId>tools</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql-connector-java.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <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.nutz.boot</groupId>
                <artifactId>nutzboot-maven-plugin</artifactId>
                <version>${nutzboot.version}</version>
            </plugin>
        </plugins>
    </build>

</project>

在E:\Nutz\caibao\目录下执行, 就能全部打包了

我猜你没执行过mvn install吧

这个我是在idea右侧执行的maven install

我之前用的版本是5.06,我现在下一个最新版先部署下试试吧

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