Giter Site home page Giter Site logo

bazel-simple-app's Introduction

Manually creating a Dep Graph from Bazel Java project

Intro

As you know, Bazel requires listing all project's dependencies explicitly, even transitive ones. Hence, Bazel project's Dep Graph will look like a flat list of dependencies.

Building a Dep Graph

To create a Dep Graph let's first list all of project's dependencies. List can be found in 3rdparty/java_deps.bzl. From URLs to Maven Central we can understand all of our list:

com.google.inject:[email protected]
org.sonatype.sisu.inject:[email protected]
javax.inject:javax.inject@1
aopalliance:[email protected]
org.codehaus.mojo:[email protected]
com.google.code.findbugs:[email protected]
com.google.errorprone:[email protected]
com.google.guava:[email protected]
com.google.guava:[email protected]
com.google.guava:[email protected]
org.checkerframework:[email protected]
com.google.j2objc:[email protected]

Now, create a JSON object like dep-graph.json (https://github.com/snyk/bazel-simple-app/blob/master/dep-graph.json)

Object's schema can be found here https://github.com/snyk/dep-graph#depgraphdata

  1. schemaVersion use 1.2.0 (internal versioning)
  2. pkgManager.name one of deb, gomodules, gradle, maven, pip, rpm, rubygems, cocoapods
  3. pkgs - JSON array of all packages in the Dep Graph. Fill it with data from the list above including ROOT NODE (name of your project).
  4. graph - should contain relationships between graph nodes. In Bazel case there is 1 relationship - root node to all of it dependencies. Fill up deps accordingly to example.

Send dep graph to Snyk API

Explore this blog post on how to use the dep graph you've just build with Snyk API in order for your projects to get tested for vulnerabilities and be secured
https://support.snyk.io/hc/en-us/articles/360011549737

bazel-simple-app's People

Contributors

dkontorovskyy avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.