我正在尝试使用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