2

I wand to deploy a VF page, let's call it myVF.page, from Org A to Org B using force.com IDE (eclipse).

Now on Org A there are lots of managed packages installed. None of them are in relation or used in any way by myVF.page - but the myVFpage-meta.xml is polluted by tons of -tags like this

<packageVersions>
    <majorNumber>1</majorNumber>
    <minorNumber>1003</minorNumber>
    <namespace>DF3</namespace>
</packageVersions>
<!-- ... here a HUGE LIST goes on and on ...-->
<packageVersions>
    <majorNumber>2</majorNumber>
    <minorNumber>1123</minorNumber>
    <namespace>ec2</namespace>
</packageVersions>

I need these managed packages on the Org A. I don't need any of them in myVF.page

Now when I deploy, eclipse seems to use the .page-mate.xml implicitly even if I have not selected it. Then the deployment fails with errors listing unmet dependencies of the packages above in the destination Org B.

In Org B I don't want and I don't need these packages. But I need myVF.page to be deployed.

In my real scenario, there are lots of VF pages I need to deploy, not only one. If it was only one, I would locally edit the .page-meta.xml to get rid of the error. For a huge number of pages this would be ridiculous and I'm looking for a better way.

How can I easily get rid of these unwanted dependencies without modifying each .page-meta.xml file of all the affected pages?

5

In an ant build script, I usually include the following:

    <target name="strip">
            <replaceregexp flags="gs">
                    <regexp pattern="\s*&lt;(listViews|searchLayouts)&gt;.+&lt;\/\1&gt;" />
                    <substitution expression="" />
                    <fileset dir=".\\src\\objects">
                            <include name="*.object" />
                    </fileset>
            </replaceregexp>
            <replaceregexp flags="gs">
                    <regexp pattern="\s*&lt;(packageVersions)&gt;.+&lt;\/\1&gt;" />
                    <substitution expression="" />
                    <fileset dir=".\\src\\classes">
                            <include name="*.xml" />
                    </fileset>
            </replaceregexp>
            <replaceregexp flags="gs">
                    <regexp pattern="\s*&lt;(packageVersions)&gt;.+&lt;\/\1&gt;" />
                    <substitution expression="" />
                    <fileset dir=".\\src\\pages">
                            <include name="*.xml" />
                    </fileset>
            </replaceregexp>
            <replaceregexp flags="gs">
                    <regexp pattern="\s*&lt;(packageVersions)&gt;.+&lt;\/\1&gt;" />
                    <substitution expression="" />
                    <fileset dir=".\\src\\components">
                            <include name="*.xml" />
                    </fileset>
            </replaceregexp>
            <replaceregexp flags="gs">
                    <regexp pattern="\s*&lt;(packageVersions)&gt;.+&lt;\/\1&gt;" />
                    <substitution expression="" />
                    <fileset dir=".\\src\\triggers">
                            <include name="*.xml" />
                    </fileset>
            </replaceregexp>
    </target>

This code is run as ant strip. It removes a lot of superficial elements that cause deployment issues, include package version errors and search layouts. Feel free to modify this as you like.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.