Germany is nearing an agreement to unlock €3 billion of military aid for Ukraine, alongside a broader set of measures to revamp the country’s defense and infrastructure.