sbt publish-local issues building Lift 2.5-SNAPSHOT

58 views
Skip to first unread message

fmpwizard

unread,
Mar 20, 2012, 10:03:51 PM3/20/12
to simple-b...@googlegroups.com
Hi,

I'm building the Lift project locally so that I can test some bug fixes I'm working on, but when I do sbt publish-local (well, we have a sh script so I do ./liftsh publish-local, but it is the same thing), the resulting jars go to ~/.ivy2/local. The problem is that there are lift 2.5-SNAPSHOT builds on the maven repos, so the project I have locally picks up the jars from .ivy2/cache instead of the ones from .ivy2/local.

Is there a way to tell sbt to either publish to cache or on the web application, to tell it to look first in local and then in cache?

I hope that makes sense.

Thanks

  Diego

fmpwizard

unread,
Mar 20, 2012, 10:05:21 PM3/20/12
to simple-b...@googlegroups.com
Oh, we are using sbt 0.12-M1

Eugene Vigdorchik

unread,
Mar 21, 2012, 3:00:52 AM3/21/12
to simple-b...@googlegroups.com
I don't think there is a way to force what you want. Rather I would make local
have a different version from what is published.

Eugene.


>
> I hope that makes sense.
>
> Thanks
>
>   Diego
>

> --
> You received this message because you are subscribed to the Google Groups
> "simple-build-tool" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/simple-build-tool/-/vtgTyUCz3rEJ.
> To post to this group, send email to simple-b...@googlegroups.com.
> To unsubscribe from this group, send email to
> simple-build-t...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/simple-build-tool?hl=en.

Diego Medina

unread,
Mar 21, 2012, 10:48:56 PM3/21/12
to simple-b...@googlegroups.com
On Wed, Mar 21, 2012 at 3:00 AM, Eugene Vigdorchik
<eugene.v...@gmail.com> wrote:
> On Wed, Mar 21, 2012 at 6:03 AM, fmpwizard <fmpw...@gmail.com> wrote:
>> Hi,
>>
>> I'm building the Lift project locally so that I can test some bug fixes I'm
>> working on, but when I do sbt publish-local (well, we have a sh script so I
>> do ./liftsh publish-local, but it is the same thing), the resulting jars go
>> to ~/.ivy2/local. The problem is that there are lift 2.5-SNAPSHOT builds on
>> the maven repos, so the project I have locally picks up the jars from
>> .ivy2/cache instead of the ones from .ivy2/local.
>>
>> Is there a way to tell sbt to either publish to cache or on the web
>> application, to tell it to look first in local and then in cache?
> I don't think there is a way to force what you want. Rather I would make local
> have a different version from what is published.

wow, well, if that's the only way. I'll try that. DO you or anyone
else know if this used to be the same situation when using previous
sbt versions ? 0.7.7 or 0.11.2 ?

Thanks

Diego

>
> Eugene.
>>
>> I hope that makes sense.
>>
>> Thanks
>>
>>   Diego
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "simple-build-tool" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/simple-build-tool/-/vtgTyUCz3rEJ.
>> To post to this group, send email to simple-b...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> simple-build-t...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/simple-build-tool?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To post to this group, send email to simple-b...@googlegroups.com.
> To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
>

--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com

Robin Green

unread,
Mar 22, 2012, 6:26:13 AM3/22/12
to simple-b...@googlegroups.com
Indeed - versions are supposed to identify different versions of the software, so arguably a distinguished version, version suffix, or some additional suffix separate from the version, should be used to distinguish between branches. That way, you can be sure that you are referencing the build from the branch you want to reference. However, this does not seem to be common practice with open source projects. I wonder why not?

Well, an alternative for short-lived local branches is just to comment out the dependencies and use unmanaged dependencies (copy the jars into lib/ yourself, or even make a symbolic link to the built jar on Linux or Mac). I guess that's a simple and effective solution that doesn't require thinking about versions.

Diego Medina

unread,
Mar 22, 2012, 8:04:32 AM3/22/12
to simple-b...@googlegroups.com

Hi Robin

On Mar 22, 2012 6:26 AM, "Robin Green" <gre...@gmail.com> wrote:
>
> Indeed - versions are supposed to identify different versions of the software, so arguably a distinguished version, version suffix, or some additional suffix separate from the version, should be used to distinguish between branches.

If this was my little project, sure, I would change versions with no problem, but in this case, I'm working on the lift project, and right now we are at 2.5-snapshot, we normally stay in snapshot for some time and then we have milestones and then RC. If I were to publish the modified snapshot to central, sbt would do the right thing, but I cannot do that. Now I will have to remember to change the fake version back to normal before pushing my changes.

The symlink idea is even more work, because I'm generating several jar files.

Thanks for your reply though. I wish sbt worked the way I expected it.

Regards
Diego

That way, you can be sure that you are referencing the build from the branch you want to reference. However, this does not seem to be common practice with open source projects. I wonder why not?
>
> Well, an alternative for short-lived local branches is just to comment out the dependencies and use unmanaged dependencies (copy the jars into lib/ yourself, or even make a symbolic link to the built jar on Linux or Mac). I guess that's a simple and effective solution that doesn't require thinking about versions.
>
>
> On Wednesday, 21 March 2012 07:00:52 UTC, Eugene Vigdorchik wrote:
>>
>>
>> I don't think there is a way to force what you want. Rather I would make local
>> have a different version from what is published.
>>
>> Eugene.
>>

> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.

> To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/4_5iMHOj2iwJ.

Indrajit Raychaudhuri

unread,
Mar 22, 2012, 10:36:39 AM3/22/12
to simple-b...@googlegroups.com
Diego,

What you are experiencing is abnormal. I do this all the time with Lift 2.5-SNAPSHOT.
I'd like to take a look. So would it be possible for you to share a repeatable case on Github?

FWIW, SBT's documented behavior is given in the section 'Publishing Locally' here [1]

- Indrajit

[1] https://github.com/harrah/xsbt/wiki/Publishing

Diego Medina

unread,
Mar 22, 2012, 2:12:14 PM3/22/12
to simple-b...@googlegroups.com
Hi Indrajit,

First, I'm glad that what I see is not what I should, I'll push my
branch and this other project that should pick up the modified
snapshot to github and I'll post the links here.

Thanks

Diego

lkuczera

unread,
Mar 23, 2012, 3:33:21 AM3/23/12
to simple-b...@googlegroups.com
I'm having same issue, even though changed version to 2.5.1-SNAPSHOT
I can see artifacts in repo but they are not pulled to cache. Ideas ?

lkuczera

unread,
Mar 23, 2012, 4:08:29 AM3/23/12
to simple-b...@googlegroups.com
Solved by removing "->default"

Diego Medina

unread,
Mar 24, 2012, 12:03:53 AM3/24/12
to simple-b...@googlegroups.com
Thanks Łukasz !nthat did it.

Diego

> --
> You received this message because you are subscribed to the Google Groups
> "simple-build-tool" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/simple-build-tool/-/ZVymDTWBB6kJ.

Reply all
Reply to author
Forward
0 new messages