If you haven't used Maven before, don't stop reading! Just like npm or yarn can make working with JavaScript packages easier, Maven is a very helpful tool when you're working with Java projects - and we only need to use a handful of commands. This is relatively painless and totally worth it if you're looking to integrate Java projects with a ColdFusion application. There are any number of guides for installing Maven, but the official install guide is probably a good place to start. The installation of Apache Maven is a simple process of extracting the archive and adding the bin folder with the mvn command to the PATH. Maven is also available via Homebrew and MacPorts for macOS and Chocolatey for Windows (though I've never tried any of those approaches). You'll know you're good to go when you can run the mvn -version command in your terminal. We're going to use the AntiSamy project on GitHub to build the jars that we need. So, let's hop into the command line and get started.Äownload the project from GitHub: git clone directories into the project: cd antisamy As we'll see later on, this will also enable us to build the jars for any version we want, even if hasn't been released yet. The following command will list the tags, with the most recent first: git tag -n -sort =-creatordateĪt the time I'm writing this, the most recent release is v1.6.6, so we'll check out the code there: git checkout v1.6.6 We could build here, but it's probably better if we checkout a specific release tag before building, so that we know exactly what we're getting. This will result in a warning that You are in 'detached HEAD' state. Time to build our AntiSamy jar: mvn package this is fine - we're not making changes, we're building a version. Maven will do its thing, running tests, compiling dependencies, etc. At the end we should get the message: BUILD SUCCESS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |