trajano / wagon-git

Git wagon provider
Eclipse Public License 1.0
8 stars 10 forks source link

Multi module - from lower module #12

Closed hazendaz closed 9 years ago

hazendaz commented 9 years ago

I'm working on mybatis and switched it over to use this awesome plugin. Mybatis is 'multi module' but not in the traditional sense. It is really just a collection of separate projects that share a common parent. The parent is setup to use this plugin and releases without issue. I'm trying to test out getting this working on my fork on a module that uses that parent. This is my setting.

gh-pages Mybatis Guice GitHub Pages github:ssh://hazendaz.github.io/guice/

I'm expecting this to push out to my fork. However, it is attempting to do the following which fails.

to github:ssh://mybatis.github.io/parent/../../hazendaz.github.io/guice

The 'mybatis.github.io/parent/../..' isn't showing in the effective pom, is really in the mybatis parent, and I'm not sure what is causing that to occur. Any ideas that might help me get past this issue? I guess I'm expecting that what i put in distributionManagement is going to enforce a result but it's not in this case. I've looked over the directions here and don't see anything jumping out at what the problem is. Within mybatis there are probably about 20 modules so it would be great if this works out. I wanted to ask about this first in case it's something easy I'm doing wrong. If this is a little more complex and needs a patch, I can jump in and give a helping hand. Thanks in advance!

trajano commented 9 years ago

Hmm... it looks like it is trying to switch the "host" part

github:ssh://mybatis.github.io/parent/../../hazendaz.github.io/guice

would translate to

github:ssh://hazendaz.github.io/guice

Short guess may be somewhere in https://github.com/trajano/wagon-git/blob/master/src/main/java/net/trajano/wagon/git/GitHubPagesWagon.java#L101

having trouble in the changing names. However, I don't see it there, may need to go through a debugger and check what it shows for your project.

trajano commented 9 years ago

It would seem it would require a bit of extensive hacking because I cannot change the "authority" aka host name of the URL using the URI methods.

System.out.println(URI.create("ssh://mybatis.github.io/parent/").resolve("../../hazendaz.github.io/guice"));

gives

ssh://mybatis.github.io/../hazendaz.github.io/guice

trajano commented 9 years ago

I think to support this I would need to have my own URI resolver that allows switching the authority

hazendaz commented 9 years ago

Thanks for the information. If I were running this as mybatis itself do you think it would work as expected? I've got authority to do that but was trying to test out changes on my fork. I certainly can switch over and give it a try directly to see if that helps.

trajano commented 9 years ago

I use it on some of my code which is multimodules. However it gets to be a big pain if it fails at a site release build. 

My suggestion is to at least know how to tag and remove tags from your git repository.

However for snapshot builds I don't  have issues with it. Most of my issues stem from other reporting modules.

On Sun, Aug 9, 2015 at 12:49 PM, Jeremy Landis notifications@github.com wrote:

Thanks for the information. If I were running this as mybatis itself do you think it would work as expected? I've got authority to do that but was trying to test out changes on my fork. I certainly can switch over and give it a try directly to see if that helps.

Reply to this email directly or view it on GitHub: https://github.com/trajano/wagon-git/issues/12#issuecomment-129216215

trajano commented 9 years ago

This is one of the current sites I am working on. http://site.trajano.net/openid-connect/ This is hosted by github pages (you can tell if you use a DNS query for CNAME on that host name)

The project is at https://github.com/trajano/openid-connect/ with gh-pages at https://github.com/trajano/openid-connect/tree/gh-pages

It still has a few "ugliness" because I didn't name everything yet. It's not my priority to get those cleaned up at the moment.

hazendaz commented 9 years ago

I'm on to something now with what I'm experiencing on multi module build.

Top level must be something like this for url.

github:ssh://mybatis.github.io/parent/

Lower level must be something like this for url.

git:ssh://git@github.com/mybatis/hazelcast-cache.git?gh-pages#

If I use git:ssh style in the parent, that is when it doesn't work with the ../ issue. If I go this route, it works just fine. Any ideas as to why?

trajano commented 9 years ago

If it works great. The second form was my original format where I sort of hacked a git url with a branch identifier. But I decreed it too ugly to look at so I created the other alternatives. 

Though it's good that it works. I haven't seen that form for a long while now. :)

On Thu, Oct 8, 2015 at 1:06 AM, Jeremy Landis notifications@github.com wrote:

I'm on to something now with what I'm experiencing on multi module build. Top level must be something like this for url.

github:ssh://mybatis.github.io/parent/

Lower level must be something like this for url.

git:ssh://git@github.com/mybatis/hazelcast-cache.git?gh-pages#

If I use git:ssh style in the parent, that is when it doesn't work with the ../ issue. If I go this route, it works just fine. Any ideas as to why?

Reply to this email directly or view it on GitHub: https://github.com/trajano/wagon-git/issues/12#issuecomment-146420865

trajano commented 9 years ago

Do you want to make a change to the README.md or create a new .md in the src/site/markdown to describe what you did to work around your situation? Then I can close this off.

hazendaz commented 9 years ago

Sure...give me another day or so in order to confirm my findings are repeatable. I'd hate to write something up only to find out it was some other combination as I was flipping things around. Thanks for keeping this out here in the meantime.

hazendaz commented 9 years ago

I'll write up something for the readme and perform a PR as soon as I get a chance. I have thoroughly tested this now and trust the repeatibility nature of it.