I don't currently have an intranet leiningen repo set up at work, but I can
imagine similar issues. While clojars.org isn't likely to suddenly be
renamed to a different host, in an intranet environment servers do get
moved, servers from different departments might get merged etc. Burning
not-very-permanent names into project.clj is problematic because
project.clj goes into source control and then its history is immutable. I
can change project.clj if a server moves, but then I'm going to have to
manually patch up the file if I need to reproduce an historic build. In
effect the history of project.clj is independent of the history of the
context of repo locations.
Putting repos in project.clj is sensible if the repos can be guaranteed to
be permanent and immutable. If the reality is that repo names are
contextual or not permanent, then I think the user profile is a better
place for them, and in that situation it is legit to suppress the warning.
On Wed, Mar 5, 2014 at 2:29 PM, bill robertson <billrobertson42-***@public.gmane.org>wrote:
> Hello Phil,
>
> Thanks for the reply.
>
> > What is the motivation for wanting this?
>
> It's not 100% clear what you mean. If you mean do I want a feature change
> in lein, then no I'm not asking for that.
>
> If you're asking why we need to make sure we're pointing to our internal
> repository rather than public ones, those reasons are business related. We
> can not publish artifacts to a public repository. So a build that is not
> pointing to that repo should simply fail. Although I can see how that would
> be an issue if the location of the repository changed.
>
> Given our need to get work done today, in our environment as it exists, I
> would prefer to make it easy for new projects to be correctly configured
> w/o having to remember to modify each one by copying/pasting the same
> stanza into each project.clj file. Think about the headache that would
> introduce if the location of the repository changed as compared to if it
> were configured once? Seems like a DRY issue to me.
>
> And, like I said earlier about warnings. I think they're a less than ideal
> choice, because they simply train people to ignore problems. -Werror FTW
> ;-)
>
> If there isn't really a way to do this currently and you don't plan to add
> one, then that's fine. However, if you have advice or have seen how others
> have approached this situation then I'd be happy to hear it.
>
> Thanks,
> Bill Robertson
>
>
>
> On Tue, Mar 4, 2014 at 5:46 PM, Phil Hagelberg <phil-Tr7DW4wtY2wdnm+***@public.gmane.org> wrote:
>
>>
>> bill robertson writes:
>>
>> > However, adding repositories to user profile invokes a repeatability
>> > warning. Which makes sense. I could leave it as is, but I really dislike
>> > telling people to ignore warnings. It trains you to do the wrong thing.
>> I
>> > would not like to add the repositories stanza to each project.clj file
>> by
>> > hand either because it would be error prone.
>>
>> What is the motivation for wanting this?
>>
>> One of the core values of Leiningen is that every project must be
>> repeatably buildable from nothing but the source and access to remote
>> (hopefully immutable) dependency repositories. Adding inputs to the
>> process from other places can look convenient in the short term, but
>> like dynamic binding it introduces subtle, difficult-to-trace problems.
>>
>> -Phil
>>
>
>