[Tex/LaTex] How to use external bibdata on IEEE conference paper

bibliographiesieeetran

I want to use external bibdata file in an IEEE conference paper. How to do that? The following code don't prints the references list neither put the number of reference on citation.
(I use this template: http://www.ieee.org/conferences_events/conferences/publishing/templates.html)

%% bare_conf.tex
\documentclass[conference]{IEEEtran}

\begin{document}
\title{XXX}

\author{\IEEEauthorblockN{Lucas F. Lima}
\IEEEauthorblockA{Electrical Engineering Department\\
University of Brasilia - UnB\\
Brasilia, Brazil, Campus Darci Ribeiro\\
Email: unb.lucaslima@gmail.com}
}
\maketitle

\begin{abstract}
%\input{abstr}
\ldots
\end{abstract}

\IEEEpeerreviewmaketitle

\section{Introduction}
\ldots
\cite{papazoglou2007service}

\begin{thebibliography}{1}
\bibliography{bibdata}
\bibliographystyle{IEEEtran}
\end{thebibliography}
\end{document}

Best Answer

You have to remove \begin{thebibliography}{1} and \end{thebibliography}:

\documentclass[conference]{IEEEtran}

\begin{document}
    \cite{papazoglou2007service}

    \bibliography{bibdata}
    \bibliographystyle{IEEEtran}
\end{document}

Then, you need a file bibdata.bib with your bibliography entry, e.g.:

@Article{papazoglou2007service,
  author =  {Jon Doe},
  title =   {Title},
  journal = {Journal},
  year =    {2016}
}

Finally, make sure to run bibtex, which is done automatically, e.g., with latexmk:

latexmk -pdf main.tex