2015-07-20 53 views
1

我一直在这个问题上读了几个小时,但没有成功。
这里是我的情况:git包括从另一个存储库编译的dll

项目A的输出被编译的dll文件女巫在其他项目上
多的人对项目的工作使用
项目A有自己的仓库,让它repoA
我的名字不能在其他项目中包含该项目的源代码,我只能使用它的编译后的dll。

项目B是repoB一个Web应用程序
多的人对项目B工作

所有项目都在同一台机器上(本地服务器)

那么,如何可以包括从repoA的dll进入所有其他项目(repoB ... repoZ),并在repoA更新时保持最新。

我使用VS2013和msysGit

回答

1

二进制依赖是最好的管理:

  • 在不同的参考(different from a source control referential):如Nexus的artificat参考最好
  • pom.xml文件(包括在其他项目中),以声明您需要的依赖关系(这样,每次在其他项目中开始构建时,都会从Nexus获得依赖关系)

请参阅“The Basics - Components, Repositories and Repository Formats”。

我使用这种方法对所有类型的项目(不只是Java的Maven项目)

ant -f %BUILD_SCRIPTS_DIRECTORY%\build.xml -lib Build\antlib dependencies 

随着build.xml像:

<project name="aname" default="help" xmlns:artifact="antlib:org.apache.maven.artifact.ant"> 

    <taskdef resource="net/sf/antcontrib/antlib.xml"/> 

    <target name="dependencies" description="resolve dependencies" unless="run.test"> 
     <artifact:pom id="pom" file="pom.xml" /> 
     <artifact:dependencies filesetId="dep.builder" pomRefId="pom"/> 
     <delete dir="${pom.build.directory}"/> 
     <unzip dest="${pom.build.directory}" overwrite="true"> 
      <fileset refid="dep.builder"/> 
     </unzip>    
    </target> 

</project> 

而一个pom.xml声明的依赖关系,如:

<dependencies> 
    <dependency>   
     <groupId>com.oracle.www</groupId> 
     <artifactId>oci</artifactId> 
     <version>10</version> 
     <type>zip</type> 
     <classifier>${targetplatform}</classifier> 
    </dependency> 
    <dependency>     
     <groupId>com.sophis.www</groupId> 
     <artifactId>stlport</artifactId> 
     <version>5.1</version> 
     <type>zip</type> 
     <classifier>${targetplatform}</classifier> 
    </dependency> 
    ... 
</dependencies> 
相关问题