Maven と、コマンド ラインからの Java クラス呼び出しの実行に問題があります。
私のアプリケーションは、春、休止状態、および Maven を使用しています。
私の小さなpom.xmlはこれです:
<profile>
<id>import</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
<phase>test</phase>
<configuration>
<mainClass>com.mycompany.App</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
私はEclipseから実行しようとしましたが、私のアプリケーションは動作しますが、コマンドラインでは次のようになります: mvn test -Pimport 次のようなエラーがいくつかあります:
"nested exception is java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory"
例:依存関係は次のように定義されています:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.8</version>
<scope>runtime</scope>
</dependency>
助言がありますか?
ありがとう