facebook

Filtered config files not filtered when deploying to Tomcat

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #330736 Reply

    pierre.henry
    Member

    I have a web project where some configuration files are filtered during the build process, using filters that depend on the environment specified using the profiles mechanism

    To illustrate this, we have a properties file that contain the following line :

    
    mediafiles.images.dir=${webapp.mediafiles.imagesDir}
    

    In another profile-specific properties files we have the following line :

    
    webapp.mediafiles.imagesDir=d:/JavaTools/apache-tomcat-7.0.29/webapps/lis-media/images/
    

    The goal is of course to have different values for different environments (developer machines, test, quality, production etc.)

    (see also this other question)

    It works fine when using Maven to build, either from command line or inside ME, but when deploying to Tomcat using the MyEclipse connector, the Maven build is not executed and the files are copied but not filtered, so thex still contain the ${…} patterns.

    Is there a way to force ME’s deployment process or server connector or whatever it is called to perform the same packaging steps that are done in the Maven build ?

    The workaround used so far was to have a double set of files, with plain unfiltered files in the normal location (used for development in MyEclipse), and filtered files somewhere else, and then in the maven bbuild, replace the plain files by the filtered ones. It works but it unnecessarily complicates the build process and if we are not careful it generates problems such as duplicalte properties files or unfiltered files landing on test or quality servers with the ${…} still inside.

    Also, it defeats the purpose of having environment profiles, since each developer has to maintain the unfiltered files and be careful in case thiese files are commited to SVN etc…

    So if I could have a solution that works with both Maven and the ME deployment mechanism it would be great.

    Regards,

    #330776 Reply

    support-swapna
    Moderator

    pierre.henry,

    I have escalated it to a dev team member. They will get back to you.

    #330940 Reply

    Brian Fernandes
    Moderator

    Pierre,

    I have responded in your other post – let’s continue any further required discussion in that thread: https://www.genuitec.com/forums/topic/maven-builder-what-does-it-do-and-not-do/

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Filtered config files not filtered when deploying to Tomcat

You must be logged in to post in the forum log in