Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to manually disable/blacklist Maven repository

Tags:

In my base project I use dependency of JasperReports which has non-existent repository declaration in its pom. When I run every Maven commad there is dependency looking for commons-collection in this Jasper repository so I need to wait for timeout.
This is my base project and is used as dependency in my others projects so again I need to wait for timeout.
Is there are a way to move this repository to blacklisted or override this settings?

Notes:
1.Why it search in Jasper repository, maybe bacause of ranges

<dependency>     <groupId>commons-collections</groupId>     <artifactId>commons-collections</artifactId>     <version>[2.1,)</version>     <scope>compile</scope> </dependency> 

2.My idea to resolve this problem is to change jasper pom and use proxy repository, but I looking to another option.
3.I use jasperreports 1.3.3 version and I'd like don't change it.

like image 773
cetnar Avatar asked Nov 18 '09 08:11

cetnar


People also ask

How do I override Maven central repository?

By default, Maven will download from the central repository. To override this, you need to specify a mirror as shown in Using Mirrors for Repositories. You can set this in your settings. xml file to globally use a certain mirror.

How do I clean up my local Maven repository?

m2/repository . To clear/delete your local maven repository cache, simply delete the . m2/repository folder. The local repository path can also be configured in Maven setting.

How do I change settings xml in Maven?

Navigate to path {M2_HOME}\conf\ where M2_HOME is maven installation folder. Open file settings. xml in edit mode in some text editor. Update the desired path in value of this tag.


1 Answers

Wouldn't the following tell maven to ignore a specific repository:

    <repository>         <id>repo1.maven</id>         <url>http://repo1.maven.org</url>         <releases>             <enabled>false</enabled>         </releases>         <snapshots>             <enabled>false</enabled>         </snapshots>     </repository> 
like image 118
Fred Haslam Avatar answered Sep 20 '22 06:09

Fred Haslam