Hello,

It is quite possible I misunderstood the purpose of a mirror.  A few
questions to ensure we're truly configured to do what we think we're
doing...

I read the link on repositories you noted and want to clarify one statement
from that article...



> By default, Maven will download from the central repository.  To override
> this, you need to specify a repositories element .... You can set this in
> your settings.xml file to globally use a certain mirror, however note that
> it is common for a project to customise the repository in their pom.xml
> and that your setting will take precedence.  If you find that dependencies
> are not being found, check you have not overridden the remote repository.
> 

Since we have many projects, we do set our internal repository in
settings.xml as opposed to in each project pom.  So if we have a third party
artifact - abc.jar - and its pom has a repo specified, will Maven still
attempt to reach out to that repo?  Note that we set our internal repo
within a <repository>, not a mirror.  The article stated "to globally use a
certain mirror", so that makes me wonder if we truly override anything with
just the <repository> entry.  

The section in that article discussing internal repositories also matches
what we do.  We have Maven download the new artifacts from an external repo,
we manually review and approve them, and then we upload them to our internal
repo for mass consumption in our projects.

Where I may have been confused was reading this link: 

http://maven.apache.org/guides/mini/guide-mirror-settings.html

Under the heading "Using a Single Repository" it states



> You can force Maven to use a single repository by having it mirror all
> repository requests. The repository must contain all of the desired
> artifacts, or be able to proxy the requests to other repositories. This
> setting is most useful when using an internal company repository with the
> Maven Repository Manager to proxy external requests.
> 

The main confusion or area of concern for me is on how Maven handles those
situations where a third party pom specifies an external repository.  If
only specifying the internal repo in our settings.xml file within a
<repository> tag set overrides the third party pom and prevents Maven from
downloading, great.  But if it does not, and Maven still attempts to reach
out externally, then that is where I thought we may need the mirror to
ensure nothing reaches out externally.  If we did need the mirror, then that
is where I was curious if there was a way to avoid manually commenting it
out in settings.xml so we could locally download new artifacts from an
external repo in preparation for adding them to our internal repo.

Hope that makes sense.  Appreciate your patience, Maven seems pretty
powerful, but there also seems to be a fair amount of details one needs to
dig into to make sure the "magic" isn't doing something behind the scenes we
don't want.



Alexander-129 wrote:
> 
> Hello,
> 
> I think you are misusing mirrors. Really. [?]
> 
> Please be sure you read this
> http://maven.apache.org/guides/introduction/introduction-to-repositories.html
> 
> Just add your internal repository to pom.xml as additional repository and
> configure project to deploy your artifacts into internal repository. And
> there won't be any need to switch between profiles.
> 
> Regards,
> Alexander
> 

-- 
View this message in context: 
http://www.nabble.com/Setting-Mirror-properties-by-profile--tp24738774p24748903.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to