with a grails project, do you put java code inside the s开发者_StackOverflowame project or do you have to somehow import the java libraries you created from another java project?
I put any java source in the src/java directory and it gets automatically compiled when I run the app. When I have jar files with out associated code such as third party libraries or librarys from another group in the company I just drop them in the lib directory and grails automatically allows you to use them.
Both alternatives you mention work fine. IIRC, Grails even automatically creates a "java" source folder for your Java classes.
In addition, if you use Maven for the Java project, you can set pom=true in the BuildConfig.groovy file and create a dependency on the original JAR; it will get pulled in with each build.
精彩评论