简体   繁体   中英

How a project java based on Maven can include a package source from a private git repository

I have a java project based on Maven and I would like to use some classes (source generated from proto files) present on a remote private GIT repository:

The remote repository is not a Maven project and it has a structure like this

   root
    | folder1
        | .....
      folder2
        | .....
      folder3
        | .....
      targer
        | swift
          cpp
          java
             | com
                 |example
                     | test
                          FileGenerated1.Java
                          FileGenerated2.Java
                          FileGenerated3.Java

I would like to include that java package (com.example.test) in my project. I'm not a Maven expert. Can you tell me what should be the best practice?

Thank you for your help.

So, if the project is not a maven project then straightforward solution is to use soft links but that could be os dependent eg windows might not support these. But if you got a soft link to the package in your maven project these files would be accessible properly and also for any changes you make to these files would directly reflect in your original local repo and hence easy to use.

Remember that soft link should be relative so that it works of all different machines.

there are plenty of link on how to create relative soft links. One is https://askubuntu.com/questions/56339/how-to-create-a-soft-or-symbolic-link?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM