I want to generate two jar(one jar just use limited jave source) for one project. which task can be use?

I want to generate two jar(one jar just use limited jave source) for one project. which task can be use?