github / maven-plugins

Official GitHub Maven Plugins
MIT License
584 stars 198 forks source link

blob: Not Found (404) during mvn com.github.github:site-maven-plugin:site #12

Closed khmarbaise closed 12 years ago

khmarbaise commented 12 years ago

Currently i'm trying to deploy a site to the ghbranch via the following. May be i'm just doing something wrong:

kama@office:~/ws-git/maui$ mvn  com.github.github:site-maven-plugin:site
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building MaUI Test Guide 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- site-maven-plugin:0.5:site (default-cli) @ maui ---
[INFO] Creating 57 blobs
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.999s
[INFO] Finished at: Fri Apr 20 17:49:28 CEST 2012
[INFO] Final Memory: 6M/92M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.5:site (default-cli) on project maui: Error creating blob: Not Found (404) -> [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

After checking i tried the following to get more information:

kama@office:~/ws-git/maui$ mvn  com.github.github:site-maven-plugin:site -Dgithub.site.dryRun=true
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building MaUI Test Guide 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- site-maven-plugin:0.5:site (default-cli) @ maui ---
[INFO] Dry run mode, repository will not be modified
[INFO] Creating 57 blobs
[INFO] Creating tree with 57 blob entries
[INFO] Creating commit with SHA-1: null
[INFO] Creating reference refs/heads/gh-pages starting at commit null
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.599s
[INFO] Finished at: Fri Apr 20 17:52:07 CEST 2012
[INFO] Final Memory: 6M/92M
[INFO] ------------------------------------------------------------------------

The complete configuration can be seen here: https://github.com/khmarbaise/maui

kevinsawicki commented 12 years ago

Have you configured the login/password or OAuth2 token to use in the plugin's configuration section?

khmarbaise commented 12 years ago

Yes i have configured username/password entries like in the github-maven-example like this in my settings.xml:

<profiles>
  <profile>
    <id>github</id>
    <properties>
      <github.global.userName>user</github.global.userName>
      <github.global.password>password</github.global.password>
    </properties>
  </profile>  
</profiles>

<activeProfiles>
  <activeProfile>github</activeProfile>
</activeProfiles>
kevinsawicki commented 12 years ago

Try adding the repositoryName and repositoryOwner values to the plugin's configuration element with the values maui and khmarbaise respectively.

This is a result of issue #11 which will be fixed in the next release due out soon.

khmarbaise commented 12 years ago

Cool that did the trick. Thanks.

ivos commented 12 years ago

Had the same issue. Resolved as hinted here - thanks a lot.

Perhaps the documentation at https://github.com/github/maven-plugins is misleading, stating that the two properties are "optional and will be inferred".

raghu-simpragma commented 11 years ago

It would be very helpful if we could give some examples that clarify the exact values to be specified for the properties repositoryName and repositoryOwner w.r.t. a given GitHub repo...

kevinsawicki commented 11 years ago

@raghu-simpragma For this repository, maven-plugins would be repositoryName and github would be repositoryOwner.

raghu-simpragma commented 11 years ago

@kevinsawicki -- Can't thank you enough for that simple, yet crucial example! I was getting the 404 not found while creating blobs. And I guessed it must be due to some wrong value in repositoryOwner. Am now able to upload the artifacts successfully to a new branch as expected.

In our github, we see OurOrgNameGroup/repoName.

I wonder if repositoryOwner is a sort of mis-nomer; we usually tend to think of real user-names which have access to the github repo.

Also, what if we have something like OrgName/DeptName/repo in Github? Does that mean repositoryOwner in such a case is simply OrgName/DeptName ?

Pardon my ignorance, but I feel it would avoid many issues if we document these points.

Many thanks, & keep up the good work!

monperrus commented 3 years ago

FTR: the error was fixed by changing the password in settings.xml to a token which also has the "user" permission.