开发者

Java files needing to be hosted on SVN

I will be hosting a java project on SVN which will need to be downloaded by other developers with the ability of that project to be compiled / packaged on their local machine.

I would like to know what files are needing to be stored on SVN and which ones can be left out. I know the files that Netbeans creates can be left out and the build.xml will need to be included as it has code to package the libraries used in the project into the .jar file.

I am assuming that the following need to be stored on the SVN server:

/lib
/src
build.xml
  • Does any of the files in the nbproject folder need to be added?

  • If not what svn commands (IE svn-ignore) will I n开发者_C百科eed to run to ignore all the files except for those in /lib, /src and the build.xml file?

  • What should my file structure on the svn look like? Should I keep the source files in the src directory on svn or should I name the folder something else so the developer can then "Create a new project from existing source"?


You shouldn't host you lib directory on your SVN, you can use Ivy or Maven as a dependencies manager which will download all your dependency from a repository.

Concerning the netbeans files it depends on the way your team work, I would say that you can let them on the SVN it will be useful for other developers using netbeans and shouldn't bother developers using another IDE.


For the svn:ignore part you have to do svn propset svn:ignore dirname . in command line.


A general file structure is :

/svn
|-projectName/
 |-branches/
 |-tags/
 |-trunk/
  |-projectName/ (Sometimes this directory doesn't exists and its content is put right into trunk)
   |-pom.xml (Maven !)
   |-module1Name/
    |-src/
     |-main/
      |-java/
      |-resources/
     |-test/
      |-java/
      |-resources/
    |-pom.xml (Maven !)
   |-module2Name/
   |-module3Name/

Resources :

  • Apache Ivy
  • Apache Maven
  • Subversion - svn:ignore

On the same topic :

  • Which files should be imported in a subversion repository for a web services project? -How to ignore a directory with SVN?


I decided to take another route. While I had read your original post about using Maven, we are wanting to stay away from Maven as we are basically just writing a command line interface for an existing library.

Another reason I decided to do what I did was during adding my svn:ignore's I realized that some of the developers here keep their netbeans project settings in different directories which would basically not do any good since it wouldn't be an svn working copy in that dir.

So what I did was just add the /src and /lib directory to the repo.

The end user then checksout the repo with svn co svn+ssh://path/to/repo/trunk . and then will open netbeans and select "Create project from existing source". At which point they will go in and add the library from the /lib directory.

I have Up Voted your answer as it would have been very helpful should I of gone through with using Maven.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜