如何讓Netbeans將javamail.providers
添加到META-INF文件夾(我手動添加的文件夾中)而不進入ant構建文件中的雜草?Netbeans項目中沒有默認的META-INF文件夾 - 在哪裏添加文件?
它有點奇怪,因爲MANIFEST.MF在所得的罐(正確地)結束在META-INF文件夾但駐留outsid的META-INF文件夾(我手動添加):
[email protected]:~/NetBeansProjects/gnumail-providers$
[email protected]:~/NetBeansProjects/gnumail-providers$ ll META-INF/
total 12
drwxrwxr-x 2 thufir thufir 4096 Mar 21 04:02 ./
drwxr-xr-x 8 thufir thufir 4096 Mar 21 04:15 ../
-rw-rw-r-- 1 thufir thufir 868 Mar 21 04:02 javamail.providers
[email protected]:~/NetBeansProjects/gnumail-providers$
[email protected]:~/NetBeansProjects/gnumail-providers$ ll manifest.mf
-rw-rw-r-- 1 thufir thufir 82 Mar 21 03:18 manifest.mf
[email protected]:~/NetBeansProjects/gnumail-providers$
這裏是項目:
[email protected]:~/NetBeansProjects/gnumail-providers$
[email protected]:~/NetBeansProjects/gnumail-providers$ tree -L 2
.
├── build
│ ├── built-jar.properties
│ ├── classes
│ ├── empty
│ └── generated-sources
├── build.xml
├── dist
│ ├── gnu
│ ├── gnumail-providers.jar
│ ├── META-INF
│ ├── net
│ ├── providers
│ ├── treeutil
│ └── usenet.properties
├── javamail.providers
├── manifest.mf
├── META-INF
│ └── javamail.providers
├── nbproject
│ ├── build-impl.xml
│ ├── genfiles.properties
│ ├── private
│ ├── project.properties
│ └── project.xml
└── src
├── gnu
├── net
├── providers
├── treeutil
└── usenet.properties
18 directories, 12 files
[email protected]:~/NetBeansProjects/gnumail-providers$
這裏是產生的JAR其中Netbeans的構建:
[email protected]:~/NetBeansProjects/gnumail-providers/dist$
[email protected]:~/NetBeansProjects/gnumail-providers/dist$ ll
total 228
drwxrwxr-x 3 thufir thufir 4096 Mar 21 04:15 ./
drwxr-xr-x 8 thufir thufir 4096 Mar 21 04:15 ../
-rw-rw-r-- 1 thufir thufir 213021 Mar 21 04:15 gnumail-providers.jar
drwxrwxr-x 2 thufir thufir 4096 Mar 21 04:15 lib/
-rw-rw-r-- 1 thufir thufir 1332 Mar 21 04:15 README.TXT
[email protected]:~/NetBeansProjects/gnumail-providers/dist$
[email protected]:~/NetBeansProjects/gnumail-providers/dist$ jar -xf gnumail-providers.jar
[email protected]:~/NetBeansProjects/gnumail-providers/dist$
[email protected]:~/NetBeansProjects/gnumail-providers/dist$ ll
total 252
drwxrwxr-x 8 thufir thufir 4096 Mar 21 04:15 ./
drwxr-xr-x 8 thufir thufir 4096 Mar 21 04:15 ../
drwxrwxr-x 3 thufir thufir 4096 Mar 21 04:15 gnu/
-rw-rw-r-- 1 thufir thufir 213021 Mar 21 04:15 gnumail-providers.jar
drwxrwxr-x 2 thufir thufir 4096 Mar 21 04:15 lib/
drwxrwxr-x 2 thufir thufir 4096 Mar 21 04:15 META-INF/
drwxrwxr-x 3 thufir thufir 4096 Mar 21 04:15 net/
drwxrwxr-x 9 thufir thufir 4096 Mar 21 04:15 providers/
-rw-rw-r-- 1 thufir thufir 1332 Mar 21 04:15 README.TXT
drwxrwxr-x 2 thufir thufir 4096 Mar 21 04:15 treeutil/
-rw-rw-r-- 1 thufir thufir 70 Mar 21 04:15 usenet.properties
[email protected]:~/NetBeansProjects/gnumail-providers/dist$
[email protected]:~/NetBeansProjects/gnumail-providers/dist$ ll META-INF/
total 12
drwxrwxr-x 2 thufir thufir 4096 Mar 21 04:15 ./
drwxrwxr-x 8 thufir thufir 4096 Mar 21 04:15 ../
-rw-rw-r-- 1 thufir thufir 339 Mar 21 04:15 MANIFEST.MF
[email protected]:~/NetBeansProjects/gnumail-providers/dist$
這是對GNU packaging suggestion的迴應。
參見:
http://article.gmane.org/gmane.comp.java.netbeans.user/176994