我與Eclipse和Maven做這個estructure文件夾中的Java項目: enter image description here的.jar與Maven和Eclipse
好吧,當我做一個Maven安裝創建的.jar採取這種結構的文件夾:
因此,層次結構是不一樣的,並鏈接到圖像和CSS不起作用。
我告訴你的pom.xml的
enter code here
http://maven.apache.org/xsd/maven-4.0.0.xsd「代碼> 4.0.0 com.wepall 帕勒 0.4.0 com.thoughtworks.xstream XStream的 com.thoughtworks.xstream XStream的 1.4.9 帕勒
<!-- download source code in Eclipse, best practice -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
</configuration>
</plugin>
<!-- Set a compiler level -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<!-- Maven Assembly Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<!-- get all project dependencies -->
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<!-- MainClass in mainfest make a executable jar -->
<archive>
<manifest>
<mainClass>com.wepall.palle.MainApp</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<!-- bind to the packaging phase -->
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
任何想法?
非常感謝! 最好的問候
你能成爲一個更具體一點??? –
是的,對不起,mi問題是關於.jar的herarky文件夾, 我解釋你, – wepall
當我讓.jar沒有生成具有該項目的層次結構時,src的原始結構是src \ main \ java \ com \ wepall \ palle和src \ main \ resources ,最後是在java文件夾內,資源文件夾位於同一個文件夾中。 什麼時候它必須是一個java的文件夾和一個com文件夾(包含類)和其他資源以及文件夾css,Images,lib,Projects,RobotFiles內部。 – wepall