我使用發揮作爲Web應用程序框架,我喜歡它,但我想知道是否有申報的POM,一玩的好方法!應用?有沒有一種很好的方式來發揮戲劇!框架應用?
由於源文件的目的是在特殊的文件夾(而不是maven標準),並且目標不是生成目標文件,而是允許在不同的IDE中管理projet(Eclipse,Netbeans,.. 。)
這將是巨大的,如果它有可能pom.xml的依賴與1.2.X的conf/dependencies.yml特定格式的鏈接。
謝謝。
我使用發揮作爲Web應用程序框架,我喜歡它,但我想知道是否有申報的POM,一玩的好方法!應用?有沒有一種很好的方式來發揮戲劇!框架應用?
由於源文件的目的是在特殊的文件夾(而不是maven標準),並且目標不是生成目標文件,而是允許在不同的IDE中管理projet(Eclipse,Netbeans,.. 。)
這將是巨大的,如果它有可能pom.xml的依賴與1.2.X的conf/dependencies.yml特定格式的鏈接。
謝謝。
是的,有玩的Maven模塊。所以你需要安裝它「play install maven」,然後調用「play mvn:init」。那麼每次更新時都會調用「play mvn:up」。 整合不是很好,也就是說它的一種方式行家發揮依賴。並不是所有的maven命令都支持。但playfremwork2將在SBT完全地基於(又名Maven的斯卡拉上)
我不知道這工作時,它是書面的,但今天不工作與遊戲2.0 - 我希望我找到了解決辦法! – PlexQ
有支持此有些不同的插件:
其他?我會有興趣聽到其他選擇嗎?
另一個插件,有戰爭的包裝支持:https://code.google.com/p/play2-maven-plugin – adelarsq
一個更新的回答這個問題,因爲遊戲安裝不玩工作2
我不得不mavenify一個播放2應用程序。
要做到這一點,我用play2-maven-plugin和sbt-pom-reader。
我用sbt-pom-reader保持了play2-maven-plugin不支持的熱重載功能。
這就是你需要配置play2,Maven項目:
<my-maven-project>/
pom.xml <- Your maven build
build.sbt <- the sbt Play 2 configuration
project/
build.properties <- the sbt version specification
build.scala <- the sbt build definition
plugins.sbt <- the sbt plugin configuration
.. <- Whatever files are normally in your maven project.
每個文件應具有以下內容。
的pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.foo</groupId>
<artifactId>bar</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>play2</packaging>
<name>My mavenified Play 2 application</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<play2.version>2.2.1</play2.version>
<play2-scala.version>2.10</play2-scala.version>
<play2.plugin.version>1.0.0-alpha5</play2.plugin.version>
<scala.version>2.10.2</scala.version>
</properties>
<repositories>
<repository>
<id>typesafe</id>
<name>Typesafe - releases</name>
<url>http://repo.typesafe.com/typesafe/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play_${play2-scala.version}</artifactId>
<version>${play2.version}</version>
</dependency>
<!-- only if using Java -->
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play-java_${play2-scala.version}</artifactId>
<version>${play2.version}</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>${basedir}/app</sourceDirectory>
<resources>
<resource>
<directory>${basedir}/conf</directory>
</resource>
<resource>
<directory>${basedir}</directory>
<includes>
<include>public/**</include>
</includes>
</resource>
</resources>
<!--<outputDirectory>target/scala-${play2-scala.version}/classes</outputDirectory>-->
<plugins>
<plugin>
<groupId>com.google.code.play2-maven-plugin</groupId>
<artifactId>play2-maven-plugin</artifactId>
<version>${play2.plugin.version}</version>
<extensions>true</extensions>
<dependencies>
<dependency>
<groupId>com.google.code.play2-maven-plugin</groupId>
<artifactId>play2-provider-play22</artifactId>
<version>${play2.plugin.version}</version>
</dependency>
</dependencies>
<!-- only if using Java -->
<configuration>
<mainLang>java</mainLang>
</configuration>
</plugin>
</plugins>
</build>
</project>
build.sbt:
play.Project.playJavaSettings //or play.Project.playScalaSettings
工程/建造。屬性:
sbt.version=0.13.0
項目/ build.scala:
object BuildFromMavenPomSettings extends com.typesafe.sbt.pom.PomBuild
項目/ plugins.sbt:
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-pom-reader" % "1.0.1")
現在你可以使用Maven構建爲SBT和用熱重載的發展。
由於播放2.4可以禁用PlayLayoutPlugin
正常使用,Maven風格的佈局,而不是玩的傳統佈局。你只需要添加disablePlugins(PlayLayoutPlugin)
到您的SBT項目定義。
參見:https://www.playframework.com/documentation/2.6.x/Anatomy#Default-SBT-layout
有一個播放模塊與一些Maven的支持,但我還沒有嘗試過:Maven的模塊(http://www.playframework.org/modules/maven) – javierhe