Alibaba said on Monday that it will invest $2.87 billion for a major stake in China's top hypermart operator.