昨晚编译ODL项目时,又遇到了一次在生成karaf distribution时odl-yangtools-common这个feature被反复拉取的情况,导致无 法生成最终的发行版,费劲周张后,想起来自己大半年前就遇到过此问题并予以解决,故记录于此。

如下为生成karaf distribution的pom.xml片段,在plugin这里,一定要控制karaf-maven-plugin这个artifact要用3.0.1 的版本,odlparent里做了设置,但我的distribution并未依赖该parent,而导致此问题又一次遇到。

<plugins>
  <plugin>
    <groupId>org.apache.karaf.tooling</groupId>
    <artifactId>karaf-maven-plugin</artifactId>
     <!-- NOTE:
      finnaly pindown what cause karaf maven plugin
      using 3.0.3, in odlparent, it use karaf.maven.plugin 3.0.1.
      Wrongly set this cause build loop...
    <version>${karaf.version}</version>
    -->
    <version>3.0.1</version>
    <extensions>true</extensions>
    <configuration>
      <bootFeatures>
        <feature>standard</feature>
        <feature>fclapp-ui</feature>
      </bootFeatures>
    </configuration>
    <executions>
      <execution>
        <id>process-resources</id>
        <goals>
          <goal>install-kars</goal>
        </goals>
        <phase>process-resources</phase>
      </execution>
      <execution>
        <id>package</id>
        <goals>
          <goal>instance-create-archive</goal>
        </goals>
      </execution>
    </executions>
  </plugin>
 ...
 <plugins>

通过上述改动后,顺利编译,Enjoy SDN, Enjoy ODL!


Comments

comments powered by Disqus