title: How to configure github action to compile with maven with dependency to other private repository?
body: <p>I have two repositories with Java Maven projects in it:</p>
  
  <ul>
  <li>one containing projects with core functionality, only dependencies on other projects in it or dependencies on public libraries</li>
  <li>one containing projekcts with dependendies on some of the projects in the first repository</li>
  </ul>
  
  <p>I've set a Github Action to compile each repository with maven on pull. For the first this works without issue. For the second one this doesn't work because the projects of the first repository aren't available to maven in the environment when building the second one.</p>
  
  <p>I've had two ideas to solve this issue</p>
  
  <ul>
  <li>Create a submodule in the second repository to include the first one</li>
  <li>Additionally check out the first repository in the build of the first one</li>
  </ul>
  
  <p>Both solutions would probably work but would end up needing all the build time to build the first repository additionally.</p>
  
  <p>This is the Github action (currently same in both repositories):</p>
  
  <pre><code>name: Java CI
  on: [push]
  jobs:
    build:
      runs-on: ubuntu-latest
      steps:
      - uses: actions/checkout@v1
      - name: Set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - name: Build with Maven
        run: mvn package --file pom.xml
  </code></pre>
  
  <p>Is there some way to use the build of the first repository in the second repository without building it againg?</p>
  
  <p>I suppose that this is'nt a unique problem and there must be a best practise solution.</p>