简体   繁体   中英

How can I make my NetBeans project more portable?

I have all my libraries in one directory. For each library, I first add them to NetBeans (Tools->Libraries...), then use it in all projects that need it. The problem is this way if I give a copy of my code to someone, they have to add all dependencies again. But more important, they can't compile it with ant (NetBeans uses absolute paths).

So what can I do to make my project more easily portable? Also is there a way to have NetBeans use relative paths in build.xml etc, so that my code can be compiled with ant on other machines?

Thanks

Move from ant to maven or gradle. They manage dependencies automatically by downloading them from public repository. So you do not have to care about dependencies and where they are located.

You can also "improve" your configuration by using environemnt variables into ant script, so each user can hold his libraries where he wants and configure this directory via environment. But this looks like re-inventiong the wheel.

If you what for some reason to stay with ant at least us ivy - the dependency manager for ant that with some efforts does what maven and gradle just do for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM