Java 如何打包Akka项目
我有一个Akka独立项目 它实现了mico内核的可引导接口 使用微内核打包akka系统的教程 描述使用SBT插件的SBT项目Java 如何打包Akka项目,java,maven,akka,Java,Maven,Akka,我有一个Akka独立项目 它实现了mico内核的可引导接口 使用微内核打包akka系统的教程 描述使用SBT插件的SBT项目 有人能告诉我如何用微内核打包maven项目吗?在Google上搜索“akka微内核maven”将此列为您的问题最有争议的答案之一:在浏览了JCrnak的博客并阅读了maven汇编插件和清单文件文档之后,我能够提出一个与JCranky略有不同的解决方案,并愿意与大家分享 第一个假设是所有Akka插件(包括微核插件)都已在POM.xml中配置。其次,开发了要分发的应用程序 m
有人能告诉我如何用微内核打包maven项目吗?在Google上搜索“akka微内核maven”将此列为您的问题最有争议的答案之一:在浏览了JCrnak的博客并阅读了maven汇编插件和清单文件文档之后,我能够提出一个与JCranky略有不同的解决方案,并愿意与大家分享 第一个假设是所有Akka插件(包括微核插件)都已在POM.xml中配置。其次,开发了要分发的应用程序 maven包阶段创建一个可执行的jar文件。但是,这需要使用java-jar命令直接执行应用程序的主类。为了让包应用程序知道主类的位置,我们在POM.xml中插入以下带有清单文件配置的插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.bbox.gesture.BoundingBox</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
start命令在可执行jar文件上运行java-jar命令。jar文件是可执行的jar文件
要运行应用程序,只需解压缩服务器中的zip文件夹,导航到start.bat文件并单击
未在此服务器上找到请求的URL/2012/07/13/akka microkernel with maven/。
这是谷歌缓存中的镜像:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/lib
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>akka</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/deploy</outputDirectory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>*.jar</exclude>
<exclude>*.zip</exclude>
</excludes>
</fileSet>
</fileSets>
<files>
<file>
<source>target/com-bbox-gesture-1.0-SNAPSHOT.jar</source>
<outputDirectory>/deploy</outputDirectory>
<destName>bbox.jar</destName>
</file>
<file>
<source>src/main/resources/application.conf</source>
<outputDirectory>/deploy/config</outputDirectory>
</file>
</files>
</assembly>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptors>
<descriptor>/descriptor.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
echo off
cls
start java -jar bbox.jar