Detecting main shaft bearing anomaly is crucial to ensure the safe operation of wind turbines. However, existing anomaly detection methods have a limitation that anomaly samples are required for hyper-parameters tuning. Because of the scarcity of anomaly samples in the real-world scenarios, it is difficult to implement such existing methods in real-world applications. This paper proposes an end-to-end anomaly detection algorithm named one-class Shapelet dictionary learning. Firstly, the loss function of Shapelet dictionary learning is modified by integrating a soft-boundary term, so that the features and decision boundary can be learnt jointly. Then, a hyper-parameter setting strategy is introduced, so that anomaly samples are not needed in the training stage. The proposed method is validated through a case study collected from a real-world wind power farm. Results shown that the proposed method has a better F1 score than all baselines while anomaly samples are totally banded in the training stage.