Question

I'm working through an example in the book "OSGi and Apache Felix 3.0". During the maven deploy phase it fails with this message:

[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.

What is this telling me and is there a work-around?

Here is my 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>
Was it helpful?

Solution

The message is saying that you are trying to build in offline mode (-o) and there are a dependency that couldn't be found: org.codehaus.plexus:plexus-utils:jar:1.5.6

if is not the case and you are online getting this message, try to remove the ~/.m2/org/codehaus/plexus and try again. maybe the file was downloaded with errors.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top