Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Merge 2 folder at publish time
Merge 2 folder at publish time [message #169456] Tue, 16 May 2006 19:05 Go to next message
Marcos López is currently offline Marcos LópezFriend
Messages: 75
Registered: July 2009
Member
Hi all

I have a full webapp in a folder called "base-webapp" inside my eclipse
project. This webapp is a stable product and i don't intend to change it.
Besides this, i have a folder called "test-personalization", which
contains new files and configuration that i want to add to the base
product.

What i want to achieve is that when the Eclipse Project is published, it
first copies all files from "base-webapp" folder and then
"test-personalization". If there is any file with the same name, it should
be overwritten. Personalization has priority over "base-webapp".

I have looked how to do this, and the closer i have been is by editing
/settings/.component and write there:

<wb-resource deploy-path="/" source-path="/base-webapp"/>
<wb-resource deploy-path="/" source-path="/test-personalization"/>

But sometimes is published correctly and other ones don't. I don't know
why.

Is there any way i can do this?

Thank you very much :-)
Re: Merge 2 folder at publish time [message #169600 is a reply to message #169456] Thu, 18 May 2006 18:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dserodio.gmail.com

Marcos Lopez wrote:
> Hi all
>
> I have a full webapp in a folder called "base-webapp" inside my eclipse
> project. This webapp is a stable product and i don't intend to change
> it. Besides this, i have a folder called "test-personalization", which
> contains new files and configuration that i want to add to the base
> product.
>
> What i want to achieve is that when the Eclipse Project is published, it
> first copies all files from "base-webapp" folder and then
> "test-personalization". If there is any file with the same name, it
> should be overwritten. Personalization has priority over "base-webapp".
>
> I have looked how to do this, and the closer i have been is by editing
> /settings/.component and write there:
>
> <wb-resource deploy-path="/" source-path="/base-webapp"/>
> <wb-resource deploy-path="/" source-path="/test-personalization"/>
>
> But sometimes is published correctly and other ones don't. I don't know
> why.

I think you're doing it correctly. Correctly publishing sometimes but
not all the time sounds like a bug.

Which version of WTP are you using? I've been using 1.5RC2 for quite a
while and it "feels" much more stable than 1.0.2.

The only problem is that projects using 1.x and 1.5x are "a little
different" (at least wrt JUnit library and J2EE Builder), so you may
have problems in a team environment.

HTH,
Daniel Serodio
Re: Merge 2 folder at publish time [message #169682 is a reply to message #169600] Fri, 19 May 2006 16:09 Go to previous messageGo to next message
Marcos López is currently offline Marcos LópezFriend
Messages: 75
Registered: July 2009
Member
hello again

I have installed wtp1.5 RC2 to try and the problem is still there.

I have been trying to find when happens exactly. Only occurs when the same
file is in both folders: "base-webapp" and "test-personalization". Instead
of giving priority to the second one and overwrite it, for some files
always publish changes occurred only in "base-webapp" and for others only
in "test-personalization".

I think is a bug. What do you think?

Thank you very much.
Re: Merge 2 folder at publish time [message #169689 is a reply to message #169682] Fri, 19 May 2006 16:58 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
It's probably a bug that having the same resource come from different
web content folders isn't reported as an error. Having all the data
structures involved and the code that handles them maintain a
deterministic ordering and provide a UI to manage it so this kind of
merge can work reliably probably isn't going to happen anytime soon.
However, you are welcome to report an enhancement request if you think
it's important.

In the mean time, you could use an Ant script to merge folders outside
of the web content folder into the web content folder to achieve this in
a way that works reliably.

Cheers,
Larry

Marcos Lopez wrote:
> hello again
>
> I have installed wtp1.5 RC2 to try and the problem is still there.
> I have been trying to find when happens exactly. Only occurs when the
> same file is in both folders: "base-webapp" and "test-personalization".
> Instead of giving priority to the second one and overwrite it, for some
> files always publish changes occurred only in "base-webapp" and for
> others only in "test-personalization".
>
> I think is a bug. What do you think?
>
> Thank you very much.
>
>
>
Re: Merge 2 folder at publish time [message #169754 is a reply to message #169689] Sun, 21 May 2006 16:38 Go to previous messageGo to next message
Marcos López is currently offline Marcos LópezFriend
Messages: 75
Registered: July 2009
Member
Hello

What i was doing until now is to use an ant script that does the merging.
I have configured it in the Builders Option of the Project properties to
be executed every time the files are saved, and after then to refresh the
whole project so that the publish can be done.

The problem with this solution is that lasts more or less 5 seconds in
publishing, and when i use it during 1 or 2 hours, Eclipse starts giving
error messages of OutOfMemoryException.

Is there a way that this ant task can be executed in a more efficient way?
In case it can't be done, i would like to report the enhancement request
that you have told me about. Where can i do this?

Thank you very much!!!
Re: Merge 2 folder at publish time [message #169763 is a reply to message #169754] Mon, 22 May 2006 13:52 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Hi Marcos,

To request an enhancement, just report it like a bug but set the
Severity field to "enhancement". I wouldn't hold your breath as I doubt
it's very practical to implement.

You may have better luck trying to deal with the OutOfMemoryException.
It suggests that running the Ant build is leaking memory, either by Ant
or Ecplise's support for Ant. Are you running with a "Separate JRE" or
the one running the workspace?

If you can share an Ant script (simpler the better) and it's
configuration so that I can duplicate the problem, I'll try to take a
look. I have other uses for Ant scripts and it would be good to try to
address such leaks, if possible.

Cheers,
Larry


Marcos Lopez wrote:
> Hello
>
> What i was doing until now is to use an ant script that does the
> merging. I have configured it in the Builders Option of the Project
> properties to be executed every time the files are saved, and after then
> to refresh the whole project so that the publish can be done.
>
> The problem with this solution is that lasts more or less 5 seconds in
> publishing, and when i use it during 1 or 2 hours, Eclipse starts giving
> error messages of OutOfMemoryException.
>
> Is there a way that this ant task can be executed in a more efficient
> way? In case it can't be done, i would like to report the enhancement
> request that you have told me about. Where can i do this?
>
> Thank you very much!!!
>
Re: Merge 2 folder at publish time [message #169952 is a reply to message #169763] Tue, 23 May 2006 20:46 Go to previous messageGo to next message
Marcos López is currently offline Marcos LópezFriend
Messages: 75
Registered: July 2009
Member
Hello again

the ant task i am using to do the merge is something like:

<target name="update-personalization">
<copy todir="../pers-deploy">
<fileset dir="../test-personalization" />
</copy>
</target>

"pers-deploy" is the folder which i use to publish the final Web Content.
Initially i make a copy of the base-webapp and every time a file is saved
in the test-personalization folder this task is executed.

The Builder configuration i have made is the following (I don't paste the
builder.launch file because it's quite long and i haven't changed many
things from the default configuration):

- Refresh resources upon completion -> The project containing the selected
resource

- Targets -> this task is executed with the "Auto Build"

- Run in the same JRE as the workspace

- The rest of the options has default values.


Is there any way of publishing without synchronizing?. By synchronizing i
mean that if i delete one file from a folder it doesn't disappear from the
deployed Web Content. If i could do this, i think that my problem would be
solved.

Thank you very much :-)
Re: Merge 2 folder at publish time [message #169983 is a reply to message #169952] Tue, 23 May 2006 21:45 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
You might try running with "Separate JRE" instead of "same JRE as the
workspace". It should get rid of the OutOfMemoryException. If
necessary pass in some System properties derived from Eclipse variables
to keep the script working with this change.

For publishing there is only one level, which is full synchronization.
There is no "additions only" mode.

With your approach of multiple web content folders, the problem seemed
to be with the overwrites. Since you are using Eclipse 3.2, you might
be able to use resource links (which no longer have to be in the root
folder of a project) to pull just what you need into the web content
folders so the conflicts are avoided. I haven't played much with this
Eclipse 3.2 feature, so I don't know if there would be problems using it
in this situation.

Cheers,
Larry

Marcos Lopez wrote:
> Hello again
>
> the ant task i am using to do the merge is something like:
>
> <target name="update-personalization">
> <copy todir="../pers-deploy">
> <fileset dir="../test-personalization" />
> </copy> </target>
>
> "pers-deploy" is the folder which i use to publish the final Web
> Content. Initially i make a copy of the base-webapp and every time a
> file is saved in the test-personalization folder this task is executed.
>
> The Builder configuration i have made is the following (I don't paste
> the builder.launch file because it's quite long and i haven't changed
> many things from the default configuration):
>
> - Refresh resources upon completion -> The project containing the
> selected resource
>
> - Targets -> this task is executed with the "Auto Build"
>
> - Run in the same JRE as the workspace
>
> - The rest of the options has default values.
>
>
> Is there any way of publishing without synchronizing?. By synchronizing
> i mean that if i delete one file from a folder it doesn't disappear from
> the deployed Web Content. If i could do this, i think that my problem
> would be solved.
>
> Thank you very much :-)
>
Previous Topic:some key bindings lost in our editor
Next Topic:Running Application Client Project in IDE
Goto Forum:
  


Current Time: Sat Apr 20 03:12:36 GMT 2024

Powered by FUDForum. Page generated in 0.04709 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top