Directory Shared (Please use DIRAPI instead)
  1. Directory Shared (Please use DIRAPI instead)
  2. DIRSHARED-134

Missing artifact org.apache.directory.jdbm:apacheds-jdbm2:bundle:2.0.0-M1 when depending on apacheds-server-jndi

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-M11
    • Fix Version/s: 1.0.0-M12
    • Component/s: None
    • Labels:
      None

      Description

      Missing artifact org.apache.directory.jdbm:apacheds-jdbm2:bundle:2.0.0-M1 when depending on :

      <dependency>
      <groupId>org.apache.directory.server</groupId>
      <artifactId>apacheds-server-jndi</artifactId>
      <version>2.0.0-M6</version>
      </dependency>

      It should transitively depend on a "jar" type, not a bundle.

        Activity

        Hide
        Robert Kanter added a comment -

        Hmmm. I just tried adding that and now it works. I'm certain I tried that before, but maybe there was something else that I did since then as well that was necessary. Thanks.

        Though it appears that any project using my artifact now has to include the maven-bundle-plugin too, which is a little unfortunate.

        Show
        Robert Kanter added a comment - Hmmm. I just tried adding that and now it works. I'm certain I tried that before, but maybe there was something else that I did since then as well that was necessary. Thanks. Though it appears that any project using my artifact now has to include the maven-bundle-plugin too, which is a little unfortunate.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Hi Robert,

        Did you try the advice I gave in the first comment?
        Adding the 'org.apache.felix:maven-bundle-plugin' plugin should do the trick.

        <build>
        <plugins>
        [...]
        <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <inherited>true</inherited>
        <extensions>true</extensions>
        </plugin>
        [...]
        </plugins>
        </build>
        
        Show
        Pierre-Arnaud Marcelot added a comment - Hi Robert, Did you try the advice I gave in the first comment? Adding the 'org.apache.felix:maven-bundle-plugin' plugin should do the trick. <build> <plugins> [...] <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <inherited> true </inherited> <extensions> true </extensions> </plugin> [...] </plugins> </build>
        Hide
        Robert Kanter added a comment -

        I know this was last updated a long time ago, but I'm having the same issue but with the apacheds-jdbm1 artifact when I try to include a dependency on either of these:

            <dependency>
              <groupId>org.apache.directory.server</groupId>
              <artifactId>apacheds-jdbm-partition</artifactId>
              <version>2.0.0-M15</version>
              <scope>compile</scope>
            </dependency>
            <dependency>
              <groupId>org.apache.directory.server</groupId>
              <artifactId>apacheds-protocol-ldap</artifactId>
              <version>2.0.0-M15</version>
              <scope>compile</scope>
            </dependency>
        

        Maven is unable to find org.apache.directory.jdbm:apacheds-jdbm1:bundle:2.0.0-M2

        I tried adding the maven-bundle-plugin like in the first comment, but that didn't make a difference. I went and looked in the repository itself, and didn't see any kind of "bundle" thing.

        In the meantime, I found a workaround here where you basically exclude the apaches-jdbm1 dependency from anything that tries to pull it in, and then explicitly add it as a dependency, but using version 2.0.0-M3-SNAPSHOT instead of 2.0.0-M2, which doesn't use a bundle type:

            <dependency>
                <groupId>org.apache.directory.jdbm</groupId>
                <artifactId>apacheds-jdbm1</artifactId>
                <version>2.0.0-M3-SNAPSHOT</version>
              <scope>compile</scope>
            </dependency>
        

        While this seems to be working as far as I can tell, it would be better if I didn't have to mix versions.

        Can you check that the artifact is being properly published?

        Show
        Robert Kanter added a comment - I know this was last updated a long time ago, but I'm having the same issue but with the apacheds-jdbm1 artifact when I try to include a dependency on either of these: <dependency> <groupId> org.apache.directory.server </groupId> <artifactId> apacheds-jdbm-partition </artifactId> <version> 2.0.0-M15 </version> <scope> compile </scope> </dependency> <dependency> <groupId> org.apache.directory.server </groupId> <artifactId> apacheds-protocol-ldap </artifactId> <version> 2.0.0-M15 </version> <scope> compile </scope> </dependency> Maven is unable to find org.apache.directory.jdbm:apacheds-jdbm1:bundle:2.0.0-M2 I tried adding the maven-bundle-plugin like in the first comment, but that didn't make a difference. I went and looked in the repository itself, and didn't see any kind of "bundle" thing. In the meantime, I found a workaround here where you basically exclude the apaches-jdbm1 dependency from anything that tries to pull it in, and then explicitly add it as a dependency, but using version 2.0.0-M3-SNAPSHOT instead of 2.0.0-M2 , which doesn't use a bundle type: <dependency> <groupId> org.apache.directory.jdbm </groupId> <artifactId> apacheds-jdbm1 </artifactId> <version> 2.0.0-M3-SNAPSHOT </version> <scope> compile </scope> </dependency> While this seems to be working as far as I can tell, it would be better if I didn't have to mix versions. Can you check that the artifact is being properly published?
        Hide
        Pierre-Arnaud Marcelot added a comment -

        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD SUCCESS
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 17:40.704s
        [INFO] Finished at: Mon Mar 26 14:00:18 CEST 2012
        [INFO] Final Memory: 65M/149M
        [INFO] ------------------------------------------------------------------------

        What Maven/JVM versions are you using?

        Show
        Pierre-Arnaud Marcelot added a comment - [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 17:40.704s [INFO] Finished at: Mon Mar 26 14:00:18 CEST 2012 [INFO] Final Memory: 65M/149M [INFO] ------------------------------------------------------------------------ What Maven/JVM versions are you using?
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Hi Hendy,

        It's weird you are not able to build ApacheDS. We're constantly building it ourselves (on our machines and our CI builds).
        I just dropped my entire Maven repository and I'm currently running a fresh build to see if it fails.

        IIRC, I added the "type" information on the dependencies because the build would not be successful without it (but I can't remember the exact error).

        I'm going to review this and see if we can really get rid of this. I'm afraid it was added there for a reason, but if we can remove it, we'll do it.

        Show
        Pierre-Arnaud Marcelot added a comment - Hi Hendy, It's weird you are not able to build ApacheDS. We're constantly building it ourselves (on our machines and our CI builds). I just dropped my entire Maven repository and I'm currently running a fresh build to see if it fails. IIRC, I added the "type" information on the dependencies because the build would not be successful without it (but I can't remember the exact error). I'm going to review this and see if we can really get rid of this. I'm afraid it was added there for a reason, but if we can remove it, we'll do it.
        Hide
        Hendy Irawan added a comment -

        Trying to compare, Apache Felix is a OSGi-intensive project that builds all its artifacts as packaging=bundle. However for dependencies they don't use type=bundle.

        e.g. http://svn.apache.org/repos/asf/felix/trunk/webconsole/pom.xml

        which depends (among others):

        <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.shell</artifactId>
        <version>1.0.0</version>
        <scope>provided</scope>
        </dependency>

        both webconsole and org.apache.felix.shell are OSGi bundles but in dependency it doesn't specify type=bundle.

        Show
        Hendy Irawan added a comment - Trying to compare, Apache Felix is a OSGi-intensive project that builds all its artifacts as packaging=bundle. However for dependencies they don't use type=bundle. e.g. http://svn.apache.org/repos/asf/felix/trunk/webconsole/pom.xml which depends (among others): <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.shell</artifactId> <version>1.0.0</version> <scope>provided</scope> </dependency> both webconsole and org.apache.felix.shell are OSGi bundles but in dependency it doesn't specify type=bundle.
        Hide
        Hendy Irawan added a comment -

        Thank you Pierre-Arnaud.

        I tried building ApacheDS trunk itself and as it currently stands, I cannot build it without commenting the type=bundle lines.

        Is there something special I should do with the apacheds sources in order to build it using Maven ?

        What side effect will happen if I comment the type=bundle lines in the <dependency> elements ?

        ceefour@annafi:~/vendor_dev/apacheds$ mvn install -DskipTests
        [INFO] Scanning for projects...
        [ERROR] The build could not read 3 projects -> [Help 1]
        [ERROR]   
        [ERROR]   The project org.apache.directory.server:apacheds-all:2.0.0-M7-SNAPSHOT (/home/ceefour/vendor_dev/apacheds/all/pom.xml) has 1 error
        [ERROR]     'dependencies.dependency.version' for org.apache.directory.jdbm:apacheds-jdbm2:bundle is missing. @ line 74, column 17
        [ERROR]   
        [ERROR]   The project org.apache.directory.server:apacheds-jdbm-partition:2.0.0-M7-SNAPSHOT (/home/ceefour/vendor_dev/apacheds/jdbm-partition/pom.xml) has 1 error
        [ERROR]     'dependencies.dependency.version' for org.apache.directory.jdbm:apacheds-jdbm2:bundle is missing. @ line 58, column 17
        [ERROR]   
        [ERROR]   The project org.apache.directory.server:apacheds-protocol-ldap:2.0.0-M7-SNAPSHOT (/home/ceefour/vendor_dev/apacheds/protocol-ldap/pom.xml) has 1 error
        [ERROR]     'dependencies.dependency.version' for org.apache.directory.jdbm:apacheds-jdbm2:bundle is missing. @ line 61, column 17
        [ERROR] 
        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
        [ERROR] 
        [ERROR] For more information about the errors and possible solutions, please read the following articles:
        [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
        ceefour@annafi:~/vendor_dev/apacheds$ nano all/pom.xml 
        ceefour@annafi:~/vendor_dev/apacheds$ mvn install -DskipTests
        [INFO] Scanning for projects...
        [ERROR] The build could not read 2 projects -> [Help 1]
        [ERROR]   
        [ERROR]   The project org.apache.directory.server:apacheds-jdbm-partition:2.0.0-M7-SNAPSHOT (/home/ceefour/vendor_dev/apacheds/jdbm-partition/pom.xml) has 1 error
        [ERROR]     'dependencies.dependency.version' for org.apache.directory.jdbm:apacheds-jdbm2:bundle is missing. @ line 58, column 17
        [ERROR]   
        [ERROR]   The project org.apache.directory.server:apacheds-protocol-ldap:2.0.0-M7-SNAPSHOT (/home/ceefour/vendor_dev/apacheds/protocol-ldap/pom.xml) has 1 error
        [ERROR]     'dependencies.dependency.version' for org.apache.directory.jdbm:apacheds-jdbm2:bundle is missing. @ line 61, column 17
        [ERROR] 
        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
        [ERROR] 
        [ERROR] For more information about the errors and possible solutions, please read the following articles:
        [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
        ceefour@annafi:~/vendor_dev/apacheds$ nano jdbm-partition/pom.xml 
        ceefour@annafi:~/vendor_dev/apacheds$ mvn install -DskipTests
        [INFO] Scanning for projects...
        [ERROR] The build could not read 1 project -> [Help 1]
        [ERROR]   
        [ERROR]   The project org.apache.directory.server:apacheds-protocol-ldap:2.0.0-M7-SNAPSHOT (/home/ceefour/vendor_dev/apacheds/protocol-ldap/pom.xml) has 1 error
        [ERROR]     'dependencies.dependency.version' for org.apache.directory.jdbm:apacheds-jdbm2:bundle is missing. @ line 61, column 17
        [ERROR] 
        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
        [ERROR] 
        [ERROR] For more information about the errors and possible solutions, please read the following articles:
        [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
        ceefour@annafi:~/vendor_dev/apacheds$ nano protocol-ldap/pom.xml 
        ceefour@annafi:~/vendor_dev/apacheds$ mvn install -DskipTests
        [INFO] Scanning for projects...
        [INFO] ------------------------------------------------------------------------
        [INFO] Reactor Build Order:
        [INFO] 
        [INFO] ApacheDS
        [INFO] ApacheDS I18n
        [INFO] ApacheDS Core Constants
        [INFO] ApacheDS Core API
        ...
        
        Show
        Hendy Irawan added a comment - Thank you Pierre-Arnaud. I tried building ApacheDS trunk itself and as it currently stands, I cannot build it without commenting the type=bundle lines. Is there something special I should do with the apacheds sources in order to build it using Maven ? What side effect will happen if I comment the type=bundle lines in the <dependency> elements ? ceefour@annafi:~/vendor_dev/apacheds$ mvn install -DskipTests [INFO] Scanning for projects... [ERROR] The build could not read 3 projects -> [Help 1] [ERROR] [ERROR] The project org.apache.directory.server:apacheds-all:2.0.0-M7-SNAPSHOT (/home/ceefour/vendor_dev/apacheds/all/pom.xml) has 1 error [ERROR] 'dependencies.dependency.version' for org.apache.directory.jdbm:apacheds-jdbm2:bundle is missing. @ line 74, column 17 [ERROR] [ERROR] The project org.apache.directory.server:apacheds-jdbm-partition:2.0.0-M7-SNAPSHOT (/home/ceefour/vendor_dev/apacheds/jdbm-partition/pom.xml) has 1 error [ERROR] 'dependencies.dependency.version' for org.apache.directory.jdbm:apacheds-jdbm2:bundle is missing. @ line 58, column 17 [ERROR] [ERROR] The project org.apache.directory.server:apacheds-protocol-ldap:2.0.0-M7-SNAPSHOT (/home/ceefour/vendor_dev/apacheds/protocol-ldap/pom.xml) has 1 error [ERROR] 'dependencies.dependency.version' for org.apache.directory.jdbm:apacheds-jdbm2:bundle is missing. @ line 61, column 17 [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch . [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http: //cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException ceefour@annafi:~/vendor_dev/apacheds$ nano all/pom.xml ceefour@annafi:~/vendor_dev/apacheds$ mvn install -DskipTests [INFO] Scanning for projects... [ERROR] The build could not read 2 projects -> [Help 1] [ERROR] [ERROR] The project org.apache.directory.server:apacheds-jdbm-partition:2.0.0-M7-SNAPSHOT (/home/ceefour/vendor_dev/apacheds/jdbm-partition/pom.xml) has 1 error [ERROR] 'dependencies.dependency.version' for org.apache.directory.jdbm:apacheds-jdbm2:bundle is missing. @ line 58, column 17 [ERROR] [ERROR] The project org.apache.directory.server:apacheds-protocol-ldap:2.0.0-M7-SNAPSHOT (/home/ceefour/vendor_dev/apacheds/protocol-ldap/pom.xml) has 1 error [ERROR] 'dependencies.dependency.version' for org.apache.directory.jdbm:apacheds-jdbm2:bundle is missing. @ line 61, column 17 [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch . [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http: //cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException ceefour@annafi:~/vendor_dev/apacheds$ nano jdbm-partition/pom.xml ceefour@annafi:~/vendor_dev/apacheds$ mvn install -DskipTests [INFO] Scanning for projects... [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project org.apache.directory.server:apacheds-protocol-ldap:2.0.0-M7-SNAPSHOT (/home/ceefour/vendor_dev/apacheds/protocol-ldap/pom.xml) has 1 error [ERROR] 'dependencies.dependency.version' for org.apache.directory.jdbm:apacheds-jdbm2:bundle is missing. @ line 61, column 17 [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch . [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http: //cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException ceefour@annafi:~/vendor_dev/apacheds$ nano protocol-ldap/pom.xml ceefour@annafi:~/vendor_dev/apacheds$ mvn install -DskipTests [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] ApacheDS [INFO] ApacheDS I18n [INFO] ApacheDS Core Constants [INFO] ApacheDS Core API ...
        Hide
        Pierre-Arnaud Marcelot added a comment -

        No, it isn't possible as the JDBM project is built as an OSGI bundle, thus the 'bundle' type.

        All our Shared/API modules are already built as bundles and all ApacheDS modules will be built as OSGI bundles soon too (they already are in some of our branches).

        It's as simple as adding the above 6 lines of codes and it shouldn't affect your build in any other way than making sure Maven knows about the 'bundle' type.

        Show
        Pierre-Arnaud Marcelot added a comment - No, it isn't possible as the JDBM project is built as an OSGI bundle, thus the 'bundle' type. All our Shared/API modules are already built as bundles and all ApacheDS modules will be built as OSGI bundles soon too (they already are in some of our branches). It's as simple as adding the above 6 lines of codes and it shouldn't affect your build in any other way than making sure Maven knows about the 'bundle' type.
        Hide
        Hendy Irawan added a comment -

        I'm thinking this is the root issue :

        http://svn.apache.org/repos/asf/directory/apacheds/trunk/pom.xml

        These lines :

        <dependency>
        <groupId>org.apache.directory.jdbm</groupId>
        <artifactId>apacheds-jdbm2</artifactId>
        <type>bundle</type>
        <version>$

        {org.apache.directory.jdbm.version}

        </version>
        </dependency>

        Is it possible to simply remove the <type>bundle</type> line ? All other dependencies do not specify type=bundle, I hope it should work without type=bundle.

        Show
        Hendy Irawan added a comment - I'm thinking this is the root issue : http://svn.apache.org/repos/asf/directory/apacheds/trunk/pom.xml These lines : <dependency> <groupId>org.apache.directory.jdbm</groupId> <artifactId>apacheds-jdbm2</artifactId> <type>bundle</type> <version>$ {org.apache.directory.jdbm.version} </version> </dependency> Is it possible to simply remove the <type>bundle</type> line ? All other dependencies do not specify type=bundle, I hope it should work without type=bundle.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Actually you simply need to add the following lines to your parent/project pom:
        <build>
        <plugins>
        [...]
        <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <inherited>true</inherited>
        <extensions>true</extensions>
        </plugin>
        [...]
        </plugins>
        </build>

        It will help recognize the 'bundle' type we use when building the JDBM projects.

        Show
        Pierre-Arnaud Marcelot added a comment - Actually you simply need to add the following lines to your parent/project pom: <build> <plugins> [...] <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <inherited>true</inherited> <extensions>true</extensions> </plugin> [...] </plugins> </build> It will help recognize the 'bundle' type we use when building the JDBM projects.

          People

          • Assignee:
            Pierre-Arnaud Marcelot
            Reporter:
            Hendy Irawan
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development