github / maven-plugins

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

Error creating blob: Not Found (404) #10

Closed gehel closed 12 years ago

gehel commented 12 years ago

In a multi-module project, the parent project's site is uploaded without problem, but the child project fails with "Error creating blob: Not Found (404)". I'm a bit at lost as to what the problem is. When running mvn -e -X site I get the following output :

[DEBUG] Configuring mojo 'com.github.github:site-maven-plugin:0.3:site' -->
[DEBUG]   (f) branch = refs/heads/gh-pages
[DEBUG]   (f) message = Creating site for 0.1.0.BUILD-SNAPSHOT
[DEBUG]   (f) oauth2Token = 
[DEBUG]   (f) outputDirectory = /home/gehel/dev/loganalyzer/serene-collector/collector-webapp/target/site
[DEBUG]   (f) password = ****
[DEBUG]   (f) project = MavenProject: net.sereneproject:collector-webapp:0.1.0.BUILD-SNAPSHOT @ /home/gehel/dev/loganalyzer/serene-collector/collector-webapp/pom.xml
[DEBUG]   (f) userName = gehel
[DEBUG] -- end configuration --
[INFO] [ghSite:site {execution: default}]
[DEBUG] Using GitHub repository serene-collector/collector-webapp
[DEBUG] Scanning /home/gehel/dev/loganalyzer/serene-collector/collector-webapp/target/site and including [] and exluding []
[INFO] Creating 506 blobs
[DEBUG] Scanned files to include: [source-repository.html, index.html, taglist.html, checkstyle-aggregate.html, [...long list of files...]]

[DEBUG] Using basic authentication with username: gehel
[DEBUG] Creating blob from /home/gehel/dev/loganalyzer/serene-collector/collector-webapp/target/site/source-repository.html
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error creating blob: Not Found (404)

[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error creating blob: Not Found (404)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    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:616)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating blob: Not Found (404)
    at com.github.maven.plugins.site.SiteMojo.createBlob(SiteMojo.java:250)
    at com.github.maven.plugins.site.SiteMojo.execute(SiteMojo.java:302)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more
Caused by: org.eclipse.egit.github.core.client.RequestException: Not Found (404)
    at org.eclipse.egit.github.core.client.GitHubClient.createException(GitHubClient.java:383)
    at org.eclipse.egit.github.core.client.GitHubClient.sendJson(GitHubClient.java:498)
    at org.eclipse.egit.github.core.client.GitHubClient.post(GitHubClient.java:512)
    at org.eclipse.egit.github.core.service.DataService.createBlob(DataService.java:115)
    at com.github.maven.plugins.site.SiteMojo.createBlob(SiteMojo.java:246)
    ... 20 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 minutes 41 seconds
[INFO] Finished at: Fri Feb 24 21:01:23 CET 2012
[INFO] Final Memory: 140M/1161M
[INFO] ------------------------------------------------------------------------
kevinsawicki commented 12 years ago

It looks like it is trying to upload to the repository: serene-collector/collector-webapp

Is that the correct repository?

gehel commented 12 years ago

I'm not really sure ... As this is a module, it should be uploaded in a subdirectory. But this might not make sense for an upload to a git branch. Or I might just not have it configured correctly ...

kevinsawicki commented 12 years ago

Can you paste your configuration of the site plugin from your POM file?

gehel commented 12 years ago

The configuration in the parent pom is :

<plugin>
    <groupId>com.github.github</groupId>
    <artifactId>site-maven-plugin</artifactId>
    <version>0.5</version>
    <configuration>
        <message>Creating site for ${project.version}</message>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>site</goal>
            </goals>
            <phase>site</phase>
        </execution>
    </executions>
</plugin>

The configuration in the child module is :

<plugin>
    <groupId>com.github.github</groupId>
    <artifactId>site-maven-plugin</artifactId>
    <version>0.5</version>
    <configuration>
        <message>Creating site for ${project.version}</message>
        <path>collector-webapp</path>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>site</goal>
            </goals>
            <phase>site</phase>
        </execution>
    </executions>
</plugin>

I also tried without configuring <path/> in the module, and also with no configuration at all in the module. In all those cases, I get the same error.

kevinsawicki commented 12 years ago

And what is the repository that you want to create the site for?

kevinsawicki commented 12 years ago

The target repository is determined by either the repositoryName and repositoryOwner fields in the plugin configuration or from trying to parse the <url> element of the project or the <scm> URLs and extracting the repository from those.

Defining the target repository is discussed in the Core Configuration section of the README.

gehel commented 12 years ago

I saw that, but did not really understand how to use those properties to configure correctly. Most of what I read let me think that a maven multimodule project with git is not a configuration that is ready for prime time. I'll try to put together a example project showing what doesnt work in my case.

Thank you a lot for all your help sofar !

kevinsawicki commented 12 years ago

For a multimodule project the main question is whether you want all the sites generated for the modules to be in the same repository's gh-pages branch under different paths, or have each module's site in its own repository's gh-pages branch.

Hope this helps.

gehel commented 12 years ago

Again, thanks a lot for your help !

By using the repositoryName and repositoryOwner parameter, I can get my site deployed where I want. As maven deploys first the parent site, then each module's site, I had to add the <merge>true</merge> parameter to the modules so that each site doesnt replace the previous one.

kevinsawicki commented 12 years ago

You are welcome, I will close this issue.

Please let me know if you have any other problems or questions.