The main difference I see between Jenkins Freestyle projects and Pipeline is the usage of GUI vs scripting.
Below are some differences in more detail
Freestyle Projects
- Use GUI to add different stages and steps
- More suitable for less complex scenarios
- Good for people who are starting to use Jenkins/ CI solutions
- Can become hard to achieve what you want when your scenario become more complex
Pipeline Jobs
- Use code (Groovy language - this is a Java like language) for giving instructions
- Since, everything in one script you can keep that in the source control and have ability to revert back to an earlier version at any time or keep track of changes made to the script
- Entire, pipeline consists of steps (ex: build, test, deploy etc..)
- Created using a Jenkinsfile
Jenkinsfile can be one of two of below types
- Declarative Pipeline (Requires blue ocean plugin to use graphical pipeline editor)
- Scripted Pipeline
Usage of config.xml
You can append config.xml to the end of the jenkins url(in browser) and view all information related to that job as a xml file. This is also possible for user who do not have write access to that job. Not sure why do you need to store it in the source code.
Freestyle or Pipeline?
In my opinion, go for the pipeline if you have some experience with Jenkins. But if you're using it for the first time or do not have much experience, starting from Freestyle projects is a good idea and eventually you can convert it into a pipeline and achieve much more complex stuff.
Hope this helps :)