You can use the following example in AEM fiddle tools and create a dynamic package.
Adobe Experience Manager Help | Creating Adobe Experience Manager Packages using the JcrPackageManager.API
Here are the steps:
1) Install ACS commons and tools package
2) Open AEM fiddle tool http://localhost:4505/etc/acs-tools/aem-fiddle.html
Select servlet option
tweak the code given in the above link according to your requirement for example execute the query to find out all pages which does not have cq:lastReplicationStatus as activated. Add the results of the query to a collection PathFilterSet
Click run and you are done. No need to build the project
Just write code and run.