Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » WTP and static resources in utility projects
WTP and static resources in utility projects [message #232279] Wed, 10 June 2009 09:44 Go to next message
Alex Tanaev is currently offline Alex Tanaev
Messages: 7
Registered: July 2009
Junior Member
I have 2 projects, Dynamic Web Project and a Utility Project.

Everything works as expected, classes from the Utility Project are
packaged during deployment in a jar file in WEB-INF/lib of the Dynamic Web
Project.

I would like to have some static files from the Utility Project to be
included in the Dynamic Web Project during deployment (the same way static
files from WebContext folder of the Dynamic Web Project are included).

Is it possible to do? The same Utility Project is to be used in other
Dynamic Web Projects. I find it silly that I can have classes defined in
one place, but static file copied to all Dynamic Web Projects.

I understand that it can be done with some ant or programm builders, but I
would like to avoid this if possible.


Alex.
Re: WTP and static resources in utility projects [message #232323 is a reply to message #232279] Wed, 10 June 2009 12:42 Go to previous messageGo to next message
Philippe Marschall is currently offline Philippe Marschall
Messages: 120
Registered: July 2009
Senior Member
Alex Tanaev wrote:
> I have 2 projects, Dynamic Web Project and a Utility Project.
>
> Everything works as expected, classes from the Utility Project are
> packaged during deployment in a jar file in WEB-INF/lib of the Dynamic
> Web Project.
>
> I would like to have some static files from the Utility Project to be
> included in the Dynamic Web Project during deployment (the same way
> static files from WebContext folder of the Dynamic Web Project are
> included).
>
> Is it possible to do? The same Utility Project is to be used in other
> Dynamic Web Projects. I find it silly that I can have classes defined in
> one place, but static file copied to all Dynamic Web Projects.
>
> I understand that it can be done with some ant or programm builders, but
> I would like to avoid this if possible.

Standard problem, bug 271281 addresses something similar.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=271281

Cheers
Philippe
Re: WTP and static resources in utility projects [message #232354 is a reply to message #232323] Thu, 11 June 2009 04:05 Go to previous messageGo to next message
Alex Tanaev is currently offline Alex Tanaev
Messages: 7
Registered: July 2009
Junior Member
Thanks.

Giving it is "Standard problem" and that the bug is "Opened: 2009-04-06" I
would guess there are also ways to work around the problem.

Aparently not...

Regards,

Alex
Re: WTP and static resources in utility projects [message #232360 is a reply to message #232354] Thu, 11 June 2009 07:54 Go to previous messageGo to next message
Philippe Marschall is currently offline Philippe Marschall
Messages: 120
Registered: July 2009
Senior Member
Alex Tanaev wrote:
> Thanks.
>
> Giving it is "Standard problem" and that the bug is "Opened: 2009-04-06"
> I would guess there are also ways to work around the problem.

Making a link in Eclipse is probably the best way to work around it.

Cheers
Philippe
Re: WTP and static resources in utility projects [message #232368 is a reply to message #232360] Thu, 11 June 2009 08:03 Go to previous messageGo to next message
Alex Tanaev is currently offline Alex Tanaev
Messages: 7
Registered: July 2009
Junior Member
Yes, I experimented with a link, and it seems to work. There is just a
small annoying thing: I manage to make it work with linked resources and
variables, but this requires an absolute path. It is OK, but may be there
is a way to specify links not as 'relative to a path variable', but as
'relative to this project'?

Alex
Re: WTP and static resources in utility projects [message #232375 is a reply to message #232368] Thu, 11 June 2009 08:59 Go to previous messageGo to next message
Eclipse User
Originally posted by: Kevin.REMOVE.Dean.datadevelopment.com

Alex Tanaev wrote:

>Yes, I experimented with a link, and it seems to work. There is just a
>small annoying thing: I manage to make it work with linked resources and
>variables, but this requires an absolute path. It is OK, but may be there
>is a way to specify links not as 'relative to a path variable', but as
>'relative to this project'?

Sort of. When you go into the Java build path, select "Link Source..."
and then choose "Variables". From there, you can create a variable (e.g.
WSRoot) that refers to your workspace root. You can use this variable as
the basis for your linked source no matter where your workspace is
installed.
Re: WTP and static resources in utility projects [message #232409 is a reply to message #232375] Fri, 12 June 2009 03:01 Go to previous messageGo to next message
Alex Tanaev is currently offline Alex Tanaev
Messages: 7
Registered: July 2009
Junior Member
Kevin Dean wrote:

> Alex Tanaev wrote:

>>Yes, I experimented with a link, and it seems to work. There is just a
>>small annoying thing: I manage to make it work with linked resources and
>>variables, but this requires an absolute path. It is OK, but may be there
>>is a way to specify links not as 'relative to a path variable', but as
>>'relative to this project'?

> Sort of. When you go into the Java build path, select "Link Source..."
> and then choose "Variables". From there, you can create a variable (e.g.
> WSRoot) that refers to your workspace root. You can use this variable as
> the basis for your linked source no matter where your workspace is
> installed.

Well, this is exactly what I was doing.
My question was: is it possible to define a linked resource _without_
defining a variable with absolute path.

Look, .project has now something like

<linkedResources>
<link>
<name>linked_folder</name>
<type>2</type>
<locationURI>CURRENT_WA/UtilProject/sharedWebFiles</locationURI >
</link>
</linkedResources>

1. I was hoping there is some "predefined" variable referring to the
current workspace root. Apparently not, so I have to define CURRENT_WA as
a variable referring to my workspace root.

2. But maybe locationURI syntax has some other way to refer to the current
workspace root? After all, it has a special way to refer to variables, so
may be, just may be...

Alex
Re: WTP and static resources in utility projects [message #232455 is a reply to message #232409] Sun, 14 June 2009 06:30 Go to previous messageGo to next message
Eclipse User
Originally posted by: Kevin.REMOVE.Dean.datadevelopment.com

Alex Tanaev wrote:

>1. I was hoping there is some "predefined" variable referring to the
>current workspace root. Apparently not, so I have to define CURRENT_WA as
>a variable referring to my workspace root.

Unfortunately, no. However, the user variable is user-specific so anyone
working on the project that uses another directory structure just has to
set the user variable to point to their root.

>2. But maybe locationURI syntax has some other way to refer to the current
> workspace root? After all, it has a special way to refer to variables, so may be, just may be...

It would be nice. Directory management in Eclipse is all over the map;
there are some places where they work relative to the workspace root,
others where the workspace root isn't considered, and on and on.
Re: WTP and static resources in utility projects [message #232463 is a reply to message #232455] Mon, 15 June 2009 03:14 Go to previous message
Alex Tanaev is currently offline Alex Tanaev
Messages: 7
Registered: July 2009
Junior Member
Kevin Dean wrote:

> Alex Tanaev wrote:

>>1. I was hoping there is some "predefined" variable referring to the
>>current workspace root. Apparently not, so I have to define CURRENT_WA as
>>a variable referring to my workspace root.

> Unfortunately, no. However, the user variable is user-specific so anyone
> working on the project that uses another directory structure just has to
> set the user variable to point to their root.

>>2. But maybe locationURI syntax has some other way to refer to the current
>> workspace root? After all, it has a special way to refer to variables, so
may be, just may be...

> It would be nice. Directory management in Eclipse is all over the map;
> there are some places where they work relative to the workspace root,
> others where the workspace root isn't considered, and on and on.

Tell me about it... I just posted a message to eclipse.tools.jdt with some
other "Directory management-related" questions...
Previous Topic:Creation of Webservice error
Next Topic:Faceted Project framework question
Goto Forum:
  


Current Time: Thu Jul 31 09:35:05 EDT 2014

Powered by FUDForum. Page generated in 0.02202 seconds