MAVEN:如何为groovy类创建可执行jar文件

时间:2016-08-02 04:14:51

标签: maven testing groovy jar executable

我有一个项目,其中所有文件都是Groovy类,它们仅用于测试自动化,如下所示:

import geb.Browser
....
....

@Stepwise
class HomePage extends GebReportingSpec
{

def "Open Homepage"()
{
    cleanReportGroupDir()
    when: "Opening browser"
    to TopPage;
    and:
    report "HomePage opened"

    then: "Click Login Button"
    loginButton.click()
    and:
    report "Login Button Clicked"
}

def "Enter credentials and log in to xxx.co.jp"()
{
    when: "Log in page opened"
    at LoginPage
    and:
    report "Log in page opened"

    then: "Enter User Name and Password"
    username.value("xxx@gmail.com")
    password.value("password")
    and:
    signin.click()
    and:
    at TopPage
    report "Entered credentials and logged in"
}

def "Signin completed and top page opened. Now go to mypage"()
{
    when: "Signed in and top page is opened"
        myPage.click()

    then: "Waiting for loading mypage"  
        waitFor{at MyPage}
        report "MyPage opened"      
}

def "Click log Out button and log out from mypage"()
{
    when: "Logged into mypage"
        logout.click()

    then: "Waiting for loading mypage"
        waitFor{at BackToTopPage}
        report "Clicked logout button"      
}

def "After logged out , go back to homepage"()
{
    when: "Click \"Go To Top\" Button"
        goBackToTopPage.click()

    then: "Check if logged out"
        report "At homepage after logout"
}

}

我有如下文件夹结构:

enter image description here

当我创建包时     mvn清洁包 命令,并尝试执行创建的jar文件,发生以下错误:

C:\Users\GebSpockBuildTest\target>java -jar Geb-0.0.1-SNAPSHOT.jar
Geb-0.0.1-SNAPSHOT.jarにメイン・マニフェスト属性がありません

翻译: 据说,它没有找到清单中的主要类

在这种情况下,有人知道如何创建runnable jar吗?

0 个答案:

没有答案