繁体   English   中英

创建Jar of Maven Spring Boot项目

[英]Create Jar of maven spring boot project

我有以下POM

<groupId>CafeWebSocket</groupId>
<artifactId>CafeWebSocket</artifactId>
<version>1.0.RELEASE</version>
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.2.RELEASE</version>
</parent>
<packaging>jar</packaging>
<dependencies>

     <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-websocket</artifactId>
    </dependency>

</dependencies>
<build>
    <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>1.5.6.RELEASE</version>
                <configuration>
                    <mainClass>com.cafews.Launcher</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
    </plugins>
</build>

当我从Intellij IDEA中的Maven插件运行Maven软件包时,在Intellij控制台窗口中看到以下输出:

“ C:\\ Program Files \\ Java \\ jdk1.8.0_144 \\ bin \\ java” -agentlib:jdwp = transport = dt_socket,address = 127.0.0.1:55051,suspend = y,server = n“ -Dmaven.home = C: \\ Users \\ Saurabh Maina \\ apache-maven-3.5.0-bin \\ apache-maven-3.5.0“” -Dclassworlds.conf = C:\\ Users \\ Saurabh Maina \\ apache-maven-3.5.0-bin \\ apache- maven-3.5.0 \\ bin \\ m2.conf“ -Dfile.encoding = UTF-8 -classpath” C:\\ Users \\ Saurabh Maina \\ apache-maven-3.5.0-bin \\ apache-maven-3.5.0 \\ boot \\ plexus-classworlds-2.5.2.jar; C:\\ Program Files(x86)\\ JetBrains \\ IntelliJ IDEA 12.1.4 \\ lib \\ idea_rt.jar“ org.codehaus.classworlds.Launcher --debug --update-snapshots- -fail-at-end --strict-checksums程序包已连接到目标VM,地址:“ 127.0.0.1:55051”,传输:“ socket”已与目标VM断开连接,地址:“ 127.0.0.1:55051”,传输:'socket'

流程以退出代码1完成

我的Maven日志处于调试级别,但仍不清楚为什么未创建JAR?

我不是从IDE运行,而是从命令行运行。 命令行输出告诉错误是什么。 我发布了包含插件资源和编译器部分的pom,该部分可以正常工作,以防它也可能对其他人有所帮助。

<build>
        <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>1.5.6.RELEASE</version>
                    <configuration>
                        <mainClass>com.cafews.Launcher</mainClass>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <fork>true</fork>
                    <executable>C:\Program Files\Java\jdk1.8.0_144\bin\javac.exe</executable>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM