我正在嘗試使用apache twill構建YARN應用程序。從twill presentation的幻燈片中,他們正在討論使用maven-bundle-plugin
打包hello world樣本。如何打包並運行斜紋示例應用程序
因此,要打包示例hello world,我首先嚐試打包與mvn assembly:assembly -DdescriptorId=jar-with-dependencies
的罐子。 然後通過添加以下到pom.xml
(和做mvn clean install
):
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.5.3</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${pom.groupId}.${pom.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${pom.artifactId}</Bundle-Name>
<Bundle-Version>1.0.0</Bundle-Version>
<Private-Package>org.wso2.mbp.helloworld</Private-Package>
<Bundle-Activator>org.wso2.mbp.helloworld.Activator</Bundle-Activator>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Import-Package>
org.apache.twill.*,
org.osgi.framework,
*;resolution:=optional
</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
如何斜紋應用程序打包在一起?然後如何在hadoop上運行它們?
with'jar -tf twill-sample.jar'我沒有看到'lib/*'文件夾! – bachr 2014-11-05 10:28:12
如果包裝類型是「jar」,則捆綁插件實際上需要執行目標來構建捆綁包jar。我更新了我的答案以反映這一點。還包括捆綁插件中的hadoop排除,以便它不會包含hadoop罐子。 – 2014-11-06 00:09:29
它的工作原理,但我不得不手動下載[hadoop-auth-2.5.0.jar](http://mvnrepository.com/artifact/org.apache.hadoop/hadoop-auth/2.5.0)(for'org。 apache.hadoop.util.PlatformName'),因爲它在我的hadoop安裝中丟失了。 – bachr 2014-11-06 10:19:20