function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NareshNaresh 

Apex deployment Error: Duplicate Packages Installed. Can not make the deployment Plan

Hi,
I have created an Apex class on the Sandbox and wanted to deploy the Apex class on the Production org. I am using Eclipse 3.2 for Apex deployment. While deployment i am getting the following error:
"Duplicate packages are installed. Can not make the deployment plan."

After interogation i found that on the Production org there are duplicate Package installed with the same name. These package have some important data and can not be deleted or removed.

Any idea?
Please suggest if there is any other option to deploy the code without delete or removing the duplicate Pakcages.

Note: The code coverage for the Apex class is more than 85% so it can not be the code coverage issue.

Thanks in Advance!
Best Answer chosen by Admin (Salesforce Developers) 
JonPJonP
The Deploy task works a little differently on the server side when you are deploying to a production org vs. sandbox or developer edition.  With production, you can't specify tests to run.  Instead, it runs every tests in your org when you deploy, in order to detect/prevent regressions.

Am I correct in guessing you've put your production credentials in build.properties?  If so, are you absolutely certain you want to deploy the sample classes/triggers to your production environment?

If you're certain, try editing build.xml:
1. Find the tag <target name="deployCode">
2. Inside it you will find a tag <sf:deploy ...>
3. Inside this, remove the <runTest>...</runTest> tags

From the command prompt, run 'ant deploy' again.

I haven't had a chance to confirm this myself, but I think it will work.

All Answers

JonPJonP
This is a limitation of the Force.com IDE, which is currently in Developer Preview release.  You should be able to use the Ant-based Apex Deployment Tool to deploy your class to production.
NareshNaresh
Thanks for the quick reply!. I have tried to deploy the Apex code through Apex Deployment Tool but getting the error. I follow the below steps:

1. Visit http://java.sun.com/javase/downloads/index.jsp and install Java JDK, Version 6.1 or greater on the deployment
machine.
2. Visit http://ant.apache.org/ and install Apache Ant, Version 1.6 or greater on the deployment machine.
3. Set up the environment variables (such as ANT_HOME, JAVA_HOME, and PATH) as specified in the Ant Installation Guide
at http://ant.apache.org/manual/install.html.
4. Verify that the JDK and Ant are installed correctly by opening a command prompt, and entering ant –version. Your
output should look something like this:
Apache Ant version 1.7.0 compiled on December 13 2006
5. Log in to Salesforce on your deployment machine. Click Setup ➤ Build ➤ Tools, then click Apex Deployment Tool.
6. Unzip the downloaded file to the directory of your choice. The Zip file contains the following:
• A Readme.html file that explains how to use the tools.
• A Jar file containing the ant task: ant-salesforce.jar.
• A sample folder containing:
• A Classes folder that contains compileAndTest.apex
• A Triggers folder that contains phoneSetter.tgr
• A sample build.properties file that you modify to run the ant task
• A sample build.xml file, that exercises the compileAndTest API call
7. Copy the ant-salesforce.jar file from the unzipped file into the ant lib directory. The ant lib directory is located in
the root folder of your Ant installation.
8. Open the sample subdirectory in the unzipped file.
9. Edit the build.properties file.
10. Open a command window in the sample directory
11. Enter 'ant deploy' command on the command line


but the following errors is thrown:
"deploy does not support the nested "runTest" element"

Any idea?

Thanks,



JonPJonP
The Deploy task works a little differently on the server side when you are deploying to a production org vs. sandbox or developer edition.  With production, you can't specify tests to run.  Instead, it runs every tests in your org when you deploy, in order to detect/prevent regressions.

Am I correct in guessing you've put your production credentials in build.properties?  If so, are you absolutely certain you want to deploy the sample classes/triggers to your production environment?

If you're certain, try editing build.xml:
1. Find the tag <target name="deployCode">
2. Inside it you will find a tag <sf:deploy ...>
3. Inside this, remove the <runTest>...</runTest> tags

From the command prompt, run 'ant deploy' again.

I haven't had a chance to confirm this myself, but I think it will work.
This was selected as the best answer