[Beginners Corner] - Re: A true newbie -- Please help!
by PeterJ
Change your jar task, the part for including persistence.xml, as follows:
<fileset dir="${basedir}">
| <include name="META-INF/*.xml"/>
| </fileset>
Your build directory layout has room for improvement. Personally, I prefer the directory structured enforced by Maven (or a slightly-modified version of that stucture). This structure clearly separates source, build and built/created artifacts. Your current layout has all of these artifacts mixed together into a single directory which makes setting up filesets for various ant tasks more complex than what is necessary.
I also highly recommend that you add package declarations into your Java source files. I have seen issues with using package-less classes and chasing down such an issue is something that you should not have to worry about. Also, I don't want to have to research if package-less classes are an issue in EJB.
Here are my recommendations:
1) Add the following line as the first line to each of your Java source files:
package org.rij;
2) Change your directory structure so that it looks like this:
build.xml
src/main/java/org/rij/*.java (all your source code goes here)
src/main/resources/META-INF/persistence.xml
src/main/resources/jndi.properties (see note below)
3) After the build is done, it should generate these artifacts:
target/classes/org/rij/*.class (all of the class files)
target/classes/META-INF/persistence.xml
target/mojo.jar
4) Change your build.xml to reflect the above inputs and outputs. I think you will find that the task definitions become much easier. For example, the jar task, which runs after the javac task which compiles the src/main/java source files to target/classes, and the copy task which copies the contents of src/main/resources to target/class becomes simply:
<jar jarfile="target/mojo.jar" basedir="target/classes" />
No messy includes or excludes!
Here are excerpts for the javac and copy task mentioned above, showing the correct directory references (I hard-coded them, you will of course want to set properties and use those)
<javac srcdir="src/main/java" destdir="target/classes" ... />
|
| <copy todir="target/classes">
| <fileset dir="src/main/resources" />
| </copy>
P.S. I hope I don't have too many typos in my code examples...
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217162#4217162
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217162
17 years, 1 month
[JBoss Tools (users)] - Re: Feedback on the Smooks editor
by max.andersen@jboss.com
No matter if we use a custom classloader we would need to have a *very* stable API to do this since we would compile against liet say Smooks 1.0 would our code be able to use Smooks 1.1, 1.2 etc. without updating the binaries ? - does Smooks provide that ?
And what about the model that we load - is that stable ? I'm asking since I don't know :)
About partial documents then users don't have syntax correct files - they type and it will be imperfect. That would mean as soon as the user type the graphical editor would not be able to show anything - that might be ok as you write it.
Another issue is that Smooks might not be able to load any of the related classes referred to in the editor because the classes are not compiled yet - does it support that ?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217155#4217155
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217155
17 years, 1 month