我在一个swing java项目中工作,还有6个项目
我正在使用Maven管理依赖项。 打包项目后,我尝试运行jar myproject-desktop.jar,我收到错误:
线程中的异常" main" java.lang.NoClassDefFoundError:br / com / cpqd / smqa / tools / logging / SmqaLogging 在br.com.cpqd.smqa.desktop.Main.main(Main.java:89)
Java主要代码: `
import br.com.cpqd.smqa.tools.logging.SmqaLogging;
public static void main(String[] args)
{
System.setProperty("log4j.configuration","smqaLog4jConfigurationFile.properties");
try
{
defineSystemPaths();
}
catch (Throwable t)
{
SmqaLogging.fatal(Main.class, "Erro ao definir os diretórios/arquivos do sistema", t);
System.exit(0);
}
`
**我的Pom.xml声明**
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>br.com.cpqd.smqa</groupId>
<artifactId>maven-common</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../../../../aplicacoes/maven-common</relativePath>
</parent>
<artifactId>smqa-desktop</artifactId>
<version>1.0-SNAPSHOT</version>
<name>smqa-desktop</name>
<packaging>jar</packaging>
<description>Componente Desktop-Core para o SMQA</description>
<dependencies>
<!-- Tools -->
<dependency>
<groupId>br.com.cpqd.smqa</groupId>
<artifactId>smqa-tools</artifactId>
<scope>compile</scope>
</dependency>
<!-- Entity -->
<dependency>
<groupId>br.com.cpqd.smqa</groupId>
<artifactId>smqa-entity</artifactId>
<scope>compile</scope>
</dependency>
<!-- Controller -->
<dependency>
<groupId>br.com.cpqd.smqa</groupId>
<artifactId>smqa-controller</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>br.com.cpqd.smqa</groupId>
<artifactId>smqa-persistence</artifactId>
<scope>compile</scope>
</dependency>
<!-- JFreeChart -->
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>${cpqd.smqa.dep.jfreechart.version}</version>
</dependency>
<!-- Para o calculo do Teste de Grubbs -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math</artifactId>
<version>2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-math3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.0</version>
</dependency>
<!-- Calendar -->
<dependency>
<groupId>net.sourceforge.jdatepicker</groupId>
<artifactId>jdatepicker</artifactId>
<scope>compile</scope>
</dependency>
<!-- commons email -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-email</artifactId>
<version>1.4</version>
</dependency>
<!-- JTerminal with fonts -->
<dependency>
<groupId>com.grahamedgecombe</groupId>
<artifactId>jterminal</artifactId>
<version>${cpqd.smqa.dep.jterminal.version}</version>
<scope>system</scope>
<systemPath>${basedir}/../../../../aplicacoes/libraries/jterminal-fonts.jar</systemPath>
</dependency>
<!-- http://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.2</version>
</dependency>
<!-- http://mvnrepository.com/artifact/commons-collections/commons-collections -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>2.1</version>
</dependency>
<!-- http://mvnrepository.com/artifact/com.github.virtuald/curvesapi -->
<dependency>
<groupId>com.github.virtuald</groupId>
<artifactId>curvesapi</artifactId>
<version>1.03</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.4.0</version>
</dependency>
<!-- http://mvnrepository.com/artifact/javax.servlet/servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
</dependency>
<!-- http://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans -->
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.swinglabs/swingx -->
<dependency>
<groupId>org.swinglabs</groupId>
<artifactId>swingx</artifactId>
<version>1.6.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.jgoodies/forms -->
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>forms</artifactId>
<version>1.0.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.vividsolutions/jts -->
<dependency>
<groupId>com.vividsolutions</groupId>
<artifactId>jts</artifactId>
<version>1.13</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifestEntries>
<Class-Path>../. jterminal-fonts.jar</Class-Path>
</manifestEntries>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>br.com.cpqd.smqa.desktop.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>