After occupying Bosnia it was looking to spread the empire toward the oil fields of the Midle East. Russia was too weak in 1908 to stop it.
History repeats itself today to the smallest detail.
Germany and Austria-Hungary were only looking for a pretext. They needed a war in order to fulfill their aspirations. Little Serbia wins the first battle of World War One. The first victory of the allies. The second onslaught of Austro-Hungarian imperial army.