tags:

views:

99

answers:

2

Our build is a standard maven2 build running surefire on jdk 1.5. I know that some of the tests are connecting to the internet to resolve schemas/dtds because they use a loong time when the internet connection is down. How do I stop this ?

A: 

You should run it in offline mode. That's a -o on the command line.

Otherwise you could mirror the remote repository locally, and add the local repo to your settings.xml

<project>
  ...
  <repositories>
    <repository>
      <id>my-internal-site</id>
      <url>http://myserver/repo&lt;/url&gt;
    </repository>
  </repositories>
  ...
</project>

edit: I could be answering the wrong question here, so please clarify.

Nathan
+1  A: 

The connection is done by your tests while parsing some XML, not by maven itself. To check just start them outside of maven, i.e. in eclipse.

If you can control the files you parse, and it is acceptable, or just as a quick check, you could remove the definitions from your XMLs (a dirty hack). Better is however to configure the CatalogManager through a CatalogManager.properties file, where you could specify custom XML catalogs, e.i. pointing to the resources locally.

siddhadev