我有以下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控制台窗口看到以下输出:
&#34; C:\ Program Files \ Java \ jdk1.8.0_144 \ bin \ java&#34; -agentlib:JDWP =运输= dt_socket,地址127.0.0.1 =:55051,暂停= Y,服务器=正 &#34; -Dmaven.home = C:\用户\ SAURABH 马伊纳\ Apache的行家-3.5.0斌\ Apache的行家-3.5.0&#34; &#34; -Dclassworlds.conf = C:\用户\ SAURABH 马伊纳\ Apache的行家-3.5.0斌\ Apache的行家-3.5.0 \ BIN \ m2.conf&#34; -Dfile.encoding = UTF-8 -classpath&#34; C:\ Users \ Saurabh Maina \ apache-maven-3.5.0-bin \ apache-maven-3.5.0 \ boot \ plexus-classworlds-2.5.2。罐子; C:\ PROGRAM 文件(x86)\ JetBrains \ IntelliJ IDEA 12.1.4 \ lib \ idea_rt.jar&#34; org.codehaus.classworlds.Launcher --debug --update-snapshots --fail-at-end --strict-checksums package连接到目标VM,地址:&#39; 127.0.0.1:55051&#39;,transport:&#39; socket&#39;断开了 目标虚拟机,地址:&#39; 127.0.0.1:55051&#39;,传输:&#39; socket&#39;
使用退出代码1完成处理
我在调试级别有maven日志,但仍不清楚为什么JAR没有创建?
答案 0 :(得分:0)
我没有从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>