I am trying to set up maven in Intellij IDEA. I have installed maven and set environment variables as below
enviroment varaibles
variable Path
I am also using the maven wrapper which I added to my intellij project like this: mvn -N io.takari:maven:0.7.7:wrapper.
There is my pom.xml:
`
4.0.0
<groupId>io.github.mat3e</groupId>
<artifactId>hello</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Hello World</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<junit.version>4.12</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<archive>
<manifest>
<mainClass>io.github.mat3e.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
`
when i call a lifecycle method named package like this: "mvnw.cmd package" - then I get [INFO] BUILD SUCCESS but the JAR file is not created in my project (The "target" folder is not created at all)
moreover, when calling the method like this: "mvn package" - then I get [INFO] BUILD FAILURE but the "target" folder appears in my project screen of Intellij IDEA and an error occurs:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (d
efault-test) on project hello: Execution default-test of goal org.apache.maven.plugins:maven
-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodby
e. VM crash or System.exit called ?
I will also share the Project Structure and Maven Runner of my project in the hope that this information may be useful
Project Structure Maven Runner
question from:
https://stackoverflow.com/questions/65939362/maven-jar-plugin-doesnt-create-jar 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…