Frage

We have a Maven project that runs several integration tests. Some of the tests involve spawning child processes like a HSQLDB database, but it could also be that any of the maven plugins might be opening socket connections to places I'm not aware of. That provokes that when running the tests in the jailed environment of the continuous integration server, lot's of logs of failed connections appears while in my local machine everything goes smoothly.

How could I trace all the connections that a given Maven script and all its childs opens?

War es hilfreich?

Lösung

See https://unix.stackexchange.com/questions/30046/logging-outgoing-connections-as-they-happen for answers how to trace network connections by process.

But in case of Maven, most connections are probably to check the status of SNAPSHOT dependencies.

To fix those, you should set up a Maven proxy (like Nexus) in your network and then tell Maven to resolve all dependencies via said proxy. That should reduce external connectivity to almost 0.

Also mvn -X (enable debug mode) should help. Write the output to a log file and grep for http:.

Andere Tipps

Not sure I understand, but to see all network activity on your development machine while you build the project, use wireshark or tcpdump.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top