当maven-bundle-plugin部署它时,OSGI示例失败

时间:2014-04-11 20:28:28

标签: maven osgi apache-felix maven-bundle-plugin

我正在研究“OSGi和Apache Felix 3.0”一书中的一个例子。在maven部署阶段,它失败并显示以下消息:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project bookshelf-inventory-api: 
Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed: 
Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: 
The repository system is offline but the artifact org.codehaus.plexus:plexus-utils:jar:1.5.6 is not available in the local repository.

这告诉我什么,是否有解决办法?

这是我的pom.xml:

<groupId>osgi.example</groupId>
  <artifactId>bookshelf-inventory-api</artifactId>
  <version>1.0.0</version>

  <packaging>bundle</packaging>

  <dependencies>
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>maven-bundle-plugin</artifactId>
      <version>2.4.0</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.4.0</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-Category>inventory</Bundle-Category>
            <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
            <Export-Package>osgi.example.bookshelf.inventory.api</Export-Package>
          </instructions>
          <remoteOBR>repo-rel</remoteOBR>
          <prefixUrl>file:///C:/home/src/demo/osgi/felix-3-book/releases</prefixUrl>
          <ignoreLock>true</ignoreLock>
          <!--
          <instructions>
            <Private-Package>org.foo.myproject.*</Private-Package>
            <Bundle-Activator>org.foo.myproject.impl1.Activator</Bundle-Activator>
          </instructions>
          -->
        </configuration>
      </plugin>
    </plugins>
  </build>
  <distributionManagement>
    <!-- releases repo -->
    <repository>
      <id>repo-rel</id>
      <url>file:///C:/home/src/demo/osgi/felix-3-book/releases</url>
    </repository>
  </distributionManagement>
   <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

1 个答案:

答案 0 :(得分:1)

消息说您正在尝试以脱机模式(-o)构建,并且存在无法找到的依赖项:org.codehaus.plexus:plexus-utils:jar:1.5.6

如果不是这种情况并且您在线收到此消息,请尝试删除〜/ .m2 / org / codehaus / plexus并重试。也许文件下载时有错误。