在两个Netbeans项目之间共享源代码

时间:2023-01-18 09:22:20

I have an existing Java project in Netbeans (a JSF web application). I'd like to experiment with GWT in a separate project - put pull in source from the original project. Is there any way to share source between two Netbeans projects.

我在Netbeans中有一个现有的Java项目(一个JSF Web应用程序)。我想在一个单独的项目中试验GWT - 从原始项目中获取源代码。有没有办法在两个Netbeans项目之间共享源代码。

When I attempt to add the source directory from the original project into the new the IDE complains that the source is already part of another project.

当我尝试将原始项目中的源目录添加到新项目时,IDE会抱怨源已经是另一个项目的一部分。

3 个解决方案

#1


2  

If you're only experimenting then copy the necessary part of the existing project to a different directory. Of course changes won't be synchronized later.

如果您只是进行实验,则将现有项目的必要部分复制到其他目录。当然,以后的更改不会同步。

If you'd like to keep both projects alive then create a separate project with the common code, and use it as a library.

如果您希望保持两个项目都处于活动状态,则使用公共代码创建一个单独的项目,并将其用作库。

#2


0  

Use source control. With CVS, use modules. With Subversion, use svn:externals.

使用源代码管理。使用CVS,使用模块。使用Subversion,使用svn:externals。

#3


0  

Alternatively, try moving the source folder outside both project folders. Then add the source to each project. Do not have both projects open at the same time.

或者,尝试将源文件夹移动到两个项目文件夹之外。然后将源添加到每个项目。不要同时打开这两个项目。

#1


2  

If you're only experimenting then copy the necessary part of the existing project to a different directory. Of course changes won't be synchronized later.

如果您只是进行实验,则将现有项目的必要部分复制到其他目录。当然,以后的更改不会同步。

If you'd like to keep both projects alive then create a separate project with the common code, and use it as a library.

如果您希望保持两个项目都处于活动状态,则使用公共代码创建一个单独的项目,并将其用作库。

#2


0  

Use source control. With CVS, use modules. With Subversion, use svn:externals.

使用源代码管理。使用CVS,使用模块。使用Subversion,使用svn:externals。

#3


0  

Alternatively, try moving the source folder outside both project folders. Then add the source to each project. Do not have both projects open at the same time.

或者,尝试将源文件夹移动到两个项目文件夹之外。然后将源添加到每个项目。不要同时打开这两个项目。