如何让Netbeans将javamail.providers
添加到META-INF文件夹(我手动添加)中,而不会进入ant构建文件中的杂草?
有点奇怪,因为manifest.mf最终出现在生成的jar中的META-INF文件夹中(正确)但是位于META-INF文件夹(我手动添加)之外:
thufir@dur:~/NetBeansProjects/gnumail-providers$
thufir@dur:~/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
thufir@dur:~/NetBeansProjects/gnumail-providers$
thufir@dur:~/NetBeansProjects/gnumail-providers$ ll manifest.mf
-rw-rw-r-- 1 thufir thufir 82 Mar 21 03:18 manifest.mf
thufir@dur:~/NetBeansProjects/gnumail-providers$
这是项目:
thufir@dur:~/NetBeansProjects/gnumail-providers$
thufir@dur:~/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
thufir@dur:~/NetBeansProjects/gnumail-providers$
这是Netbeans构建的结果JAR:
thufir@dur:~/NetBeansProjects/gnumail-providers/dist$
thufir@dur:~/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
thufir@dur:~/NetBeansProjects/gnumail-providers/dist$
thufir@dur:~/NetBeansProjects/gnumail-providers/dist$ jar -xf gnumail-providers.jar
thufir@dur:~/NetBeansProjects/gnumail-providers/dist$
thufir@dur:~/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
thufir@dur:~/NetBeansProjects/gnumail-providers/dist$
thufir@dur:~/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
thufir@dur:~/NetBeansProjects/gnumail-providers/dist$
这是对GNU packaging suggestion的回应。
另见:
http://article.gmane.org/gmane.comp.java.netbeans.user/176994