Intellij Ideaを使用していて、単純なMavenプロジェクトを作成しましたが、jarファイルを作成して端末で実行するとエラーが表示されます: "属性、ターゲットで/ JMS-1.0-SNAPSHOT.jarに " 私のpom.xmlがある:t.jarファイルでマニフェスト属性が取得されていない
<?xml version="1.0" encoding="UTF-8"?>
http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0 0.0
<groupId>JMS</groupId>
<artifactId>JMS</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- TEST SCOPE -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>com.intellij</groupId>
<artifactId>forms_rt</artifactId>
<version>7.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>5.7.0</version>
</dependency>
</dependencies>
jarファイルを生成する方法を知りたい。
あなたが本当に作成しますかテストジャー?私はないと思う。したがって、あなたが何をしているのか本当に分かっている場合を除いて、maven-jar-pluginを定義したり、pluginManagementを介して正しく定義したりしないでください。 junitの依存関係は ' test'になるはずです... ... – khmarbaise