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

The transitive dependency which has a version variable won't be generated #91

Closed
GinFungYJF opened this issue Oct 27, 2017 · 4 comments
Closed

Comments

@GinFungYJF
Copy link
Contributor

For example, the properties and dependencies in the pom.xml of artifact com.google.inject:guice:3.0 are:

<properties>
    <cglib.version>2.2.1-v20090111</cglib.version>
</properties>
<dependencies>
    <dependency>
      <groupId>javax.inject</groupId>
      <artifactId>javax.inject</artifactId>
      <version>1</version>
    </dependency>
    <dependency>
      <groupId>aopalliance</groupId>
      <artifactId>aopalliance</artifactId>
      <version>1.0</version>
    </dependency>
    <!--
     | Replace with official CGLIB artifact when it's released
    -->
    <dependency>
      <groupId>org.sonatype.sisu.inject</groupId>
      <artifactId>cglib</artifactId>
      <version>${cglib.version}</version>
    </dependency>
    <dependency>
      <groupId>javax.inject</groupId>
      <artifactId>javax.inject-tck</artifactId>
      <version>1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>3.0.5.RELEASE</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>biz.aQute</groupId>
      <artifactId>bnd</artifactId>
      <version>0.0.384</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.framework</artifactId>
      <version>3.0.5</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

Then only add the com.google.inject:guice:3.0 to the dependencies.yaml and run bazel-deps. However, it will only generate three dependencies without artifact org.sonatype.sisu.inject:cglib:2.2.1-v20090111.

def maven_dependencies(callback = declare_maven):
    callback({"artifact": "aopalliance:aopalliance:1.0", "lang": "java", "sha1": "0235ba8b489512805ac13a8f9ea77a1ca5ebe3e8", "repository": "http://szxy1.artifactory.cd-cloud-artifact.tools.huawei.com/artifactory/third-party-maven/", "name": "aopalliance_aopalliance", "actual": "@aopalliance_aopalliance//jar", "bind": "jar/aopalliance/aopalliance"})
    callback({"artifact": "com.google.inject:guice:3.0", "lang": "java", "sha1": "9d84f15fe35e2c716a02979fb62f50a29f38aefa", "repository": "http://szxy1.artifactory.cd-cloud-artifact.tools.huawei.com/artifactory/third-party-maven/", "name": "com_google_inject_guice", "actual": "@com_google_inject_guice//jar", "bind": "jar/com/google/inject/guice"})
    callback({"artifact": "javax.inject:javax.inject:1", "lang": "java", "sha1": "6975da39a7040257bd51d21a231b76c915872d38", "repository": "http://szxy1.artifactory.cd-cloud-artifact.tools.huawei.com/artifactory/third-party-maven/", "name": "javax_inject_javax_inject", "actual": "@javax_inject_javax_inject//jar", "bind": "jar/javax/inject/javax_inject"})
@johnynek
Copy link
Collaborator

johnynek commented Oct 27, 2017 via email

@GinFungYJF
Copy link
Contributor Author

I mean artifact org.sonatype.sisu.inject:cglib:2.2.1-v20090111 doesn't be generated, and it isn't a test scope dependency.

@johnynek
Copy link
Collaborator

I wonder if it is the variable substitution that is failing. It would be nice to make a test case and work on it. Honestly the maven resolution is not tested very well sadly.

@GinFungYJF
Copy link
Contributor Author

After debugging, I found that the maven resolution thinks that the artifact org.sonatype.sisu.inject:cglib:2.2.1-v20090111 is an optional dependency because it is declared as an optional dependency in an activated profile in the pom.xml. As a result the tool doesn't generated it. So close this issue.

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

2 participants