opoo / opoopress

OpooPress framework is a java based blog aware static site generator.
http://www.opoopress.com/
Apache License 2.0
113 stars 31 forks source link

以git方式发布到gitcafe失败,No goals have been specified for this build! #9

Closed sconfield closed 10 years ago

sconfield commented 10 years ago

第一次使用opoopress,想把blog发布到gitcafe上去,多次尝试失败。求指导! 错误信息如下: $ mvn -e [INFO] Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.307s [INFO] Finished at: Sat Jan 25 18:46:29 CST 2014 [INFO] Final Memory: 5M/15M [INFO] ------------------------------------------------------------------------ [ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1] org.apache.maven.lifecycle.NoGoalSpecifiedException: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:104) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214) at org.apache.maven.cli.MavenCli.main(MavenCli.java:158) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException

opoo commented 10 years ago

maven 命令通常是 mvn [goal ]··· 的格式,执行需要指定goal,例如 mvn op:build, build 就是个 goal,op 是 goal 的前缀。

sconfield commented 10 years ago

好的,回去研究下maven,我是 mvn op:deploy 失败的。 Sent using CloudMagic On 周一, 1月 27, 2014 at 5:30 下午, Alex Lin notifications@github.com wrote:maven 命令通常是 mvn [goal ]··· 的格式,执行需要指定

—Reply to this email directly or view it on GitHub.

opoo commented 10 years ago

mvn op:deploy 的错误消息贴上来看看,可能由于 deploy_server 配置问题。

sconfield commented 10 years ago

用家里平板搭建的博客,回家后就立马传上来,望大侠方便的时候指点一下,谢谢! Sent using CloudMagic On 周一, 1月 27, 2014 at 5:44 下午, Alex Lin notifications@github.com wrote:将 mvn op:deploy 的错误消息贴上来看看,可能由于 deploy_server 配置问题。

—Reply to this email directly or view it on GitHub.

sconfield commented 10 years ago

$ mvn op:deploy [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building My OpooPress.com site 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- opoopress-maven-plugin:1.0.3:deploy (default-cli) @ my-opoopress-site --- [INFO] The site directory is : c:\Users\静\Documents\Blog\site [INFO] Skipping install, site already installed. [INFO] Skipping sass compile, css file is up to date. [INFO] Skipping generate, all output files are up to date. [INFO] Destination [c:\Users\静\Documents\Blog\target\public\site] [INFO] Site root [] scm:git:https://gitcafe.com/sconfield/sconfield.git/ - Session: Opened [INFO] Pushing c:\Users\静\Documents\Blog\target\public\site [INFO] >>> to scm:git:https://gitcafe.com/sconfield/sconfield.git/./ Uploading: ./ to scm:git:https://gitcafe.com/sconfield/sconfield.git/

[INFO] Executing: cmd.exe /X /C "git ls-files" [INFO] Working directory: c:\Users\静\Documents\Blog. [INFO] Executing: cmd.exe /X /C "git ls-files" [INFO] Working directory: c:\Users\静\Documents\Blog. [INFO] Executing: cmd.exe /X /C "git clone https://gitcafe.com/sconfield/sconfield.git/ C:\Users\静\AppData\Local\Temp\wagon-scm1664950111.checkout" [INFO] Working directory: C:\Users\静\AppData\Local\Temp [INFO] Executing: cmd.exe /X /C "git pull https://gitcafe.com/sconfield/sconfield.git/ master" [INFO] Working directory: C:\Users\静\AppData\Local\Temp\wagon-scm1664950111.checkout [INFO] Executing: cmd.exe /X /C "git checkout" [INFO] Working directory: C:\Users\静\AppData\Local\Temp\wagon-scm1664950111.checkout [INFO] Executing: cmd.exe /X /C "git ls-files" [INFO] Working directory: C:\Users\静\AppData\Local\Temp\wagon-scm1664950111.checkout scm:git:https://gitcafe.com/sconfield/sconfield.git/ - Session: Disconnecting scm:git:https://gitcafe.com/sconfield/sconfield.git/ - Session: Disconnected [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10.699s [INFO] Finished at: Mon Jan 27 19:05:45 CST 2014 [INFO] Final Memory: 6M/17M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.opoo.press.maven.plugins:opoopress-maven-plugin:1.0.3:deploy (default-cli) on project my-opoopress-site: Error uploading site : Failed to create directory C:\Users\静\AppData\Local\Temp\wagon-scm1664950111.checkout.; parent should exist: C:\Users\静\AppData\Local\Temp\wagon-scm1664950 111.checkout -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

opoo commented 10 years ago

可能是这个问题 http://www.opoopress.com/zh/docs/github-pages/#wagon-scm--maven-scm-provider-gitexe-known-issues

试试第二种方式 opoopress-wagon-git

sconfield commented 10 years ago

ssh密钥我早已配置过。 $ ssh -T git@gitcafe.com Enter passphrase for key '/c/Users/静/.ssh/gitcafe': Hi sconfield! You've successfully authenticated, but GitCafe does not provide shell access. 我注释掉不相关的extension,只留下了opoopress-wagon-git。和不注释的报错信息一样。如下: $ mvn op:deploy [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building My OpooPress.com site 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- opoopress-maven-plugin:1.0.3:deploy (default-cli) @ my-opoopress-site --- [INFO] The site directory is : c:\Users\静\Documents\Blog\site [INFO] Skipping install, site already installed. [INFO] Skipping sass compile, css file is up to date. [INFO] No last generate info, regenerate site. [INFO] Reading sources ... [INFO] Rendering ... [INFO] Writing files ... [INFO] Writing 1 posts [INFO] Writing 14 pages [INFO] Copying 1 assets directory [INFO] Generate time: 4169ms [INFO] Destination [c:\Users\静\Documents\Blog\target\public\site] [INFO] Site root [] git:https://gitcafe.com/sconfield/sconfield.git/ - Session: Opened [INFO] Pushing c:\Users\静\Documents\Blog\target\public\site [INFO] >>> to git:https://gitcafe.com/sconfield/sconfield.git/./ Uploading: ./ to git:https://gitcafe.com/sconfield/sconfield.git/

[INFO] [C:\Users\静\AppData\Local\Temp\wagon-git1012732376.checkout] Executing: cmd.exe /X /C "git clone https://gitcafe.com/sconfield/sconfield.git C:\Users\静 \AppData\Local\Temp\wagon-git1012732376.checkout" [INFO] [git] Cloning into 'C:\Users\闈橽AppData\Local\Temp\wagon-git1012732376.checkout'... [INFO] [C:\Users\静\AppData\Local\Temp\wagon-git1012732376.checkout] Executing: cmd.exe /X /C "git checkout" [INFO] [git] Your branch is up-to-date with 'origin/master'. [INFO] [C:\Users\静\AppData\Local\Temp\wagon-git1012732376.checkout] Executing: cmd.exe /X /C "git ls-files" [INFO] [git] .gitignore [INFO] [git] README.md [INFO] [C:\Users\静\AppData\Local\Temp\wagon-git1012732376.checkout] Executing: cmd.exe /X /C "git add ." [INFO] [git] warning: LF will be replaced by CRLF in about/index.html. [INFO] [git] The file will have its original line endings in your working directory. [INFO] [git] warning: LF will be replaced by CRLF in article/2014/01/hello-world/index.html. [INFO] [git] The file will have its original line endings in your working directory. [INFO] [git] warning: LF will be replaced by CRLF in atom.xml. [INFO] [git] The file will have its original line endings in your working directory. [INFO] [git] warning: LF will be replaced by CRLF in index.html. [INFO] [git] The file will have its original line endings in your working directory. [INFO] [git] warning: LF will be replaced by CRLF in sample-page.html. [INFO] [git] The file will have its original line endings in your working directory. [INFO] [C:\Users\静\AppData\Local\Temp\wagon-git1012732376.checkout] Executing: cmd.exe /X /C "git commit --allow-empty -m "GitHubWagon: Deploying OpooPress to GitHub Pages."" [INFO] [git] [INFO] [git] *\ Please tell me who you are. [INFO] [git] [INFO] [git] Run [INFO] [git] [INFO] [git] git config --global user.email "you@example.com" [INFO] [git] git config --global user.name "Your Name" [INFO] [git] [INFO] [git] to set your account's default identity. [INFO] [git] Omit --global to set the identity only in this repository. [INFO] [git] [INFO] [git] fatal: unable to auto-detect email address (got '静@sconfield.(none)') Transfer error: org.opoo.press.maven.wagon.git.GitException: Unable to commit files git:https://gitcafe.com/sconfield/sconfield.git/ - Session: Disconnecting git:https://gitcafe.com/sconfield/sconfield.git/ - Session: Disconnected [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 20.255s [INFO] Finished at: Wed Jan 29 11:29:32 CST 2014 [INFO] Final Memory: 7M/17M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.opoo.press.maven.plugins:opoopress-maven-plugin:1.0.3:deploy (default-cli) on project my-opoopress-site: Error uploading site : Unable to put file: Unable to commit files -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

opoo commented 10 years ago

你是 Windows 操作系统吧?你打开的 cmd 窗口需要能够执行 git 命令,然后在这个窗口中执行 mvn op:deploy 试试。

经测试,在 Windows 下使用 GitHub for Windows 的 git shell 是可以正常发布到 github.io 的,我想应该也可以发布到 gitcafe。

sconfield commented 10 years ago

嗯,windows8.1,我用 git bash 执行的 mvn op:deploy ;我试试在 cmd 里执行。

opoo commented 10 years ago

@sconfield 今天突然又看了一下你提交的最后一次错误信息,那是说你的 git 没有配置用户名和email 地址。

通过以下命令先设置 git 的参数,然后再发布应该可以。

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

这里使用你在 gitcafe 使用的用户名和 email 地址。

opoo commented 10 years ago

@sconfield 由于通过git:https://协议发布时需要设置用户名、email等信息,而且需要输入密码,用户名、email可以通过全局方式设置(如上),但密码没有地方可以输入,所以这种方式比较容易失败。

如果在发布之前向该库提交过内容时,由于 git 缓存的缘故,偶尔也能正常发布。

根本的解决方式时使用 SSH 方式访问该库。

注意,对于 GitHub 和 GitCafe 那种不带SSH协议(实质上默认是SSH协议)的URL,我们需要这样配置:

PS: 这个功能从1.1.2版本开始得以支持。

6c8426ff1059790256eb1f215522d80795dec8ed