@Ramon I ran into the same problem for the North Africa game. You need to make sure a land territory is adjacent to every sea territory using canal attachments.
<attachment foreach="$SeaZones$" name="canalAttachmentSeaMine@SeaZones@" attachTo="A-B" javaClass="CanalAttachment" type="territory">
<option name="canalName" value="Sea Mine @SeaZones@"/>
<option name="landTerritories" value="A-B"/>
<option name="excludedUnits" value="none"/>
</attachment>
The code above makes sure every sea zone gets canal attached to the territory A-B, which is a territory belonging to a special player that deals with the mines. This way, this player is able to place sea mines in every territory. For your game, you would need to do this for every player in your game. You should attach the canal to a territory that is likely to be owned by that player for the entire game. I believe it doesn't need to be adjacent to a factory. If you make the sea mine a construction and have the relevant properties at the correct settings, I think you can get away with it.
You can create canal attachments to every sea zone and every player using a nested foreach:
<attachment foreach="$SeaZones$^$Territories$" name="canalAttachmentSeaMine@Territories@@SeaZones@" attachTo="@SeaZones@" javaClass="CanalAttachment" type="territory">
<option name="canalName" value="Sea Mine @Territories@ @SeaZones@"/>
<option name="landTerritories" value="@Territories@"/>
<option name="excludedUnits" value="none"/>
</attachment>
You also need one attached to the territories:
<!-- NOTICE THAT THIS ONE SAYS attachTo="@Territories@" -->
<attachment foreach="$SeaZones$^$Territories$" name="canalAttachmentSeaMine@Territories@@SeaZones@" attachTo="@Territories@" javaClass="CanalAttachment" type="territory">
<option name="canalName" value="Sea Mine @Territories@ @SeaZones@"/>
<option name="landTerritories" value="@Territories@"/>
<option name="excludedUnits" value="none"/>
</attachment>
and variable lists (this should be below diceSides at the top of the XML):
<variableList>
<variable name="SeaZones">
<element name="Sea Zone 1"/>
<element name="Sea Zone 2"/>
<element name="Sea Zone 3"/>
...
<variable name="Territories">
<element name="Algiers Convoy UK"/>
<element name="Algiers Convoy US"/>
<element name="Atlantic Ocean Convoy"/>
...
SeaZones should be a list containing all sea zones in the game. Territories should contain one territory for every player in the game that acts as the "sea mine base". If this territory is controlled by that player, they should be able to place sea mines in any sea zone. It can be a land-locked territory. You could for example put every player's capital territory in the list Territories, as if the capital is taken you cannot produce units anyway.
Also, you need to specify connections between the territories and every sea zones in the connection list:
<connection t1="A-B" t2="Sea Zone 1"/>
<connection t1="A-B" t2="Sea Zone 2"/>
<connection t1="A-B" t2="Sea Zone 3"/>