Duplicate class warnings when using shade plugin
I am building my JAR file using the shade plugin in order to give me an all-in-one JAR artifact which contains all dependency JARs. When I build using "mvn clean install" I always get thousands of message like the following, indicating that there's a duplicate class file in a JAR in the repository, which I assume is coming from the shade plugin when it's doing its thing: [WARNING] We have a duplicate net/sf/cglib/util/StringSwitcher$StringSwitcherKey.class in C:\dev\maven\repository\cglib\cglib-full\2.0.2\cglib-full-2.0.2.jar Is this something I should worry about or is it just an annoyance to live with for now? The resulting JAR artifact works well, maybe this is nothing to worry over, but I want to ask here in case there is something I can fix which will make these warning messages go away. I can't find anything about this using Google, etc. Here's the plugin section from my pom.xml: org.apache.maven.plugins maven-shade-plugin 1.2 package shade junit:junit Thanks in advance for any advice. --James -- View this message in context: http://www.nabble.com/Duplicate-class-warnings-when-using-shade-plugin-tp23951216p23951216.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Tests run fine in NetBeans, but fail using command line Maven
Thanks a lot for your attempts to help me solve this problem. This appears to be unrelated to Maven, sorry to bother this group with a non-Maven issue. --James Geoffrey Wiseman wrote: > > On Tue, Dec 16, 2008 at 5:45 PM, James Adams wrote: > >> Yes I get the same thing from within the IDE -- a full build fails with >> the >> same errors as when using command line. > > > So, if you can run the same tests without Maven and get the same errors, > that seems to point pretty conclusively to the tests themselves. > > I have confirmed this now, it appears to be an issue with the embedded HSQLDB not rolling back after each test. -- View this message in context: http://www.nabble.com/Tests-run-fine-individually%2C-but-some-fail-when-run-as-part-of-%27mvn-install%27-tp21019373p21058948.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Tests run fine in NetBeans, but fail using command line Maven
Geoffrey Wiseman wrote: > > On Tue, Dec 16, 2008 at 5:20 PM, James Adams wrote: > >> The tests run fine when I run them individually using Maven at the >> command >> line (or from within NetBeans or Eclipse -- I don't think the IDE is an >> issue since the same thing happens in the IDE as at the command line): > > > [nod] So, sounds more like a problem with the tests themselves, at this > point, rather than Maven vs. IDE; Can NB run the whole suite at once, and > if > so, does that exhibit the same result? > > Yes I get the same thing from within the IDE -- a full build fails with the same errors as when using command line. > > Failed tests: >> >> >> testSaveDeleteFindAll(com.mycom.network.lifecycle.persistence.dao.MultipleDaoTest) > > > What's the failure that's occurring? > > I am getting errors such as the number of expected objects found in the database are greater than what was expected. I am running my DAO tests using an embedded HSQLDB database, so I expect to start with a fresh table every time, then do some inserts, etc., then do a find call to see how many are in the table, and then make an assertion based on the expected number, and this is where it fails when running a full build. I also get errors for a test which is listening to a message queue for messages to be consumed, and this one fails as often as not during a full build but passes every time when running by itself. -- View this message in context: http://www.nabble.com/Tests-run-fine-individually%2C-but-some-fail-when-run-as-part-of-%27mvn-install%27-tp21019373p21043481.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Tests run fine in NetBeans, but fail using command line Maven
The tests run fine when I run them individually using Maven at the command line (or from within NetBeans or Eclipse -- I don't think the IDE is an issue since the same thing happens in the IDE as at the command line): $ mvn -Dtest=MultipleDaoTest test-compile surefire:test [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'surefire'. [INFO] [INFO] Building lifecycle-manager [INFO]task-segment: [test-compile, surefire:test] [INFO] [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] [INFO] Nothing to compile - all classes are up to date [INFO] [surefire:test] [INFO] Surefire report directory: c:\dev\projects\lifecycle-manager\target\surefire-reports --- T E S T S --- Running com.mycom.network.lifecycle.persistence.dao.MultipleDaoTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.282 sec Results : Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] BUILD SUCCESSFUL [INFO] However if I run a full build I get errors for the same tests which pass individually: $ mvn clean install ... Failed tests: testSaveDeleteFindAll(com.mycom.network.lifecycle.persistence.dao.MultipleDaoTest) I have a simple pom.xml with dependencies, etc., nothing unusual. My tests extend Spring's AbstractTransactionalDataSourceSpringContextTests class, which creates a transaction for each test method and rolls back when the test is complete. Seems pretty vanilla to me, which is why I'm so perplexed. --James Geoffrey Wiseman wrote: > > On Tue, Dec 16, 2008 at 12:48 AM, Marat Radchenko < > slonopotamusor...@gmail.com> wrote: > >> They should. Unless you managed to write them in such way that they >> don't. >> > > So it could be: > >- Issues with the isolation of your tests from each other >- Issues with your Maven project configuration >- Something that Maven enforces that Netbeans does not > > Hard to say without knowing a lot more about what's happening. > > - Geoffrey > -- > Geoffrey Wiseman > http://www.geoffreywiseman.ca/ > > -- View this message in context: http://www.nabble.com/Tests-run-fine-individually%2C-but-some-fail-when-run-as-part-of-%27mvn-install%27-tp21019373p21043070.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Tests run fine in NetBeans, but fail using command line Maven
I have several tests which I can run individually from NetBeans or at the command line and they pass OK, but if I run "mvn clean install" from command line several of these same tests will fail. This seems odd -- shouldn't the tests either pass or fail regardless of whether or not they're being run as a suite within Maven or as individual tests? --James -- View this message in context: http://www.nabble.com/Tests-run-fine-in-NetBeans%2C-but-fail-using-command-line-Maven-tp21019373p21019373.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
How can I determine which dependencies are essential?
I have a few dependencies in my pom.xml which pull in many transitive dependencies, and this results in a huge war artifact. I want to pare down the dependencies using exclusions in order that the resulting war will contain only the jars that it really needs, but my problem is that I don't know how to go about figuring out which dependencies are necessary and which ones can be excluded. Is there a good way to do this other than trial and error? Thanks in advance for any suggestions. --James -- View this message in context: http://www.nabble.com/How-can-I-determine-which-dependencies-are-essential--tf4642363s177.html#a13259688 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to determine the correct group and artifact IDs to use?
This is exactly what I was looking for, thanks so much for your help! --James Wayne Fay wrote: > > This may be helpful: www.mvnrepository.com > > Maven expects that you know something about the dependencies you > require. In the case of javax.xml.ws.Provider, you need to know that > you are looking for JAXWS. Search for JAXWS on that site and you'll > find several hits -- in all likelihood, one of those will be what > you're looking for. > > Wayne > > On 5/30/07, James Adams <[EMAIL PROTECTED]> wrote: >> >> I need to add dependencies in my pom.xml for several packages, but I'm >> not >> sure of what group and artifact ID to use for these. How can you >> determine >> what IDs to use within a dependency element for a package -- is there a >> directory available for this? >> >> For example I know I need a dependency for the package which contains the >> class javax.xml.ws.Provider. How can I determine what IDs to use within a >> dependency element for this? >> >> What would be excellent would be a service similar to Jarhoo except for >> Maven dependencies which would allow you to search for a dependency for a >> specified class -- does such a thing exist? >> >> Thanks in advance for any suggestions. >> >> >> --James >> -- >> View this message in context: >> http://www.nabble.com/How-to-determine-the-correct-group-and-artifact-IDs-to-use--tf3842753s177.html#a10881891 >> Sent from the Maven - Users mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/How-to-determine-the-correct-group-and-artifact-IDs-to-use--tf3842753s177.html#a10883902 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to determine the correct group and artifact IDs to use?
I need to add dependencies in my pom.xml for several packages, but I'm not sure of what group and artifact ID to use for these. How can you determine what IDs to use within a dependency element for a package -- is there a directory available for this? For example I know I need a dependency for the package which contains the class javax.xml.ws.Provider. How can I determine what IDs to use within a dependency element for this? What would be excellent would be a service similar to Jarhoo except for Maven dependencies which would allow you to search for a dependency for a specified class -- does such a thing exist? Thanks in advance for any suggestions. --James -- View this message in context: http://www.nabble.com/How-to-determine-the-correct-group-and-artifact-IDs-to-use--tf3842753s177.html#a10881891 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can Maven generate Ant build files ?
I want to generate build files for Ant (build.xml) which replicate what Maven is doing under the covers when it builds a JAR/WAR/EAR. Can this be done, and if so, how? I was told by a colleague that this can probably be done, but I can't find anything about it in the Maven documentation. Thanks in advance for any suggestions. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to build a EAR with EJB and WAR included ?
As far as doing my complete EAR build with a single Maven command I was unable to get either of the proposed solutions to work. In any event I really appreciate all of the help with this, it has been an informative exercise. Below is a summary of my current solution, which uses a simple shell script to do the overall EAR build/install. I hope this will be a helpful contribution. If anyone sees something which is obviously wrong (which might bite me later) then please point it out. It seems to work well for now. --James -- The project has the following directory layout: C:/dev/myproj-app C:/dev/myproj-core C:/dev/myproj-ejb C:/dev/myproj-web C:/dev/myproj-app Details: - The directory C:/dev/myproj-app has no source code and is used primarily as a substitute for a true root directory under which the other modules would reside if this Maven-preferred directory layout was possible (I am using Eclipse which doesn't allow this sort of hierarchical project directory layout). In the myproj-app/maven directory is a project.xml which has the overall project's , Project Management entries (, , etc.), and entry. These are omitted from the other modules' project.xml files and "inherited" by virtue of having an entry which references this main project.xml. There are no dependencies in this maven/project.xml file. The dependencies section of the myproj-app project's project.xml includes dependencies for the modules which make up the EAR: myproj myproj-core ${pom.currentVersion} jar true myproj myproj-ejb ${pom.currentVersion} ejb true myproj myproj-web ${pom.currentVersion} war / true In the myproj-app project's project.properties file is the following property which is necessary for Maven to generate the EAR's application.xml: maven.ear.appxml.generate = true I have created a script which does the entire EAR build process, listed below: #!/bin/sh #- # build and install the core JAR cd ../myproj-core maven jar:install #- # build and install the EJB JAR cd ../myproj-ejb maven ejb:install #- # build and install the WAR cd ../myproj-web maven war:install #- # build and install the EAR cd ../myproj-app maven ear:install C:/dev/myproj-core Details: -- This project contains the core classes used by all other modules (JavaBeans, util and exception classes, etc.). The project.xml contains only dependencies for the libraries needed for the build. The JAR is built and installed to the local repository by running "maven jar:install". C:/dev/myproj-ejb Details: - This project contains the EJB classes. The project.xml contains dependencies for the libraries needed for the build, as well as for the myproj-core module. The JAR is built and installed to the local repository by running "maven ejb:install". The dependency needed for the core module: myproj myproj-core ${pom.currentVersion} jar true C:/dev/myproj-web Details: - This project contains the Servlet and associated utility classes used by the web module. The project.xml contains dependencies for the libraries needed for the build, a dependency for the EJB module, and a dependency for the myproj-core module. The WAR is built and installed to the local repository by running "maven war:install". The dependencies needed for the core module: myproj myproj-core ${pom.currentVersion} jar true myproj myproj-ejb ${pom.currentVersion} ejb true __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Broken EAR Goal: ear:generate-ear-descriptor
Thanks Michal. How would I have figured this out for myself ? There doesn't look to be a column in any of the Goals documents specifying whether or not a goal can be called directly. --James --- Michal Maczka <[EMAIL PROTECTED]> wrote: > James Adams wrote: > > >It seems that the ear:generate-ear-descriptor goal > is > >not working, at least not for me. Is this a known > >bug, or have I perhaps corrupted my Maven > installation > >in some way ? > > > >Below are the errors I see when running "maven > >ear:generate-ear-descriptor": > > > >- > > > > > > You cannot call "ear:generate-ear-descriptor" goal > directly. > > set maven.ear.appxml.generate to "true" and > generate-ear-descriptor > will be invoked for you... > > Michal > > > > -- > INTERIA.PL >>> http://link.interia.pl/f1853 > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Broken EAR Goal: ear:generate-ear-descriptor
It seems that the ear:generate-ear-descriptor goal is not working, at least not for me. Is this a known bug, or have I perhaps corrupted my Maven installation in some way ? Below are the errors I see when running "maven ear:generate-ear-descriptor": __ __ | \/ |__ _Apache__ ___ | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~ |_| |_\__,_|\_/\___|_||_| v. 1.0.2 build:start: ear:generate-ear-descriptor: [echo] Generating appxml file:" version 1.3 encoding: UTF-8" BUILD FAILED File.. C:\Documents and Settings\jadams\.maven\cache\maven-ear-plugin-1.6\plugin.jelly Element... j:file Line.. 184 Column 7 This tag must have either the 'name' or the 'var' variables defined Total time: 2 seconds Finished at: Thu Feb 17 13:52:18 EST 2005 --- Thanks in advance for any suggestions. --James __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to build a EAR with EJB and WAR included ?
>From what I can tell an eclipse:multiproject goal doesn't even exist. See http://maven.apache.org/reference/plugins/eclipse/goals.html Also I asked about heiracrhical projects in Eclipse yesterday on the MyEclipse support forum and they nixed the idea. See http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-6084.html I will try your approach with the suggested project.properties entries and report back with how things work out. Thanks. --James --- David Jencks <[EMAIL PROTECTED]> wrote: > I think I forgot to mention that the project you run > > multiproject:install in has to have the > project.properties file with > maven.multiproject.includes and > maven.multiproject.excludes in it. I > don't recall if I tested it explicitly but you > should be able to have > things like ../otherproject/foo/project.xml in these > lists, so having > the "root" project at the same level as the actual > subprojects should > be ok. > > What does happen if you have a root directory with > no "code" (src dir), > just the project.properties to set up multiproject, > and you run > eclipse:multiproject? > > I know there are some people using eclipse to work > with Geronimo, which > has a project structure with a root project with no > code, and a lot of > subprojects. I don't know what they use to set up > eclipse however. > > david jencks > > On Feb 17, 2005, at 8:50 AM, James Adams wrote: > > > David your approach looks to be as simple as > possible. > > The only problem is that Eclipse really doesn't > allow > > me to have my entire project under a root > directory, > > hence I'll probably take Arnaud's suggestion and > > create a "root" project at the same level as the > other > > projects/modules. With this arrangement your > solution > > will not work unaltered since if I run "maven > > multiproject:install" from the root project > directory > > it doesn't know about any subprojects since > they're > > all on the same level as the root project, instead > of > > under it. With this in mind is there still a way > to > > make your solution work ? Everything I've tried > so > > far has bombed. Maybe it's just as easy to use > > Arnaud's suggested solution ? > > > > Thanks in advance, I really appreciate the help. > > > > > > --James > > > > > > > >> there's a simpler way... > >> > >> in each subproject include a project.properties > file > >> with (at least) a line like > >> > >> maven.multiproject.type=ejb > >> > >> (or war, rar, jar, ear, plugin etc depending what > it > > > >> is) > >> > >> then on the top level project > >> > >> maven multiproject:install > >> > >> will build and install all the subprojects. > >> > >> I don't use eclipse but I thought that the > eclipse > >> plugin handled multiproject structures. Try > maven > >> eclipse:multiproject and see what happens. > >> > >> david jencks > > > > > > > > > > __ > > Do you Yahoo!? > > Yahoo! Mail - You care about security. So do we. > > http://promotions.yahoo.com/new_mail > > > > > - > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Creating a SAR for JBoss MBeans
I would like to create a SAR which contains JMX MBean classes and a META-INF with a deployment descriptor. Essentially the layout of the SAR file is the same as an EJB JAR, but I suspect that I shouldn't be using the ejb plugin for this. However I don't see any other plugins which look to be appropriate to this task. Is there a plugin:goal for this task, or will I need to cook one up myself ? Is there a special directory I need to have under src so that the goal will pick up the META-INF/* files (such as src/ejb for ejb, src/application for ear, etc.) ? To clarify things here is what I want my SAR file to contain: com.mycompany.myproject.management.MyClass.class com.mycompany.myproject.management.MyClassMBean.class META-INF/jboss-service.xml Thanks in advance. --James __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to build a EAR with EJB and WAR included ?
David your approach looks to be as simple as possible. The only problem is that Eclipse really doesn't allow me to have my entire project under a root directory, hence I'll probably take Arnaud's suggestion and create a "root" project at the same level as the other projects/modules. With this arrangement your solution will not work unaltered since if I run "maven multiproject:install" from the root project directory it doesn't know about any subprojects since they're all on the same level as the root project, instead of under it. With this in mind is there still a way to make your solution work ? Everything I've tried so far has bombed. Maybe it's just as easy to use Arnaud's suggested solution ? Thanks in advance, I really appreciate the help. --James > there's a simpler way... > > in each subproject include a project.properties file > with (at least) a line like > > maven.multiproject.type=ejb > > (or war, rar, jar, ear, plugin etc depending what it > is) > > then on the top level project > > maven multiproject:install > > will build and install all the subprojects. > > I don't use eclipse but I thought that the eclipse > plugin handled multiproject structures. Try maven > eclipse:multiproject and see what happens. > > david jencks __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to build a EAR with EJB and WAR included ?
Thanks Arnaud, this looks like a perfect solution. Unfortunately I have two problems which I'm not sure how to handle: 1. When I try the proposed solution I get an exception complaining about the j element not being bound. For example: Fatal Error [line 4, row 40]: The prefix "j" for element "j:set" is not bound. org.apache.maven.MavenException: Error parsing plugin script Am I perhaps missing a Maven component which is not part of the default distribution ? 2. Because I am using Eclipse I cannot have all of my projects in subdirectories under a main project directory. Hence I have the myproj-app project which I'm using to build the EAR (there is no code in that project, it's just there for Maven build purposes). It's this project's directory that I'm using as a faux root directory. Essentially my directory layout looks like this: C:\dev\myproj-app C:\dev\myproj-ejb C:\dev\myproj-util C:\dev\myproj-web For testing the proposed solution I have created a maven.xml and project.properties in C:\dev. However I would like to have the myproj-app directory be the place where the original maven command is called. I am planning to do something like the below in the maven.xml and project.properties under C:\dev\myproj-app: --- maven.xml --- --- project.properties --- # Multiproject properties maven.multiproject.includes=../myproj-ejb/project.xml,../myproj-util/project.xml,../myproj-web/project.xml maven.multiproject.excludes=project.xml Does this look reasonable ? (I can't test it myself until I resolve issue #1 above, as it gives the same exceptions.) Thanks... --James --- Arnaud HERITIER <[EMAIL PROTECTED]> wrote: > You're right, you can't do it by default. > But to do it, it's "very" simple. > > In each subproject you create a maven.xml file with > : > > - in myproj-util : > >prereqs="jar:install"/> > > > - in myproj-ejb : > >prereqs="ejb:install"/> > > > - in myproj-web : > >prereqs="war:install"/> > > > - in myproj-app : > >prereqs="ear:install"/> > > > > And in your project's root : > A maven.xml file : > > > > > > > > A project.properties file : > > # Multiproject properties > maven.multiproject.includes=**/project.xml > maven.multiproject.excludes=project.xml > > > You type in your root directory : maven :-) > > Arnaud > > > > -Message d'origine- > > De : James Adams [mailto:[EMAIL PROTECTED] > > Envoyé : mercredi 16 février 2005 22:27 > > À : Maven Users List > > Objet : Re: How to build a EAR with EJB and WAR > included ? > > > > Thanks for the help so far. After some initial > confusion > > I've come up with a working solution. I have > broken my > > project up into three separate projects > (myproj-util, > > myproj-ejb, and myproj-web) and created an overall > project > > for creating the EAR (myproj-app). > > I found > > > http://www-106.ibm.com/developerworks/java/library/j-maven/index.html > > to be a very helpful resource, with a good > explanation of how > > I can extend the main POM in order to have the > same version > > number across all of the modules. > > > > I'd like to come up with a way to run one maven > command to do > > the following: > > > > 1. create and install the > myproj-util-.jar 2. create > > and install the myproj-ejb-.jar 3. create > and > > install the myproj-web-.war 4. create and > install > > the myproj-app-.ear > > > > From what I can tell this is not possible with a > single maven > > command and I will have to cook up a script which > will call > > the jar:install, ejb:install, war:install, and > ear:install > > maven goals from the proper directories. Is this > really the > > case, or am I missing something ? > > > > > > --James > > > > > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to build a EAR with EJB and WAR included ?
Thanks for the help so far. After some initial confusion I've come up with a working solution. I have broken my project up into three separate projects (myproj-util, myproj-ejb, and myproj-web) and created an overall project for creating the EAR (myproj-app). I found http://www-106.ibm.com/developerworks/java/library/j-maven/index.html to be a very helpful resource, with a good explanation of how I can extend the main POM in order to have the same version number across all of the modules. I'd like to come up with a way to run one maven command to do the following: 1. create and install the myproj-util-.jar 2. create and install the myproj-ejb-.jar 3. create and install the myproj-web-.war 4. create and install the myproj-app-.ear >From what I can tell this is not possible with a single maven command and I will have to cook up a script which will call the jar:install, ejb:install, war:install, and ear:install maven goals from the proper directories. Is this really the case, or am I missing something ? --James __ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to build a EAR with EJB and WAR included ?
Tim thanks for your message. You have brought up a very good point, in that the WAR and EJB pieces of my application do essentially go together, so there's no real need to build a WAR and EJB JAR to include in an EAR when I can just create the EAR instead. If this is the case then I need to figure out the correct layout for my development directories which Maven will expect to find when I run maven ear. 1. Where do the JSP pages & image directories go ? Do these go in src/webapp, or is this only relevant for maven war ? What about the WEB-INF with the web.xml etc. ? 2. Where do I put the ejb-jar.xml and jboss.xml ? Should I perhaps keep all of the JBoss related config files such as jboss.xml and jboss-web.xml someplace else and separate from the base application, in order to make the code more generic ? How would one go about isolating just the JBoss elements into their own areas, but then including these when building an EAR ? 3. I have some JMX MBean classes that need to be deployed in a separate SAR file (in order to be run as JBoss services), but which the classes of my application access indirectly. Is there a special directory layout for these classes and their associated META-INF/jboss-service.xml ? Also these MBean classes use a few classes found in the core of the application (some custom Exception and JavaBean classes) - how is this handled ? Should this be a separate project from the main application ? 4. Do I need to create an application.xml for the EAR ? how to begin ? It seems that since I have no web or ejb modules then I don't need to specify anything in the application.xml. Thanks in advance for any help. --James --- Tim Stephenson <[EMAIL PROTECTED]> wrote: > James, > > Are the three directory structures you describe > different projects > (each with own project.xml) or do they overlap? If > they overlap this > is the first thing to change. I can't find the > reference on the FAQ or > elsewhere in the web site, but I am pretty sure > maven strongly advises > against creating several artifacts (jar, war etc.) > from a single > project, which I think makes perfect sense but it > can be a hurdle to > understanding maven for some people I have had > conversations with. > > Assuming that they are different projects, you > should be able to build > the EJB and the WAR files already? In the respective > project dir you > should run 'ejb:install' and 'war:install'. This > will build the EJB > and WAR files and place them into your local > repository. For more > help, check the EJB and WAR plugin reference pages > at: > > http://maven.apache.org/reference/plugins/ejb/ and > > http://maven.apache.org/reference/plugins/war/ > > Then in the EAR project's project.xml you need to > specify these > dependencies for the EJB and WAR projects with some > special properties > to say they should be bundled in the EAR file. It > will look something > like this: > > > MyProj > MyProj-ejb > 1.0 > ejb > > true > > > > MyProj > MyProj-web > 1.0 > war > > > /MyWeb > > true > > > > Finally run the goal 'ear' (or 'ear:install') to > create the EAR file. > More help on the EAR plugin is available at: > > http://maven.apache.org/reference/plugins/ear/ > > Hope this helps, > Tim > > On Mon, 14 Feb 2005 15:49:35 -0800 (PST), James > Adams > <[EMAIL PROTECTED]> wrote: > > I want to build an EAR file which contains a WAR > and > > EJB JAR. Currently I am able to have all of my > class > > files put into a single JAR, whether I do "maven > ejb" > > or "maven war", but really what I want is a goal > which > > will > > > > 1. Create the WAR with all JSPs and Servlet > classes. > > > > My project's directory layout as far as web > components > > goes looks like this: > > > > myproject > > +-- src > >+-- java > > +-- all needed packages including > > servlets > >+-- webapp > > +-- WEB-INF > >+-- web.xml > >+-- jboss-web.xml > > +-- all JSP and HTML files, img > > directories, etc. > > > > 2. Crea
How to build a EAR with EJB and WAR included ?
I want to build an EAR file which contains a WAR and EJB JAR. Currently I am able to have all of my class files put into a single JAR, whether I do "maven ejb" or "maven war", but really what I want is a goal which will 1. Create the WAR with all JSPs and Servlet classes. My project's directory layout as far as web components goes looks like this: myproject +-- src +-- java +-- all needed packages including servlets +-- webapp +-- WEB-INF +-- web.xml +-- jboss-web.xml +-- all JSP and HTML files, img directories, etc. 2. Create the EJB JAR with all EJB and dependency classes My project's directory layout as far as EJB components goes looks like this: myproject +-- src +-- java +-- all needed packages including ejbs +-- ejb +-- META-INF +-- jboss.xml +-- ejb-jar.xml 3. Create an EAR file which includes both the WAR and EJB JAR created above My project's directory layout as far as EAR components goes looks like this: myproject +-- src +-- application +-- META-INF +-- application.xml In the end I want the EAR to contain the EJB JAR and WAR files, with an application.xml specifying the modules. Is this possible ? Are the directory layouts above what I need for this sort of Maven goal ? Since the Servlet and EJB classes are both under the src/java directories how will I tell Maven which classes need to go in the WAR file and which ones go in the EJB JAR ? Any suggestions greatly appreciated ! --James __ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Building WAR files and Eclipse integration
I have started using Maven for a J2EE project which I am developing using Eclipse as my IDE. I have several questions about how to get this environment set up correctly. After creating the Eclipse project I created a project.xml and a project.properties in the project's base directory (I copied and modified these from a colleague's preexisting non-Eclipse Maven project). I have a src/java and src/test subdirectories under the base directory, as well as a WEB-INF directory. I ran "maven eclipse" and everything appears to have gone as expected. I refreshed the project in Eclipse and specified the MAVEN_REPO variable so that it can find the j2ee.jar file specified in the element of the project.xml. It appears to build everything correctly when I save the source files, in that class files are being put into target/classes subdirectory. However the Java source editor shows error messages (symbol unresolved) on every line of my servlet class sources which have a reference to a class (essentially all javax.servlet.* classes) which should be found in the j2ee.jar specified as a dependency (this is probably an Eclipse problem, but I thought I'd mention it in case anyone reading this recognizes the problem). I don't see how you can specify which files you will include in a WAR file. I know how I would do it using Ant (in the build.xml), but I have yet to locate the documentation which explains how you specify this for Maven. Is there a "How To" document which explains this ? Essentially I want to package all of the JSP and HTML pages and everything under WEB-INF directory (web.xml, classes, tlds, etc.) into the WAR file. Is this specified in some way in the project.xml file, or in a maven.xml file, as it would be in the build.xml for Ant ? I have tried using the war goal in order to see what it will do but I have never been able to get it to work. I have tried "maven war:webapp: and "maven war:war", both of which give me the following error message: BUILD FAILED File.. file:/C:/Documents and Settings/jadams/.maven/plugins/maven-caller-plugin-1.0/plugin.jelly Element... attainGoal Line.. 33 Column 39 No goal [java:compile] Total time: 5 seconds Finished at: Fri Apr 02 13:57:30 EST 2004 Is there some way to get around this, or does the above indicate an incomplete installation or some other configuration trouble ? Typically web applications put class files into /WEB-INF/classes, but the default target directory using Maven is target/classes. Is there some way that I can modify this such that running "maven eclipse" will make Eclipse put generated classes into the specified location ? Again I assume that there is an element which I could add to project.xml to effect this change, but I don't see where it is specified in the documentation. How do I configure Eclipse to use maven ? I assume that I need to set up Maven as an external tool in Eclipse - can anyone comment on this process ? I am using Maven 1.0-rc2 and Eclipse 2.1.3. Thanks in advance for any feedback. -James * DISCLAIMER: All email(s) sent to and from Harborside Plus are recorded and archived, monitored, and/or disclosed to someone other than the recipient.. The information contained in this e-mail is, unless otherwise indicated, confidential and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized. If you are not the intended recipient please notify Harborside Plus immediately by returning the e-mail to James Adams: [EMAIL PROTECTED]