Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to import semanticcpg functionality into my project? #1797

Open
simkoc opened this issue Dec 23, 2024 · 4 comments
Open

How to import semanticcpg functionality into my project? #1797

simkoc opened this issue Dec 23, 2024 · 4 comments

Comments

@simkoc
Copy link

simkoc commented Dec 23, 2024

Based on the README it seems that it is sufficient to just add a single import to my build.sbt

libraryDependencies += "io.shiftleft" %% "codepropertygraph" % "x.y.z"

as you later import the semanticcpg in your example

import io.shiftleft.semanticcpg.language._

However, there is no such package if I only use the initial import. Looking into maven central, it also seems that semanticcpg has not been updated since 2022, and it is stuck at version 1.3.522? Did you discontinue this package, and if so where did this functionality move to?

@mpollmeier
Copy link
Contributor

semanticcpg moved over to https://github.com/joernio/joern quite a while ago - sorry for the outdated references in the readme

@simkoc
Copy link
Author

simkoc commented Dec 23, 2024

How do I import it then? Or did it move to an entirely different package?

@itsacoderepo
Copy link
Contributor

There is the 2024 joern version on maven

Screenshot 2024-12-23 at 22 44 05

The latest version is: https://mvnrepository.com/artifact/io.joern/semanticcpg_3/4.0.183

Using the dependencies can be done with:

// https://mvnrepository.com/artifact/io.joern/semanticcpg
libraryDependencies += "io.joern" %% "semanticcpg" % "4.0.183"

Importing and subsequent usage via:

import io.shiftleft.semanticcpg.language._

@simkoc
Copy link
Author

simkoc commented Dec 24, 2024

Thank you very much for the swift response. One final, related question. What is the difference between the io.shiftleft and io.joern dependencies? Both are seemingly still maintained and updated. Yet, there is a vast difference in the version numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants