|
Re: How to include properties file into resulting jar [message #879639 is a reply to message #879438] |
Thu, 31 May 2012 15:04 |
|
On 5/31/2012 2:15 AM, Flavio Palumbo wrote:
> Hi all,
>
> i'm new to eclipse.
>
> I've package tree like this :
>
> src
> |-mypackage
> |-properties
> mypackage contains the java sources while properties contains only
> properties files. When I build the project, properties package is
> excluded from the jar. I'd like to have it in the resulting jar
> respecting the source structure.
> How can I do that ?
> Any hint would be appreciated.
>
> Flavio
For what it's worth, here's something I wrote a long time ago. I
probably need to revisit it, particularly the confusion between code
lines 16/36 and the opening statement that the subdirectory is named
"resources", which it need not be (could be "properties" as you
suggest). If you piece together the project and play with it, you'll
begin to understand ResourceBundles.
Hope this helps. I'll try to revisit it soon and fix up anything I
screwed up. Sorry for being lame.
http://www.javahotchocolate.com/topics/resbundle.html
|
|
|
|
Re: How to include properties file into resulting jar [message #879671 is a reply to message #879649] |
Thu, 31 May 2012 16:00 |
|
On 5/31/2012 9:26 AM, Flavio Palumbo wrote:
> Hi,
> I tried this :
> right click on the package (properties) -> Use as a source folder.
> I see the folder move down and change color.
> I delete jar file and then rebuild but nothing changes.
> I use Eclipse Java EE IDE for Web Developers.
> Version: Helios Service Release 2
> Build id: 20110218-0911
You don't need to designate any folder as "source" when it's a child of
"src" in the first place. So, this changes nothing.
So, I sent that link thinking you were having trouble seeing the
resources. If that bit works, then you're only having trouble with
showing up in the JAR?
It's not a package per se, but just a folder. When you create the JAR
via right-click on project, Export... -> Java -> JAR file -> Next, you
shouldn't change anything (until you've generated a JAR and understand
what Eclipse does by default). Set the JAR file: field to
<project-name>/jarfile-name.jar and click Finish.
The new JAR file should show up in your project, at the root.
Double-click it and you should see:
com
other stuff...
properties
still other stuff...
Is this not the case?
|
|
|
|
Powered by
FUDForum. Page generated in 0.08106 seconds