You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Eric Kolotyluk <er...@gmail.com> on 2014/03/19 21:23:08 UTC

Open Source Best Practices with Maven - distributionManagement

Does anyone know of any good documentation on 'Open Source Best 
Practices with Maven'

For example, in my POM, I want to set up

   <distributionManagement>
<downloadUrl>http://localhost:8081/nexus/content/groups/public</downloadUrl>
     <repository>
       <uniqueVersion>false</uniqueVersion>
       <id>nexus-kolotyluk</id>
       <name>Local Release Repository</name>
<url>http://localhost:8081/nexus/content/repositories/releases</url>
       <layout>default</layout>
     </repository>
     <snapshotRepository>
       <id>nexus-kolotyluk</id>
       <name>Local Snapshot Repository</name>
<url>http://localhost:8081/nexus/content/repositories/snapshots</url>
       <layout>default</layout>
     </snapshotRepository>
   </distributionManagement>

But that is my local repository on my development computer.

If I want to push my project to Maven Central some day, I don't think I 
want this in my POM.

Should I put this in a parent POM, or inside a <profile> of my 
settings.xml file?

If I put it in a parent POM, then I need to push that to Maven Central 
too, so that does not sound like a good idea.

Cheer, Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Open Source Best Practices with Maven - distributionManagement

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Eric,

> Should I put this in a parent POM

Here is how my projects do it:
http://search.maven.org/remotecontent?filepath=org/scijava/pom-scijava/1.150/pom-scijava-1.150.pom

Note in particular the profiles at the bottom.

We use this pom-scijava as parent for all our stuff. To deploy to OSS
Sonatype (which gets mirrored to Central), we use the
"sonatype-oss-release" profile which is structured according to the guide
at:
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide

For artifacts which are still incubating and not yet ready for Central, we
deploy to our own Maven repository (http://maven.imagej.net/) using a
"deploy-to-imagej" profile.

So yes, with this solution, the pom-scijava on Central does contain a
reference to our Maven repository, but only in a profile so as not to
infect anyone else's builds with it by default.

> or inside a <profile> of my settings.xml file?

My rule of thumb is: you should not have to touch a settings.xml just to
build the code. Any solution requiring that, IMHO, makes things too
difficult. It's fine if you have to touch settings.xml to *deploy*
artifacts, or to configure a proxy for performance, but not just for
building.

Regards,
Curtis


On Wed, Mar 19, 2014 at 3:23 PM, Eric Kolotyluk <er...@gmail.com>wrote:

> Does anyone know of any good documentation on 'Open Source Best Practices
> with Maven'
>
> For example, in my POM, I want to set up
>
>   <distributionManagement>
> <downloadUrl>http://localhost:8081/nexus/content/groups/public
> </downloadUrl>
>     <repository>
>       <uniqueVersion>false</uniqueVersion>
>       <id>nexus-kolotyluk</id>
>       <name>Local Release Repository</name>
> <url>http://localhost:8081/nexus/content/repositories/releases</url>
>       <layout>default</layout>
>     </repository>
>     <snapshotRepository>
>       <id>nexus-kolotyluk</id>
>       <name>Local Snapshot Repository</name>
> <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
>       <layout>default</layout>
>     </snapshotRepository>
>   </distributionManagement>
>
> But that is my local repository on my development computer.
>
> If I want to push my project to Maven Central some day, I don't think I
> want this in my POM.
>
> Should I put this in a parent POM, or inside a <profile> of my
> settings.xml file?
>
> If I put it in a parent POM, then I need to push that to Maven Central
> too, so that does not sound like a good idea.
>
> Cheer, Eric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Open Source Best Practices with Maven - distributionManagement

Posted by Eric Kolotyluk <er...@gmail.com>.
Actually, I did set these properties up in my settings.xml file :-)

Great minds think alike ;-)

Cheers, Eric

On 3/19/2014 3:53 PM, Mark Struberg wrote:
> You could also add those properties into a profile in your settings.xml. That way you don't even have the url in the projects pom anymore.
> Downside: this needs to be set up on each of your colleagues computers.
>
> LieGrue,
> strub
>
>
>
>
>
> On Wednesday, 19 March 2014, 23:16, Eric Kolotyluk <er...@gmail.com> wrote:
>   
> OK, this was great advice. :-)
>> This works nicely because I do not have to have separate profiles in my
>> pom.xml for my local Nexus or Sonatype's remote one. This keeps the
>> pom.xml smaller.
>>
>> This would be a nice narrative to add to
>> https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
>>
>> Getting arbitrarily closer to pushing my first artifact ever to Maven
>> Central...
>>
>> Cheers, Eric
>>
>> On 3/19/2014 2:15 PM, Mirko Friedenhagen wrote:
>>> Hello Eric,
>>>
>>> as outlined in https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html
>>> in your settings.xml you might define properties
>>> altReleaseDeploymentRepository and altSnapshotDeploymentRepository in
>>> a profile internal-repository which is activated by default while you
>>> do not define any repository at all in your pom.
>>> Now while developing you just invoke mvn deploy and everything should
>>> go to your local Nexus.
>>> When invoking mvn -P!internal-repository everything should go to central.
>>> Regards Mirko
>>> --
>>> http://illegalstateexception.blogspot.com/
>>> https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
>>> https://bitbucket.org/mfriedenhagen/
>>>
>>>
>>> On Wed, Mar 19, 2014 at 9:39 PM, Stevo Slavić <ss...@gmail.com> wrote:
>>>> Hello Eric,
>>>>
>>>> I'd consider using Sonatype OSS with Sonatype OSS parent pom and everything
>>>> that goes along (see more details at
>>>> https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide)
>>>> For OSS development maybe use private (and not local) Nexus as proxy only,
>>>> with mirrors defined in local settings.xml, but publish both snapshots and
>>>> releases to Sonatype OSS repositories which get synced to Maven Central.
>>>> Why run Nexus on local machine? To control dependencies and their metada
>>>> for yourself only? Still looks as overkill to me, if you're the sole user
>>>> and plan on developing OSS. You already have local repository, and you
>>>> should have same experience as your OSS users (so no custom local metadata
>>>> of dependencies, depend only on stuff available on Maven Central, with
>>>> metadata as it is published on Maven Central).
>>>>
>>>> Kind regards,
>>>> Stevo Slavic
>>>>
>>>>
>>>> On Wed, Mar 19, 2014 at 9:23 PM, Eric Kolotyluk <er...@gmail.com>wrote:
>>>>
>>>>> Does anyone know of any good documentation on 'Open Source Best Practices
>>>>> with Maven'
>>>>>
>>>>> For example, in my POM, I want to set up
>>>>>
>>>>>      <distributionManagement>
>>>>> <downloadUrl>http://localhost:8081/nexus/content/groups/public
>>>>> </downloadUrl>
>>>>>        <repository>
>>>>>          <uniqueVersion>false</uniqueVersion>
>>>>>          <id>nexus-kolotyluk</id>
>>>>>          <name>Local Release Repository</name>
>>>>> <url>http://localhost:8081/nexus/content/repositories/releases</url>
>>>>>          <layout>default</layout>
>>>>>        </repository>
>>>>>        <snapshotRepository>
>>>>>          <id>nexus-kolotyluk</id>
>>>>>          <name>Local Snapshot Repository</name>
>>>>> <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
>>>>>          <layout>default</layout>
>>>>>        </snapshotRepository>
>>>>>      </distributionManagement>
>>>>>
>>>>> But that is my local repository on my development computer.
>>>>>
>>>>> If I want to push my project to Maven Central some day, I don't think I
>>>>> want this in my POM.
>>>>>
>>>>> Should I put this in a parent POM, or inside a <profile> of my
>>>>> settings.xml file?
>>>>>
>>>>> If I put it in a parent POM, then I need to push that to Maven Central
>>>>> too, so that does not sound like a good idea.
>>>>>
>>>>> Cheer, Eric
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Open Source Best Practices with Maven - distributionManagement

Posted by Mark Struberg <st...@yahoo.de>.
You could also add those properties into a profile in your settings.xml. That way you don't even have the url in the projects pom anymore.
Downside: this needs to be set up on each of your colleagues computers.

LieGrue,
strub





On Wednesday, 19 March 2014, 23:16, Eric Kolotyluk <er...@gmail.com> wrote:
 
OK, this was great advice. :-)
>
>This works nicely because I do not have to have separate profiles in my 
>pom.xml for my local Nexus or Sonatype's remote one. This keeps the 
>pom.xml smaller.
>
>This would be a nice narrative to add to 
>https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
>
>Getting arbitrarily closer to pushing my first artifact ever to Maven 
>Central...
>
>Cheers, Eric
>
>On 3/19/2014 2:15 PM, Mirko Friedenhagen wrote:
>> Hello Eric,
>>
>> as outlined in https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html
>> in your settings.xml you might define properties
>> altReleaseDeploymentRepository and altSnapshotDeploymentRepository in
>> a profile internal-repository which is activated by default while you
>> do not define any repository at all in your pom.
>> Now while developing you just invoke mvn deploy and everything should
>> go to your local Nexus.
>> When invoking mvn -P!internal-repository everything should go to central.
>> Regards Mirko
>> --
>> http://illegalstateexception.blogspot.com/
>> https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
>> https://bitbucket.org/mfriedenhagen/
>>
>>
>> On Wed, Mar 19, 2014 at 9:39 PM, Stevo Slavić <ss...@gmail.com> wrote:
>>> Hello Eric,
>>>
>>> I'd consider using Sonatype OSS with Sonatype OSS parent pom and everything
>>> that goes along (see more details at
>>> https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide)
>>> For OSS development maybe use private (and not local) Nexus as proxy only,
>>> with mirrors defined in local settings.xml, but publish both snapshots and
>>> releases to Sonatype OSS repositories which get synced to Maven Central.
>>> Why run Nexus on local machine? To control dependencies and their metada
>>> for yourself only? Still looks as overkill to me, if you're the sole user
>>> and plan on developing OSS. You already have local repository, and you
>>> should have same experience as your OSS users (so no custom local metadata
>>> of dependencies, depend only on stuff available on Maven Central, with
>>> metadata as it is published on Maven Central).
>>>
>>> Kind regards,
>>> Stevo Slavic
>>>
>>>
>>> On Wed, Mar 19, 2014 at 9:23 PM, Eric Kolotyluk <er...@gmail.com>wrote:
>>>
>>>> Does anyone know of any good documentation on 'Open Source Best Practices
>>>> with Maven'
>>>>
>>>> For example, in my POM, I want to set up
>>>>
>>>>    <distributionManagement>
>>>> <downloadUrl>http://localhost:8081/nexus/content/groups/public
>>>> </downloadUrl>
>>>>      <repository>
>>>>        <uniqueVersion>false</uniqueVersion>
>>>>        <id>nexus-kolotyluk</id>
>>>>        <name>Local Release Repository</name>
>>>> <url>http://localhost:8081/nexus/content/repositories/releases</url>
>>>>        <layout>default</layout>
>>>>      </repository>
>>>>      <snapshotRepository>
>>>>        <id>nexus-kolotyluk</id>
>>>>        <name>Local Snapshot Repository</name>
>>>> <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
>>>>        <layout>default</layout>
>>>>      </snapshotRepository>
>>>>    </distributionManagement>
>>>>
>>>> But that is my local repository on my development computer.
>>>>
>>>> If I want to push my project to Maven Central some day, I don't think I
>>>> want this in my POM.
>>>>
>>>> Should I put this in a parent POM, or inside a <profile> of my
>>>> settings.xml file?
>>>>
>>>> If I put it in a parent POM, then I need to push that to Maven Central
>>>> too, so that does not sound like a good idea.
>>>>
>>>> Cheer, Eric
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>

Re: Open Source Best Practices with Maven - distributionManagement

Posted by Eric Kolotyluk <er...@gmail.com>.
OK, this was great advice. :-)

This works nicely because I do not have to have separate profiles in my 
pom.xml for my local Nexus or Sonatype's remote one. This keeps the 
pom.xml smaller.

This would be a nice narrative to add to 
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide

Getting arbitrarily closer to pushing my first artifact ever to Maven 
Central...

Cheers, Eric

On 3/19/2014 2:15 PM, Mirko Friedenhagen wrote:
> Hello Eric,
>
> as outlined in https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html
> in your settings.xml you might define properties
> altReleaseDeploymentRepository and altSnapshotDeploymentRepository in
> a profile internal-repository which is activated by default while you
> do not define any repository at all in your pom.
> Now while developing you just invoke mvn deploy and everything should
> go to your local Nexus.
> When invoking mvn -P!internal-repository everything should go to central.
> Regards Mirko
> --
> http://illegalstateexception.blogspot.com/
> https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
> https://bitbucket.org/mfriedenhagen/
>
>
> On Wed, Mar 19, 2014 at 9:39 PM, Stevo Slavić <ss...@gmail.com> wrote:
>> Hello Eric,
>>
>> I'd consider using Sonatype OSS with Sonatype OSS parent pom and everything
>> that goes along (see more details at
>> https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide)
>> For OSS development maybe use private (and not local) Nexus as proxy only,
>> with mirrors defined in local settings.xml, but publish both snapshots and
>> releases to Sonatype OSS repositories which get synced to Maven Central.
>> Why run Nexus on local machine? To control dependencies and their metada
>> for yourself only? Still looks as overkill to me, if you're the sole user
>> and plan on developing OSS. You already have local repository, and you
>> should have same experience as your OSS users (so no custom local metadata
>> of dependencies, depend only on stuff available on Maven Central, with
>> metadata as it is published on Maven Central).
>>
>> Kind regards,
>> Stevo Slavic
>>
>>
>> On Wed, Mar 19, 2014 at 9:23 PM, Eric Kolotyluk <er...@gmail.com>wrote:
>>
>>> Does anyone know of any good documentation on 'Open Source Best Practices
>>> with Maven'
>>>
>>> For example, in my POM, I want to set up
>>>
>>>    <distributionManagement>
>>> <downloadUrl>http://localhost:8081/nexus/content/groups/public
>>> </downloadUrl>
>>>      <repository>
>>>        <uniqueVersion>false</uniqueVersion>
>>>        <id>nexus-kolotyluk</id>
>>>        <name>Local Release Repository</name>
>>> <url>http://localhost:8081/nexus/content/repositories/releases</url>
>>>        <layout>default</layout>
>>>      </repository>
>>>      <snapshotRepository>
>>>        <id>nexus-kolotyluk</id>
>>>        <name>Local Snapshot Repository</name>
>>> <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
>>>        <layout>default</layout>
>>>      </snapshotRepository>
>>>    </distributionManagement>
>>>
>>> But that is my local repository on my development computer.
>>>
>>> If I want to push my project to Maven Central some day, I don't think I
>>> want this in my POM.
>>>
>>> Should I put this in a parent POM, or inside a <profile> of my
>>> settings.xml file?
>>>
>>> If I put it in a parent POM, then I need to push that to Maven Central
>>> too, so that does not sound like a good idea.
>>>
>>> Cheer, Eric
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Site Repository Property was: Open Source Best Practices with Maven - distributionManagement

Posted by Robert Kuropkat <rk...@t-sciences.com>.
Yep, that is one of the many pages I had looked at also.  I was also 
considering the stage-deploy target as I think that actually does have a 
property for URL, but was not sure what other side affects it would have 
since it might be deemed a mis-use of that feature.  I need to 
understand it a little better and its original intent and how that maps 
to our local process.

I also tried setting just a named property in settings.xml and 
referencing that property in the <site><url> tag but since the URL tag 
behavior is to append in a parent-child pom setup, it gets confused.  
Disappointingly, when I look at the effective POM in Eclipse, it looks 
exactly they way I want.  When it actually runs though, it fails.

Robert Kuropkat

P.S.  I am currently using the jackrabbit webdav wagon, but that's just 
because it was the first one I got to work.


On 03/20/2014 04:42 PM, Mirko Friedenhagen wrote:
> Hello Robert,
>
> reading the information at
> https://maven.apache.org/plugins/maven-site-plugin/deploy-mojo.html I
> do not think there is an easy way to do this and probably never will
> be.
>
> 1) AFAIK there is no (central) server available which hosts sites by default.
> 2) As stated on above page, there are a lot of different means to
> deploy the site via wagon (ftp, http, ssh)
> 3) As a workaround you might think about using the site:stage-deploy
> goal instead for your "local" builds.
>
> Regards
> Mirko
>
> Regards Mirko
> --
> http://illegalstateexception.blogspot.com/
> https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
> https://bitbucket.org/mfriedenhagen/
>
>
> On Thu, Mar 20, 2014 at 8:29 PM, Robert Kuropkat
> <rk...@t-sciences.com> wrote:
>> So is there an equivalent to altReleaseDeploymentRepository and
>> altSnapshotDeploymentRepository for the Site Deployment information also?
>> Since all three are in the Distribution Management directive, I was hoping I
>> could define this last one in the settings.xml also.
>>
>> Robert Kuropkat
>>
>>
>> On 03/19/2014 05:15 PM, Mirko Friedenhagen wrote:
>>> Hello Eric,
>>>
>>> as outlined in
>>> https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html
>>> in your settings.xml you might define properties
>>> altReleaseDeploymentRepository and altSnapshotDeploymentRepository in
>>> a profile internal-repository which is activated by default while you
>>> do not define any repository at all in your pom.
>>> Now while developing you just invoke mvn deploy and everything should
>>> go to your local Nexus.
>>> When invoking mvn -P!internal-repository everything should go to central.
>>> Regards Mirko
>>> --
>>> http://illegalstateexception.blogspot.com/
>>> https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
>>> https://bitbucket.org/mfriedenhagen/
>>>
>>>
>>>
>> <snip>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Site Repository Property was: Open Source Best Practices with Maven - distributionManagement

Posted by Mirko Friedenhagen <mf...@gmail.com>.
Hello Robert,

reading the information at
https://maven.apache.org/plugins/maven-site-plugin/deploy-mojo.html I
do not think there is an easy way to do this and probably never will
be.

1) AFAIK there is no (central) server available which hosts sites by default.
2) As stated on above page, there are a lot of different means to
deploy the site via wagon (ftp, http, ssh)
3) As a workaround you might think about using the site:stage-deploy
goal instead for your "local" builds.

Regards
Mirko

Regards Mirko
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
https://bitbucket.org/mfriedenhagen/


On Thu, Mar 20, 2014 at 8:29 PM, Robert Kuropkat
<rk...@t-sciences.com> wrote:
>
> So is there an equivalent to altReleaseDeploymentRepository and
> altSnapshotDeploymentRepository for the Site Deployment information also?
> Since all three are in the Distribution Management directive, I was hoping I
> could define this last one in the settings.xml also.
>
> Robert Kuropkat
>
>
> On 03/19/2014 05:15 PM, Mirko Friedenhagen wrote:
>>
>> Hello Eric,
>>
>> as outlined in
>> https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html
>> in your settings.xml you might define properties
>> altReleaseDeploymentRepository and altSnapshotDeploymentRepository in
>> a profile internal-repository which is activated by default while you
>> do not define any repository at all in your pom.
>> Now while developing you just invoke mvn deploy and everything should
>> go to your local Nexus.
>> When invoking mvn -P!internal-repository everything should go to central.
>> Regards Mirko
>> --
>> http://illegalstateexception.blogspot.com/
>> https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
>> https://bitbucket.org/mfriedenhagen/
>>
>>
>>
> <snip>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Site Repository Property was: Open Source Best Practices with Maven - distributionManagement

Posted by Robert Kuropkat <rk...@t-sciences.com>.
So is there an equivalent to altReleaseDeploymentRepository and 
altSnapshotDeploymentRepository for the Site Deployment information 
also?  Since all three are in the Distribution Management directive, I 
was hoping I could define this last one in the settings.xml also.

Robert Kuropkat


On 03/19/2014 05:15 PM, Mirko Friedenhagen wrote:
> Hello Eric,
>
> as outlined in https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html
> in your settings.xml you might define properties
> altReleaseDeploymentRepository and altSnapshotDeploymentRepository in
> a profile internal-repository which is activated by default while you
> do not define any repository at all in your pom.
> Now while developing you just invoke mvn deploy and everything should
> go to your local Nexus.
> When invoking mvn -P!internal-repository everything should go to central.
> Regards Mirko
> --
> http://illegalstateexception.blogspot.com/
> https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
> https://bitbucket.org/mfriedenhagen/
>
>
>
<snip>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Open Source Best Practices with Maven - distributionManagement

Posted by Mirko Friedenhagen <mf...@gmail.com>.
Hello Eric,

as outlined in https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html
in your settings.xml you might define properties
altReleaseDeploymentRepository and altSnapshotDeploymentRepository in
a profile internal-repository which is activated by default while you
do not define any repository at all in your pom.
Now while developing you just invoke mvn deploy and everything should
go to your local Nexus.
When invoking mvn -P!internal-repository everything should go to central.
Regards Mirko
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
https://bitbucket.org/mfriedenhagen/


On Wed, Mar 19, 2014 at 9:39 PM, Stevo Slavić <ss...@gmail.com> wrote:
> Hello Eric,
>
> I'd consider using Sonatype OSS with Sonatype OSS parent pom and everything
> that goes along (see more details at
> https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide)
> For OSS development maybe use private (and not local) Nexus as proxy only,
> with mirrors defined in local settings.xml, but publish both snapshots and
> releases to Sonatype OSS repositories which get synced to Maven Central.
> Why run Nexus on local machine? To control dependencies and their metada
> for yourself only? Still looks as overkill to me, if you're the sole user
> and plan on developing OSS. You already have local repository, and you
> should have same experience as your OSS users (so no custom local metadata
> of dependencies, depend only on stuff available on Maven Central, with
> metadata as it is published on Maven Central).
>
> Kind regards,
> Stevo Slavic
>
>
> On Wed, Mar 19, 2014 at 9:23 PM, Eric Kolotyluk <er...@gmail.com>wrote:
>
>> Does anyone know of any good documentation on 'Open Source Best Practices
>> with Maven'
>>
>> For example, in my POM, I want to set up
>>
>>   <distributionManagement>
>> <downloadUrl>http://localhost:8081/nexus/content/groups/public
>> </downloadUrl>
>>     <repository>
>>       <uniqueVersion>false</uniqueVersion>
>>       <id>nexus-kolotyluk</id>
>>       <name>Local Release Repository</name>
>> <url>http://localhost:8081/nexus/content/repositories/releases</url>
>>       <layout>default</layout>
>>     </repository>
>>     <snapshotRepository>
>>       <id>nexus-kolotyluk</id>
>>       <name>Local Snapshot Repository</name>
>> <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
>>       <layout>default</layout>
>>     </snapshotRepository>
>>   </distributionManagement>
>>
>> But that is my local repository on my development computer.
>>
>> If I want to push my project to Maven Central some day, I don't think I
>> want this in my POM.
>>
>> Should I put this in a parent POM, or inside a <profile> of my
>> settings.xml file?
>>
>> If I put it in a parent POM, then I need to push that to Maven Central
>> too, so that does not sound like a good idea.
>>
>> Cheer, Eric
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Open Source Best Practices with Maven - distributionManagement

Posted by Stevo Slavić <ss...@gmail.com>.
Hello Eric,

I'd consider using Sonatype OSS with Sonatype OSS parent pom and everything
that goes along (see more details at
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide)
For OSS development maybe use private (and not local) Nexus as proxy only,
with mirrors defined in local settings.xml, but publish both snapshots and
releases to Sonatype OSS repositories which get synced to Maven Central.
Why run Nexus on local machine? To control dependencies and their metada
for yourself only? Still looks as overkill to me, if you're the sole user
and plan on developing OSS. You already have local repository, and you
should have same experience as your OSS users (so no custom local metadata
of dependencies, depend only on stuff available on Maven Central, with
metadata as it is published on Maven Central).

Kind regards,
Stevo Slavic


On Wed, Mar 19, 2014 at 9:23 PM, Eric Kolotyluk <er...@gmail.com>wrote:

> Does anyone know of any good documentation on 'Open Source Best Practices
> with Maven'
>
> For example, in my POM, I want to set up
>
>   <distributionManagement>
> <downloadUrl>http://localhost:8081/nexus/content/groups/public
> </downloadUrl>
>     <repository>
>       <uniqueVersion>false</uniqueVersion>
>       <id>nexus-kolotyluk</id>
>       <name>Local Release Repository</name>
> <url>http://localhost:8081/nexus/content/repositories/releases</url>
>       <layout>default</layout>
>     </repository>
>     <snapshotRepository>
>       <id>nexus-kolotyluk</id>
>       <name>Local Snapshot Repository</name>
> <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
>       <layout>default</layout>
>     </snapshotRepository>
>   </distributionManagement>
>
> But that is my local repository on my development computer.
>
> If I want to push my project to Maven Central some day, I don't think I
> want this in my POM.
>
> Should I put this in a parent POM, or inside a <profile> of my
> settings.xml file?
>
> If I put it in a parent POM, then I need to push that to Maven Central
> too, so that does not sound like a good idea.
>
> Cheer, Eric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>