<div class="gmail_quote">On Wed, Aug 12, 2009 at 10:02 AM, Max Rydahl Andersen <span dir="ltr">&lt;<a href="mailto:max.andersen@redhat.com">max.andersen@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



  

<div bgcolor="#ffffff" text="#000000"><div class="im">
<br>
<blockquote type="cite">
  <div class="gmail_quote">
  <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div bgcolor="#ffffff" text="#000000">
    <div>
    <blockquote type="cite">
      <div class="gmail_quote">
      <div>What I don&#39;t understand--and please bear with my naivety
about
Eclipse plugin development--is why we can&#39;t offer some sort of &quot;smart&quot;
editor that is aware of the properties defined in the pom.xml file and
can resolve them when it needs a value (such as the JTA data source
name). </div>
      </div>
    </blockquote>
    </div>
That is what I would like to do where we can - but will only work for
our editors and projects. We don&#39;t control all of the IDE - sorry ;)<br>
Anyway, the editor is just *one* part of this - then there is the whole
set of framework specific models in place, i.e. JSF and JPA provided by
WTP has their own little model which <br>
expects things to be in a specific place and is not in any way
extendable in this area (afaik).<br>
    <br>
btw. jta datasource name is an example of something we don&#39;t really
need to resolve since it only exists at runtime....<br>
what we want to control is that when you want to do Hibernate queries
from the IDE you use a persistence.xml that is configured to run in
J2SE;<br>
but when deploying it should use the datasource name one - and this is
not controllable with a mere property replacement because of how
persistence.xml&#39;s are structured.</div>
  </blockquote>
  <div><br>
We&#39;ll need to discuss this in real time to make sound progress, likely
JBossWorld. But I&#39;ll leave one statement/inquiry here.<br>
  <br>
So you are saying that Eclipse basically has no native support for
property substitutions of any kind in project files? I just don&#39;t see
how the Eclipse developers missed this absolutely critical requirement
for an IDE. For as long as anyone has been developing Java EE web
applications, system administrators have been using all sorts of voodoo
magic property replacement to get any deployable build artifact.
Variations are just a huge fact of life. The IDE has to be able to deal
with that reality and stop living in it&#39;s own ideal world that every
value in a file is concrete.<br>
  </div>
  </div>
</blockquote></div>
I&#39;m saying *all* IDE&#39;s I know does not have property replacements
support - not even intellij. If they have I missed it and would really
like to get pointed to an example/docs anything.<br>
<br>
Please note there are two problems here: property
replacement/understanding in editor/model and editors not being too
much dependent on location of the file.<div class="im"><br>
<blockquote type="cite">
  <div class="gmail_quote">
  <div>Putting my problem solving hat back on, the best way I have
found to deal with this situation, from many years of having to get the
IDE to operate in the real world, is to have an environment switcher.
It tears through the project and replaces configuration files intended
for one app server with configuration files for another. Then, you can
edit them...but of course when you are all done tweaking them (with
permanent changes), you have to copy the files back to their source to
check them in. Otherwise, the changes are just temporary for your
immediate development needs.<br>
  </div>
  </div>
</blockquote></div>
yes, that is what I&#39;ve been doing too - or simply not depend on the IDE
:)<br>
<br>
anyway, having such a environment switcher is &quot;more or less&quot; what the
maven profile support does (except the destionation is always in the
build result, anyone know if that can be changed/customzied?).<br>
What would be nice is to (for those locations where it is possible) to
do the &quot;inverse operation&quot; by simply comparing the src and destination
and just do an intelligent merge ;)<div class="im"><br>
<blockquote type="cite">
  <div class="gmail_quote">
  <div>Am I missing some obvious way to work? Put Maven completely
aside for a moment and just focus on how to deal with different
settings for different environment in any Java EE project. How is the
problem solved? That is where we need to start when we discuss a
solution.<br>
  </div>
  </div>
</blockquote></div>
The problem is unfortunately normally solved with what I normally refer
to as Ant voodoo ;)<br>
<br>
but yes, this is something better done face-2-face since its solution
very much depend on what kind of &#39;property replacement&#39; and what type
of file you do it on.</div></blockquote><div><br>Great, I&#39;ll star this e-mail and we can use it as an agenda for a conversation at JBoss World.<br><br>I do have a rough idea of how to solve this. Obviously, and IDE has to work with a concrete file. That&#39;s a fixture for the time being. What I think we can do in JBoss Tools is offer an environment manager.<br>
<br>The environment manager is aware of source files with replacement properties and the cooresponding real file locations (such as META-INF/persistence.xml or WEB-INF/web.xml). When you select your profile, JBoss Tools runs the property replacements (perhaps using Maven 2) and sets the resolved files into their expected location (in the source tree).<br>
<br>When you make a change to a source file hooked into this manager, JBoss Tools should be able to keep track that you have made a change and offer to update the source file accordingly (or the Maven 2 properties definition for that environment).<br>
<br>It may sound a little complicated, but this would be a great feature. There is no voodoo magic.<br></div></div><br>-Dan<br clear="all"><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br>
Registered Linux User #231597<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br><a href="http://in.relation.to/Bloggers/Dan">http://in.relation.to/Bloggers/Dan</a><br>