facebook

Profile’s property not resolved in pom.xml

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

    pierre.henry
    Member

    I recently update from MyEclipse 9.x to 10.6. (64bits) running on Win7 64.

    I am having trouble with the new maven support, that I didn’t have before.

    The situation is the following :

    In the parent POM we define a few profiles, for different environments (dev, test, different production environments) so that we can build for these environments.

    Then each environment possess its own config file, that is used to filter and interpolate values into the children projects actual config files. We also have a “master” config file that contains default values so that we don’t have to repeat each parameter in each file if it doesn’t differ from the default.

    So we have for example a file called “filter_myserver.properties”, a profile called “myserver” that sets an “env” variable with the value “myserver”. In the parent pom.xml we define a filters using the value “filter_${env}.propertie” to load the right file depending on which profile is active.

    It workd fine from the command line, using -P switch to set the desired profile, and also from MyEclipse when I run the pom.xml of the parent module with a Run Configuration that sets the profile to the desired value.

    But it generates validation errors in all the children pom.xml files. The errors appear generally on the <parent> element. It says “Error loading property file ‘D:\……\filter_${env}.properties’ etc…” so during the validation or whatever is executed to check the pom.xml files for errors, the profile is not activated and the vriable is not set and cannot be resolved.

    How can I force it to understand the active profile ?

    If not possible, can I at least turn off some of the validation (I still want errors at least for incorrect XML and such) ?

    Extracts of the parent pom.xml :

    
    <project ....>
    
    <build>
    ...
    <filters>
            <filter>${basedir}/../My_Builder/config/filter_properties/master.properties</filter>
            <filter>${basedir}/../My_Builder/config/filter_properties/filter_${env}.properties</filter>   <-- Note the ${env} !
    </filters>
    ...
    
    <profiles>
            
            <profile>
                <id>myserver</id>
                <properties>
                    <env>myserver</env>
                </properties>
            </profile>
    .....
    </profiles>
    
    ...
    
    </project>
    

    My Installation details :
    <code>
    *** Date:
    jeudi, 27. septembre 2012 20.09. h CEST

    *** System properties:
    OS=WindowsVista
    OS version=6.1.0
    OS arch=amd64
    Profile arch=x86_64
    Window system=win32
    Java version=1.6.0_13
    Workspace=file:/D:/workspaces/LIS5/
    VM Args=-Xmx512m
    -XX:MaxPermSize=256m
    -XX:ReservedCodeCacheSize=64m
    -Dosgi.nls.warnings=ignore
    -jar
    D:\Eclipse\MYECLI~1.6\../MYECLI~1.0/Common/plugins/ORB7B5~1.JAR

    *** Subscription information
    Product Id: E3MP (MyEclipse Professional Subscription)
    License version: 3.0
    Full Maintenance Included
    Subscription expiration date (YYYYMMDD): 20130927
    Number of users: 4

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 10.6
    Build id: 10.6-20120727

    Blueprint: MyEclipse 10

    com.genuitec.myeclipse.database – 10.6.0.me201207261914
    com.genuitec.myeclipse.desktop – 10.6.0.me201207261914
    com.genuitec.myeclipse.editor – 10.6.0.me201207261914
    com.genuitec.myeclipse.enterprise.workbench – 10.6.0.me201207261914
    com.genuitec.myeclipse.geronimo – 10.6.0.me201207261914
    com.genuitec.myeclipse.glassfish – 10.6.0.me201207261914
    com.genuitec.myeclipse.icefaces.feature – 10.6.0.me201207261914
    com.genuitec.myeclipse.iedebugger – 10.6.0.me201207261914
    com.genuitec.myeclipse.imageeditor – 10.6.0.me201207261914
    com.genuitec.myeclipse.jboss – 10.6.0.me201207261914
    com.genuitec.myeclipse.jetty – 10.6.0.me201207261914
    com.genuitec.myeclipse.jonas – 10.6.0.me201207261914
    com.genuitec.myeclipse.jrun – 10.6.0.me201207261914
    com.genuitec.myeclipse.jsf – 10.6.0.me201207261914
    com.genuitec.myeclipse.matisse – 10.6.0.me201207261914
    com.genuitec.myeclipse.maven – 10.6.0.me201207261914
    com.genuitec.myeclipse.oracle – 10.6.0.me201207261914
    com.genuitec.myeclipse.orion – 10.6.0.me201207261914
    com.genuitec.myeclipse.persistence – 10.6.0.me201207261914
    com.genuitec.myeclipse.pulse – 10.6.0.me201207261914
    com.genuitec.myeclipse.reports – 10.6.0.me201207261914
    com.genuitec.myeclipse.resin – 10.6.0.me201207261914
    com.genuitec.myeclipse.struts – 10.6.0.me201207261914
    com.genuitec.myeclipse.sun – 10.6.0.me201207261914
    com.genuitec.myeclipse.tomcat – 10.6.0.me201207261914
    com.genuitec.myeclipse.uml2 – 10.6.0.me201207261914
    com.genuitec.myeclipse.visualvm – 10.6.0.me201207261914
    com.genuitec.myeclipse.visualvm.server – 10.6.0.me201207261914
    com.genuitec.myeclipse.weblogic – 10.6.0.me201207261914
    com.genuitec.myeclipse.websphere – 10.6.0.me201207261914
    com.genuitec.myeclipse.ws – 10.6.0.me201207261914
    org.eclipse.birt – 2.6.1.me201207261914
    org.eclipse.datatools.connectivity.feature – 1.9.0.me201207261914
    org.eclipse.datatools.enablement.feature – 1.9.0.me201207261914
    org.eclipse.datatools.modelbase.feature – 1.9.0.v201106031100-77078CcNBHCBYKYEbNV
    org.eclipse.datatools.sqldevtools.feature – 1.9.0.me201207261914
    org.eclipse.emf – 2.7.0.v20110606-0949
    org.eclipse.gef – 3.7.0.v20110425-2050-777D-81B2Bz0685C3A6E34272
    org.eclipse.graphiti.feature – 0.8.0.v20110607-1252
    org.eclipse.jpt.jpa.feature – 3.0.0.me201207261914
    org.eclipse.jpt.jpadiagrameditor.feature – 1.0.0.me201207261914
    org.eclipse.jst.common.fproj.enablement.jdt – 3.3.0.me201207261914
    org.eclipse.jst.enterprise_ui.feature – 3.3.0.me201207261914
    org.eclipse.jst.server_adapters.ext.feature – 3.3.0.me201207261914
    org.eclipse.jst.server_adapters.feature – 3.2.100.me201207261914
    org.eclipse.jst.server_ui.feature – 3.3.0.me201207261914
    org.eclipse.jst.ws.axis2tools.feature – 1.1.200.me201207261914
    org.eclipse.m2e.feature – 1.0.0.me201207261914
    org.eclipse.sapphire.platform – 0.3.0.201106221325
    org.eclipse.wst.common.fproj – 3.3.0.me201207261914
    org.eclipse.wst.server_adapters.feature – 3.2.100.me201207261914
    org.eclipse.xsd – 2.7.0.v20110606-0949
    org.springframework.ide.eclipse.feature – 2.9.1.me201207261914

    fr.obeo.acceleo.bridge.feature – 2.6.0.200906261742
    org.eclipse.cvs – 1.3.100.v20110520-0800-7B78FHl9VF7BD7KBM4GP9C
    org.eclipse.draw2d – 3.7.0.v20110425-2050-46-7w3122153603161
    org.eclipse.equinox.p2.core.feature – 1.0.1.v20110906-1605-8290FZ9FVKHVRKtmx3fpNuo02129
    org.eclipse.equinox.p2.extras.feature – 1.0.1.v20110906-1605-7A4FD4DiVOMap8cHSc6vPuny4gqO
    org.eclipse.equinox.p2.rcp.feature – 1.0.1.v20110906-1605-782EqBqNKGVkiV-PUsgz-uny4gqO
    org.eclipse.equinox.p2.user.ui – 2.1.2.R37x_v20110815-1155-6-Bk8pYWZz0qUTX5I15GZWwbXkrl
    org.eclipse.help – 1.3.0.v20110530-0844-7i7uFFmFFl8nvqbDpEqTvx
    org.eclipse.jdt – 3.7.2.v20120120-1414-7z8gFcuFMP7BW5XTz0jLTnz0l9B1
    org.eclipse.jsf.feature – 3.3.0.me201207261914
    org.eclipse.ocl – 3.1.0.v20110606-1427
    org.eclipse.pde – 3.7.2.v20120120-1420-7b7rFUOFEx2Xnqafnpz0E–0
    org.eclipse.platform – 3.7.2.v20120207-1839-9gF7UHPDFxGjd-PqDr2jX_4yKaumkoHTz04_q-q
    org.eclipse.rcp – 3.7.2.v20120120-1424-9DB5FmnFq5JCf1UA38R-kz0S0272

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86_64
    -showsplash
    -launcher
    D:\Eclipse\MyEclipse-10.6\myeclipse.exe
    -name
    Myeclipse
    –launcher.library
    D:\Eclipse\MyEclipse-10.6\../MyEclipse-9.0/Common/plugins/org.eclipse.equinox.launcher.i18n.win32.win32.x86_64_4.2.0.v201201111650\eclipse_4201.dll
    -startup
    D:\Eclipse\MyEclipse-10.6\../MyEclipse-9.0/Common/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
    -exitdata
    7e8_5c
    -install
    D:\Eclipse\MyEclipse-10.6
    -configuration
    D:\Eclipse\MyEclipse-10.6\configuration
    -vm
    D:\Eclipse\MyEclipse-9.0\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\bin\javaw.exe

    By the way… time to upgrade you forum GUI, it’s kind of awkward to use when you’re used to SO and other sites ! 😉

    #330588 Reply

    support-tony
    Keymaster

    Pierre,

    Sorry you are seeing this issue and thanks for raising it.

    I can replicate the problem and have created a bug report for it to hopefully be fixed in the next update. The only workaround I’ve managed to come up with is to define the “env” property, near the top of the parent pom in a stand-alone properties element, with a default value; the pom validator doesn’t seem to be picking up the fact that the property is defined inside a profile. The validator doesn’t actually use a profile (it isn’t running maven), so it isn’t loading any particular profile.

    I hope the workaround is acceptable, for now. Hopefully a proper fix will arrive in the next update.

    Regarding the forum UI, you might be interesting in this post: New MyEclipse Website Coming 09/2012.

    #330698 Reply

    pierre.henry
    Member

    Thank you for your answer.

    The work-around you described would probably have been OK for me, but I managed to make the problem go away doing something else. I am just not sure what exactly did the trick. I was doing a lot of tweaking in the build files, and I suddently noticed that the red signs were gone from my projects…

    Thanks anyway.

    #330729 Reply

    support-tony
    Keymaster

    Pierre,

    Thanks for getting back to us and I’m glad you managed to get rid of the errors.

    During my testing, I did, at one point, get rid of the errors without the workaround, but I couldn’t replicate the situation again. I had moved the profile definition above the place where the property was referenced and that seemed to work, until I started moving blocks around to see what actually worked. After that, I couldn’t get the problem to go away.

    Hopefully, you won’t see the issue again but we will be looking to fix the problem to ensure you won’t see the issue in a future release of MyEclipse.

    #330846 Reply

    Brian Fernandes
    Moderator

    Pierre,

    I just wanted to follow up on this – we have fixed this issue and a fix will be available in 10.7 (due in a couple of weeks or so)

    You would need to specify the profile you want to be referenced in the IDE in your project’s Maven property page (the page exists now but profile there isn’t used in this context). The profile you specify will then be used to read the “env” property and the property files would then be correctly loaded.

    Thank you for asking.

    #330865 Reply

    pierre.henry
    Member

    Thanks for the feedback. It’s good to know that this issue will be fixed.

    #332664 Reply

    support-tony
    Keymaster

    Pierre,

    This issue has now been fixed in release 10.7. You can use the Configuration Center to update to 10.7. Alternatively download the MyEclips installer from our download page.

    Thanks again for reporting it.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Profile’s property not resolved in pom.xml

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