MINA
  1. MINA
  2. DIRMINA-806

Maven dependencies for mina-integration-* for non-OSGi-users

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.8
    • Component/s: Integration
    • Labels:
      None

      Description

      I'm trying to follow the JMX-integration example in the users guide. When I add mina-integration-jmx as a dependency, I get unresolved dependencies such as mina-core-2.0.1.bundle.

      1. There are no such bundles in the central maven repository.
      2. If I define the dependencies explicitly and exclude the bundles like follows, everything works ok.

      --8<--
      <dependency>
      <groupId>org.apache.mina</groupId>
      <artifactId>mina-core</artifactId>
      <version>2.0.1</version>
      </dependency>
      <dependency>
      <groupId>org.apache.mina</groupId>
      <artifactId>mina-integration-beans</artifactId>
      <version>2.0.1</version>
      <exclusions>
      <exclusion>
      <groupId>org.apache.mina</groupId>
      <artifactId>mina-core</artifactId>
      </exclusion>
      </exclusions>
      </dependency>
      <dependency>
      <groupId>org.apache.mina</groupId>
      <artifactId>mina-integration-ognl</artifactId>
      <version>2.0.1</version>
      <exclusions>
      <exclusion>
      <groupId>org.apache.mina</groupId>
      <artifactId>mina-core</artifactId>
      </exclusion>
      <exclusion>
      <groupId>org.apache.mina</groupId>
      <artifactId>mina-integration-beans</artifactId>
      </exclusion>
      </exclusions>
      </dependency>
      <dependency>
      <groupId>org.apache.mina</groupId>
      <artifactId>mina-integration-jmx</artifactId>
      <version>2.0.1</version>
      <exclusions>
      <exclusion>
      <groupId>org.apache.mina</groupId>
      <artifactId>mina-core</artifactId>
      </exclusion>
      <exclusion>
      <groupId>org.apache.mina</groupId>
      <artifactId>mina-integration-beans</artifactId>
      </exclusion>
      <exclusion>
      <groupId>org.apache.mina</groupId>
      <artifactId>mina-integration-ognl</artifactId>
      </exclusion>
      </exclusions>
      </dependency>
      --8<--

      Is this behavior intentional? If so, how do I use these dependencies in an non-OSGi environment and where do I get them from?

        Activity

        Hide
        Emmanuel Lecharny added a comment -

        can you add :

        <type>bundle</type>

        in your dependencies, and remove the exclusions, to see if it works better ?

        Show
        Emmanuel Lecharny added a comment - can you add : <type>bundle</type> in your dependencies, and remove the exclusions, to see if it works better ?
        Hide
        Thomas Vandahl added a comment -

        No it doesn't. My maven does not resolve bundle-dependencies at all (no maven-bundle-plugin). Mind you: I have no OSGi-environment whatsoever.

        Show
        Thomas Vandahl added a comment - No it doesn't. My maven does not resolve bundle-dependencies at all (no maven-bundle-plugin). Mind you: I have no OSGi-environment whatsoever.
        Hide
        Emmanuel Lecharny added a comment -

        Which Maven version are you using ?

        Show
        Emmanuel Lecharny added a comment - Which Maven version are you using ?
        Hide
        Thomas Vandahl added a comment -

        2.2.1

        We use an Archiva 1.3 instance as our local repository manager and central-proxy if that matters.

        Show
        Thomas Vandahl added a comment - 2.2.1 We use an Archiva 1.3 instance as our local repository manager and central-proxy if that matters.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Adding this in your project (or parent) pom.xml should solve the issue:
        =========================================
        <build>
        <plugins>
        <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        </configuration>
        </plugin>
        </plugins>
        </build>
        =========================================

        Show
        Pierre-Arnaud Marcelot added a comment - Adding this in your project (or parent) pom.xml should solve the issue: ========================================= <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> </configuration> </plugin> </plugins> </build> =========================================
        Hide
        Pierre-Arnaud Marcelot added a comment -

        I think the 'maven-bundle-plugin' specifies that the 'bundle' packaging/type generates artifact files which end with a '.jar' extension instead of a '.bundle' extension.

        Show
        Pierre-Arnaud Marcelot added a comment - I think the 'maven-bundle-plugin' specifies that the 'bundle' packaging/type generates artifact files which end with a '.jar' extension instead of a '.bundle' extension.
        Hide
        Thomas Vandahl added a comment -

        So, basically you are telling me that I need a separate Maven plugin to be able to use MINA as a dependency? Really?

        Show
        Thomas Vandahl added a comment - So, basically you are telling me that I need a separate Maven plugin to be able to use MINA as a dependency? Really?
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Yes, indeed.
        I'm not saying it's a good thing, though.

        On the other hand, adding this plugin to your build doesn't do much except solving the dependency resolving issue.

        Show
        Pierre-Arnaud Marcelot added a comment - Yes, indeed. I'm not saying it's a good thing, though. On the other hand, adding this plugin to your build doesn't do much except solving the dependency resolving issue.
        Hide
        Emmanuel Lecharny added a comment -

        Postponed

        Show
        Emmanuel Lecharny added a comment - Postponed
        Hide
        Haug Bürger added a comment -

        This hack of my pom solved the issue. Am I the only one who thinks that maven creates more issues than it solves?
        ...
        <dependency>
        <groupId>org.apache.mina</groupId>
        <artifactId>mina-core</artifactId>
        <version>2.0.1</version>
        </dependency>
        <dependency>
        <groupId>org.apache.mina</groupId>
        <artifactId>mina-integration-beans</artifactId>
        <version>2.0.1</version>
        <!-- The mina-integration-beans has a bundle dependency which does not work for me -->
        <exclusions>
        <exclusion>
        <groupId>org.apache.mina</groupId>
        <artifactId>mina-core</artifactId>
        </exclusion>
        </exclusions>
        </dependency>
        ...

        Show
        Haug Bürger added a comment - This hack of my pom solved the issue. Am I the only one who thinks that maven creates more issues than it solves? ... <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-core</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-integration-beans</artifactId> <version>2.0.1</version> <!-- The mina-integration-beans has a bundle dependency which does not work for me --> <exclusions> <exclusion> <groupId>org.apache.mina</groupId> <artifactId>mina-core</artifactId> </exclusion> </exclusions> </dependency> ...
        Hide
        Thomas Vandahl added a comment -

        A probably related issue:

        I added the Maven bundle plugin to resolve the dependencies. However my primary artifact type is WAR and the current maven-war-plugin does not package dependencies of "bundle"-type into the war. Any ideas?

        Show
        Thomas Vandahl added a comment - A probably related issue: I added the Maven bundle plugin to resolve the dependencies. However my primary artifact type is WAR and the current maven-war-plugin does not package dependencies of "bundle"-type into the war. Any ideas?

          People

          • Assignee:
            Unassigned
            Reporter:
            Thomas Vandahl
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development