Importing project from Git without any IDEA/Illuminated Cloud metadata

3,224 views
Skip to first unread message

Joseph Bleau

unread,
Jul 22, 2016, 11:40:35 AM7/22/16
to Illuminated Cloud General Discussion
Hey all,

Is it possible to import a set of Salesforce metadata from Git and convert it into an Illuminated Cloud project within IntelliJ? The repository is basic, just a src/ and package.xml.

So far I've:
 - Cloned the repository and loaded it as a project in IntelliJ
 - Added the Illuminated Cloud Facet to the project
 - Added and tested my connection string

From here retrieving data seems to work, but I could not push data. Also, I could not generate the offline symbol table.

When I then did was add the following line to my connection string in .idea/illuminatedCloud.xml:

<option name="defaultModuleName" value="MyModule" />

I did this because when I attempted to generate symbol tables, it gave me a warning saying it could not as there was no module associated with my connection. I examined other working IC settings and saw this difference.

Doing this did not do what I expected. On restart IntelliJ complained that my project was out-dated and prompted to update it. When I did this, I was then prompted with an error that the module 'MyModule' had invalid configuration. Upon clicking 'Resolve' it turned my src/ folder into a source directory, and immediately began generating the offline sources table.

Once that was complete I was able to push data!

So... that leads me back to my original question. And although I got it working, it seems like the major hangup was in the disconnect between the Facet I added for IC and the existing module. Where did I go astray? Was it in not originally marking src/ as a source directory? 

I'm sure I'm hugely misguided, so set me straight! I am currently documenting an onboarding process for new developers and want to offer them the chance to use IntelliJ + IC if they desire so any and all help is extremely appreciated.

Thanks,
Joe Bleau

Scott

unread,
Jul 22, 2016, 11:58:40 AM7/22/16
to discu...@illuminatedcloud.com
Joe, a bit back I tried to automate as much of this as possible.  If you use File>New>Project from Version Control>... and check out source that can be identified by Illuminated Cloud as a Salesforce project (contains *.cls, *.trigger, etc., files), you should see a toaster popup prompting you to perform an automatic conversion into an Illuminated Cloud project/module.  In general this takes a few steps, primarily because when it changes the module type from Java (default) to Illuminated Cloud, it has to close and re-open the project.  The toaster popup will then recur with the remaining steps (connection creation, OST generation, etc.), so just click Resolve and it should take care of everything.  I think the only time you have to add information explicitly is connection creation, and it opens the connection config screen for you to do so.

If that doesn't make sense, let me know and I can create a quick video showing the way it should work against one of the public Salesforce Git repos.  I've tried very hard to make "adoption" of existing source into Illuminated Cloud as seamless as possible, so if something isn't working properly for you, please let me know.

Regards,
Scott

Scott

unread,
Jul 22, 2016, 12:04:29 PM7/22/16
to discu...@illuminatedcloud.com
So...I just tried this against a simple Git repo with a Salesforce project, and it didn't work as described.  It looks like somewhere along the way, that must have regressed.  Let me see if I can figure out what's going on.  My guess is that it's likely a quick fix.  More to come!

UPDATE: Yup, I just found the issue and know EXACTLY when I introduced it.  I also already have a fix.  I'll get it out today.

Joseph Bleau

unread,
Jul 22, 2016, 12:28:12 PM7/22/16
to Illuminated Cloud General Discussion
Scott, 

Holy cow! You're the best. Thanks for looking into this issue. I'm very glad to hear the IntelliJ portion of this document will be much simpler and wont involve bizarre work-arounds :) I love your product and continue to advocate it to my co-workers who are still using Eclipse / Force.com Plugin.

Thanks again,
Joe

Scott

unread,
Jul 22, 2016, 1:17:13 PM7/22/16
to Illuminated Cloud General Discussion
Joe, I've just uploaded a new build with the fix.  When you get a chance, please try to create a new project from Git that doesn't already have IntelliJ config files and let me know if it's not a smoother experience.

Regards,
Scott

Joseph Bleau

unread,
Jul 22, 2016, 1:52:35 PM7/22/16
to Illuminated Cloud General Discussion
Scott, it worked much better this time. It immediately recognized it as an Illuminated Cloud project. As you outlined in the first response there was a toast that allowed me to easily configure my connection string and generate the OST.

Thanks so much for the quick turn around.

Joe

Scott

unread,
Jul 22, 2016, 2:30:23 PM7/22/16
to Illuminated Cloud General Discussion
Glad to hear, Joe.  Thanks again for bringing it to my attention!

justi...@sirono.com

unread,
Nov 16, 2016, 5:48:16 PM11/16/16
to Illuminated Cloud General Discussion
Hey Scott,

I'm experiencing a similar issue and followed the steps you outlined above. The problem I'm now facing is that I keep getting an error that reads: "module must have the Illuminated Cloud module type." Clicking Resolve will reopen the project, but I keep getting the same error. 

The Project Structure -> Modules shows my module with an Illuminated Cloud option underneath it. My Module SDK is IlluminatedCloud and points to the Offline System Table created within my project. 

Not real sure where to go from here. Please let me know if you need more information.

Thanks,

Justin

Scott

unread,
Nov 17, 2016, 9:59:42 AM11/17/16
to Illuminated Cloud General Discussion
Justin, are you on a Mac by chance?  I recently observed an issue on Mac where it wasn't properly converting the module type which would cause it to get stuck here.  I need to try to debug that again because at the time I wasn't able to reproduce it.  If you are on a Mac (or even if you're not and it's the same core issue), I can give you a workaround to get past it while I continue to try to corner the problem.

I guess in the spirit of saving you time, I'll just give that workaround here now:
  1. Close down IntelliJ IDEA completely.
  2. Open your module's .iml file in an editor.
  3. In the line that looks like '<module type="JAVA_MODULE" version="4">', change "JAVA_MODULE" to "IlluminatedCloud" and save the file.
  4. Re-open your project in IntelliJ IDEA.
  5. It should be past the "module must have the Illuminated Cloud module type" and prompting you to do a few other things like set up a connection and generate the OST/SDK.  Once you click Resolve to allow it to do those, you should be in good shape.
Sorry for the need for such a manual workaround.  This is supposed to be a very automated, guided process, but evidently there's a bug with the module type change in certain environments.  I'll definitely work to get that resolved.

Regards,
Scott Wells

Scott

unread,
Nov 17, 2016, 10:30:06 AM11/17/16
to Illuminated Cloud General Discussion
Glad to hear on all counts!

Scott

unread,
Nov 17, 2016, 11:23:55 AM11/17/16
to Illuminated Cloud General Discussion
FYI, the "glad to hear" comment was in response to a direct message saying that the workaround was successful.  Also, I've managed to reproduce this problem and have a fix that I'm verifying now.  It should be included in the next release.

Regards,
Scott

besrour walid

unread,
Sep 8, 2023, 9:46:07 AM9/8/23
to Illuminated Cloud General Discussion, Scott
Hello 

IntelliJ project structure does not match Repo VS project salesforce, 
after downloading the project from GIT I can't connect to salesforce

Scott Wells

unread,
Sep 8, 2023, 9:48:41 AM9/8/23
to Illuminated Cloud General Discussion, besrour walid, Scott Wells
Hi. Regarding issues connecting to Salesforce, please start by making sure that you're on the latest v2 Salesforce CLI as there is a critical known issue right now with v1 CLI installs:


If after updating the CLI you still see these issues, please let me know the specifics so I can better understand what's going on and can assist with them.

Regards,
Scott Wells

besrour walid

unread,
Sep 8, 2023, 9:55:27 AM9/8/23
to Illuminated Cloud General Discussion, Scott Wells
I'm joining a new team using vscode.
the project is in git, in Vscode format, after I download the code I can't connect to salesforce

Capture d’écran 2023-09-08 155339.pngCapture d’écran 2023-09-08 155459.png

Scott Wells

unread,
Sep 8, 2023, 9:58:54 AM9/8/23
to Illuminated Cloud General Discussion, besrour walid, Scott Wells
Ah, I see. Because that's a source format project (as identified by the sfdx-project.json file and force-app directory), you must use a CLI-managed connection with it. If you create an OAuth connection to the same org, you will be able to associate it with that project:


Note that you must have the Salesforce CLI installed to use CLI-managed connections.

Please let me know if that doesn't resolve the issue for you.

Regards,
Scott Wells

besrour walid

unread,
Sep 8, 2023, 10:41:55 AM9/8/23
to Illuminated Cloud General Discussion, Scott Wells
thanks it is good
Reply all
Reply to author
Forward
0 new messages