tags:

views:

20

answers:

1

I have a single eclipse project

myProject/
         com.mydomain.myproject.item1/
                                      Item1.java //contains a main()

         com.mydomain.myproject.item2/
                                      Item2.java //contains a main()

         com.mydomain.myproject.item3/
                                      Item3.java //contains a main()

         com.mydomain.myproject.library/
                                      Library.java

now imagine that each of these projects depended on the library, and some may have inter-related dependencies also such that item1 depends on item2 but not item3.

How can I export this into a jar such that only the packages item1, item2, and library are included?

A: 

I guess you could exclude packages from your source folder. When exporting as JAR, the excluded paths are not considered.

See if this does it for you: in Package Explorer, right click on your project, then Properties > Java Build Path > Source tab > expand your source folder > Excluded > Edit button > Exclusion patterns field > Add button, then exclude what you want > OK.

dpb