我创建了scala应用程序,现在我想构建jar.我运行mvn package比尝试运行jar by命令
java -jar target/burner-1.0-SNAPSHOT.jar
我看到错误:
Failed to load Main-Class manifest attribute from
如何定义Main-Class属性?我需要创建Manifest.mf吗?哪里?或者我需要在pom.xml中的某个地方使用mainclass属性?
更新: 我已经创建了包含内容的src/main/resources/MANIFEST.MF文件
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: itsabear
Main-Class: ru.dmteam.App
Build-Jdk: 1.6.0_20
Run Code Online (Sandbox Code Playgroud)
我没有忘记在文件末尾的行结尾.在mvn package我看到新罐子之后.我在这个jar中检查了manifest.mf - 它包含了正确的主类,但是当我输入时java -jar target/burner-1.0-SNAPSHOT.jar我仍然看到一个错误Failed to load Main-Class manifest attribute from
我的pom.xml http://pastie.org/1070483
更新2
我发现现在jar中有两个manifest.mf文件.MANIFEST.MF和META-INF/MANIFEST.MF我将我的自定义MANIFEST.MF移动到刚刚创建的META-INF文件夹(在src/main/resources中),但现在 mvn package在创建jar时覆盖它...
如何在RestHelper中的lift框架中简单地访问get和post属性?文档中没有任何明确的例子:(
package my.domain
import net.liftweb.http._
import net.liftweb.http.rest._
import net.liftweb.json.JsonAST._
import net.liftweb.json._
import net.liftweb.common.{Box,Full,Empty,Failure,ParamFailure}
import net.liftweb.mapper._
import ru.dmteam.model.{RssItem}
object ContentRest extends RestHelper {
def getq: String = {
val q = S.param("q")
q.toString
}
serve {
case "api" :: "static" :: _ XmlGet _=> <b>{getq}</b>
}
}
Run Code Online (Sandbox Code Playgroud)
我想了解如何q在我请求时提升电梯的价值http://localhost:8080/api/static.xml?q=test
如何在资源网址中使用连字符?例如:/my-model/或/my-model/1.如果我定义路由,因为resources :"my-model"我得到语法错误,因为rails生成方法def hash_for_my-models_url(options = nil).
我们有RoR应用程序,我们计划在新版本中创建js接口(extjs或closure).是否可以将GWT与RoR一起使用?
如何document从html源创建对象并使用node.js中的document.*函数getElementById?
是否可以通过纯SQL查询获取项目,而不是使用SORM通过DSL构建查询?
例如,是否有用于制作类似内容的API
val metallica = Db.query[Artist].fromString("SELECT * FROM artist WHERE name = ?", "Metallica").fetchOne() // Option[Artist]
Run Code Online (Sandbox Code Playgroud)
代替
val metallica = Db.query[Artist].whereEqual("name", "Metallica").fetchOne() // Option[Artist]
Run Code Online (Sandbox Code Playgroud) 2个星期前,我提交了我的应用程序的配置,它有我的密码,它不是很有用.如何从提交历史记录中删除该文件并确保它不会重新提交?
我想从所有提交树中删除该文件,因为它包含我的密码.
我需要显示以不同货币呈现的用户数量.eq:
Your balance: $ 100 000.00
€ 70 000.00
3 000 000,00 ???.
Run Code Online (Sandbox Code Playgroud)
所以我需要使用number_to_currency三次不同的语言环境(en,eu,ru).做正确的方法是什么?
我正在使用Yesod编写JSON RESTFul服务,需要实现请求验证.因为服务接受JSON,我不能使用Yesod.Form.我喜欢scalaz验证使用的方式,但我没有在Haskell中找到这样的方法.
是否有最佳实践来实现验证,允许回答结构化错误消息,如下所示:
{
"birthDate": "2017.07.14",
"count": "three",
"kind": "baz",
"entity": {
"id": -1
}
}
Run Code Online (Sandbox Code Playgroud)
{
"errors": {
"birthDate": "Date should be less than 2014.05.25", // current date
"count": "should be a number",
"kind": "must be one of [foo, bar]",
"entity": {
"id": "Entity with id -1 not found"
}
}
}
Run Code Online (Sandbox Code Playgroud) 我试图使用负前瞻 - 非标准正则表达式,POSIX的做法:
"foobarbaz" =~ "^(?!.*bar).*$" :: Bool
Run Code Online (Sandbox Code Playgroud)
并得到错误 *** Exception: user error (Text.Regex.Posix.String died: (ReturnCode 13,"repetition-operator operand invalid"))
如何使用负前瞻在Haskell?