Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » log4j.xml not copied to build folder
log4j.xml not copied to build folder [message #548533] Thu, 22 July 2010 09:45 Go to next message
Abid Hussain is currently offline Abid HussainFriend
Messages: 10
Registered: July 2010
Junior Member
Hello,

I have a maven project (using the m2 plugin) configured as dynamic web project. In the folder src/main/resources (which is configured in Build Path properties as one of the source folders) there are several configuration files, one of those is log4j.xml. The Build folder is target/classes.

For some reasons which I don't understand all files in the folder src/main/resources are copied to target/classes but not the log4j.xml.
I always have to copy it manually to target/classes.

My question is: has anybody an explanation about this behaviour or could it be that the file is copied but somehow deleted straight away?

Best regards,

Abid
Re: log4j.xml not copied to build folder [message #548535 is a reply to message #548533] Thu, 22 July 2010 09:49 Go to previous messageGo to next message
Abid Hussain is currently offline Abid HussainFriend
Messages: 10
Registered: July 2010
Junior Member
I forgot to mention that I use Tomcat 6 together with WTP 3.1.1 on Eclipse 3.5.

Regards,

Abid
Re: log4j.xml not copied to build folder [message #548634 is a reply to message #548533] Thu, 22 July 2010 13:54 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
On 7/22/2010 5:45 AM, Abid Hussain wrote:
> Hello,
>
> I have a maven project (using the m2 plugin) configured as dynamic web
> project. In the folder src/main/resources (which is configured in Build
> Path properties as one of the source folders) there are several
> configuration files, one of those is log4j.xml. The Build folder is
> target/classes.
>
> For some reasons which I don't understand all files in the folder
> src/main/resources are copied to target/classes but not the log4j.xml.
> I always have to copy it manually to target/classes.
>
> My question is: has anybody an explanation about this behaviour or could
> it be that the file is copied but somehow deleted straight away?
>
> Best regards,
>
> Abid

I tried this and it worked for fine for me, though I'm not using maven.
This suggests this behavior is not fundamental to WTP. It could be an
atypical setting in your project or something related to maven. Note
that WTP doesn't handle the "building" of the Java source folder to the
output folder. This is handled by the JDT (Java Development Tools)
portion of Eclipse.

You imply that other configuration files are copied. Are some of these
also xml files or do all have some other extension?

A shot in the dark is to Refresh the src/main/resources folder on the
chance that this file is out of sync with the file system. This could
cause a problem when copying the file.

Cheers,
Larry
Re: log4j.xml not copied to build folder [message #549243 is a reply to message #548634] Mon, 26 July 2010 08:58 Go to previous messageGo to next message
Abid Hussain is currently offline Abid HussainFriend
Messages: 10
Registered: July 2010
Junior Member
Thanks for you hints.

There are also other xml-files in the folder src/main/resources which are all copied properly to target/classes.

Also when I add a new file (dummy.txt or whatever) it is copied to the build folder.

But even when I delete the log4j.xml and add it again it is not copied... It seems that only a file with the name log4j.xml ist not copied. It's really strange.

Maybe I should post this question to the JDT forum.
Re: log4j.xml not copied to build folder [message #549325 is a reply to message #548634] Mon, 26 July 2010 13:21 Go to previous messageGo to next message
Abid Hussain is currently offline Abid HussainFriend
Messages: 10
Registered: July 2010
Junior Member
I solved the problem. See JDT forum.
Re: log4j.xml not copied to build folder [message #549338 is a reply to message #549243] Mon, 26 July 2010 13:27 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
On 7/26/2010 4:58 AM, Abid Hussain wrote:
> Thanks for you hints.
>
> There are also other xml-files in the folder src/main/resources which
> are all copied properly to target/classes.
>
> Also when I add a new file (dummy.txt or whatever) it is copied to the
> build folder.
>
> But even when I delete the log4j.xml and add it again it is not
> copied... It seems that only a file with the name log4j.xml ist not
> copied. It's really strange.
>
> Maybe I should post this question to the JDT forum.

It would seem something is deliberately not copying the file. Since
it's not happening for me in a typical Eclipse + WTP environment, I
wouldn't exclude maven from the list of possible culprits. You may want
to experiment by creating a non-maven dynamic web project and see if it
has the same issue. If not, you could try to compare settings with the
maven project add see if you can find something that is different that
might be the cause.

Cheers,
Larry
Previous Topic:Possibility of embedding WTP XML Editor in a web app
Next Topic:Does eclipse has a feature of auto usage finder on selecting a part of code ?
Goto Forum:
  


Current Time: Sat Nov 29 05:37:41 GMT 2014

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

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