RE: noob confusion about dependencies and repositories
-Original Message- From: Barrie Treloar [mailto:baerr...@gmail.com] On Sun, Oct 7, 2012 at 9:34 AM, Rob Withers reefed...@gmail.com wrote: I am guilty for being lazy. I really hate all this build config stuff and with maven, git and Jenkins, plus FindBugs and PMD in all three environments, it gets to me. I am totally up and running, minus some issues as I split my project apart that I am working on. If I do go for the public maven repos, I will be sure to read the books. You have given me a crash course on it and I can us it effectively now. Now, back to coding, which is what I really like to do (minus a trip back into JBoss land). You sound like you can get the stuff done, so I beg you to spend a small amount of time reading those docs. Instead of this stuff bugging you, you will understand how to quickly and easily get it fixed. Otherwise next time you run into these problems you will have that mental barrier that says this stuff is hard and annoying. It is only that way because you need to know the basics. You wont regret it. Thank you. I can do it, for sure. I tend to read the docs and ask questions at the same time, until I get my problem solved. The issue is that these problems are peripheral to the problems I want to solve, which is a secure promise-based distributed object messaging system. Much more interesting and difficult in its own right. This stuff, while very powerful when done right, and necessary, is like keeping my apartment clean or cooking dinner! It is a chore. ;-) That said, I do like maven a lot. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: noob confusion about dependencies and repositories
Thanks for your response, Steinar... From: Steinar Bang [mailto:s...@dod.no] Rob Withers reefed...@gmail.com: Here are my questions, I suppose: 1.. How can I install murmur-events, even though pmd/findbugs is issuing warnings? The mvn install is failing. What's the directory layout of your projects? Where do you issue the command? What are the error messages you're getting. workspace/ murmur/ pom.xml murmur-events/ pom.xml I issue the command in the murmur-events dir and I have no parent pom.xml and the error is: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:2.7.1:check (default) on project murmur-events: You have 17 PMD violations. For more de tails see:C:\rob\comp\workspace\murmur-events\target\pmd.xml - [Help 1] 3.. Do I need to have a parent pom with two modules, one for each project? That would be the maven way, yes, structured so: murmur-top/ pom.xml murmur-events/ pom.xml murmur/ pom.xml Ok, I tried this and got an error in both the parent dir, when issuing the mvn command: C:\rob\comp\workspacemvn [INFO] Scanning for projects... [ERROR] The build could not read 3 projects - [Help 1] [ERROR] [ERROR] The project org.murmur:murmur-events:1.0.1-SNAPSHOT (C:\rob\comp\workspace\murmur-events\pom.xml) has 1 error [ERROR] Non-resolvable parent POM: Could not find artifact org.murmur:murmur-top:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 11 - [Help 2] [ERROR] [ERROR] The project org.murmur:murmur:0.0.1-SNAPSHOT (C:\rob\comp\workspace\murmur\pom.xml) has 1 error [ERROR] Non-resolvable parent POM: Could not find artifact org.murmur:murmur-top:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 11 - [Help 2] and an error in the subdir, when issuing the mvn command: C:\rob\comp\workspace\murmur-eventsmvn [INFO] Scanning for projects... [ERROR] The build could not read 1 project - [Help 1] [ERROR] [ERROR] The project org.murmur:murmur-events:1.0.1-SNAPSHOT (C:\rob\comp\workspace\murmur-events\pom.xml) has 1 error [ERROR] Non-resolvable parent POM: Could not find artifact org.murmur:murmur-top:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 11 - [Help 2] These are really the same error. 5.. If the jar is named ‘murmur-events-1.0.1-SNAPSHOT.jar’, will the above dependency of the following find it? Um... not sure I understood that...? This dependency section in the murmur pom: dependency groupIdorg.reefedjib/groupId artifactIdmurmur-events/artifactId version1.0.1-SNAPSHOT/version /dependency 6.. What about setting up an internal repository? Would that be a better solution? What do you mean by an internal repository? A repository for internal to your project? Or a repository local to your site? Instead of a local repository, have a public repository at http://callistosheart.org/maven or something. 7.. If I have the dependency in maven, will eclipse pick it up? Not eclipse by itself. But you can either use the eclipse m2e plugin that will make maven projects appear as eclipse projects, or you can use the maven- eclipse-plugin to let maven generate the eclipse project settings. You can also use maven as an external build tool in eclipse. Does Eclipse Juno include these plugins? It does have some level of support, but I am finding I need to go to the command line to generate new projects. Thinking about this, I think I will establish a sample project with everything and just copy it over to new projects I want to create and update the artifactId in the pom. This way I can have all my default dependencies setup. Thanks, Rob - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: noob confusion about dependencies and repositories
Ok, great. Thanks for the link! -Original Message- From: Barrie Treloar [mailto:baerr...@gmail.com] Sent: Saturday, October 06, 2012 6:08 AM To: Maven Users List Subject: Re: noob confusion about dependencies and repositories On Sat, Oct 6, 2012 at 11:04 AM, Rob Withers reefed...@gmail.com wrote: Hey y'all, I am trying to link one project's jar to another project. I am totally confused and hope someone can take some time to explain. I have been reading the following pages on the site: http://maven.apache.org/guides/introduction/introduction-to- dependency -mechanism.html http://maven.apache.org/guides/getting- started/index.html#How_do_I_cre ate_a_JAR_and_install_it_in_my_local_repository http://maven.apache.org/guides/introduction/introduction-to-repositori es.html Please also have a look at the freely available books at http://maven.apache.org/articles.html They have really good examples and walk you through a simple one artifact project to a multi-artifact project. You will find things will go more smoothly after you have read the first couple of chapters. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: noob confusion about dependencies and repositories
Ok, I got around the issue with number 3 by removing the modules and building the top pom, then adding the modules. I am now getting an error with murmur-events that is preventing installation and preventing murmur from building. Here is the error with PMD: [INFO] Reactor Summary: [INFO] [INFO] top ... SUCCESS [2.171s] [INFO] murmur-events . FAILURE [6.766s] [INFO] Murmur SKIPPED [INFO] Genesis ... SKIPPED [INFO] [INFO] BUILD FAILURE [INFO] [INFO] Total time: 9.341s [INFO] Finished at: Sat Oct 06 06:26:03 EDT 2012 [INFO] Final Memory: 14M/34M [INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:2.7.1:check (default) on project murmur-events: You have 17 PMD violations. For more de tails see:C:\rob\comp\workspace\murmur-events\target\pmd.xml - [Help 1] Why are PMD warnings failing the murmur-events install? Thanks, Rob -Original Message- From: Rob Withers [mailto:reefed...@gmail.com] Sent: Saturday, October 06, 2012 6:12 AM To: 'Maven Users List' Subject: RE: noob confusion about dependencies and repositories Thanks for your response, Steinar... From: Steinar Bang [mailto:s...@dod.no] Rob Withers reefed...@gmail.com: Here are my questions, I suppose: 1.. How can I install murmur-events, even though pmd/findbugs is issuing warnings? The mvn install is failing. What's the directory layout of your projects? Where do you issue the command? What are the error messages you're getting. workspace/ murmur/ pom.xml murmur-events/ pom.xml I issue the command in the murmur-events dir and I have no parent pom.xml and the error is: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd- plugin:2.7.1:check (default) on project murmur-events: You have 17 PMD violations. For more de tails see:C:\rob\comp\workspace\murmur- events\target\pmd.xml - [Help 1] 3.. Do I need to have a parent pom with two modules, one for each project? That would be the maven way, yes, structured so: murmur-top/ pom.xml murmur-events/ pom.xml murmur/ pom.xml Ok, I tried this and got an error in both the parent dir, when issuing the mvn command: C:\rob\comp\workspacemvn [INFO] Scanning for projects... [ERROR] The build could not read 3 projects - [Help 1] [ERROR] [ERROR] The project org.murmur:murmur-events:1.0.1-SNAPSHOT (C:\rob\comp\workspace\murmur-events\pom.xml) has 1 error [ERROR] Non-resolvable parent POM: Could not find artifact org.murmur:murmur-top:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 11 - [Help 2] [ERROR] [ERROR] The project org.murmur:murmur:0.0.1-SNAPSHOT (C:\rob\comp\workspace\murmur\pom.xml) has 1 error [ERROR] Non-resolvable parent POM: Could not find artifact org.murmur:murmur-top:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 11 - [Help 2] and an error in the subdir, when issuing the mvn command: C:\rob\comp\workspace\murmur-eventsmvn [INFO] Scanning for projects... [ERROR] The build could not read 1 project - [Help 1] [ERROR] [ERROR] The project org.murmur:murmur-events:1.0.1-SNAPSHOT (C:\rob\comp\workspace\murmur-events\pom.xml) has 1 error [ERROR] Non-resolvable parent POM: Could not find artifact org.murmur:murmur-top:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 11 - [Help 2] These are really the same error. 5.. If the jar is named ‘murmur-events-1.0.1-SNAPSHOT.jar’, will the above dependency of the following find it? Um... not sure I understood that...? This dependency section in the murmur pom: dependency groupIdorg.reefedjib/groupId artifactIdmurmur-events/artifactId version1.0.1-SNAPSHOT/version /dependency 6.. What about setting up an internal repository? Would that be a better solution? What do you mean by an internal repository? A repository for internal to your project? Or a repository local to your site? Instead of a local repository, have a public repository at http://callistosheart.org/maven or something. 7.. If I have the dependency in maven, will eclipse pick it up? Not eclipse by itself. But you can either use the eclipse m2e plugin that will make maven projects appear as eclipse projects, or you can use the maven- eclipse-plugin to let maven generate the eclipse project settings. You can also use maven as an external build tool in eclipse. Does Eclipse Juno include
RE: can I run mvn install with no verify phase?
Thanks for your help. I did some O'Reilly reading. I could not find that I could skip the verify, but as Robert mentioned I can control the threshold of the plugins. I now have: workspace/ pom.xml murmur-events/ pom.xml murmur-utils/ pom.xml reed-solomon/ pom.xml murmur/ pom.xml genesis/ pom.xml where the reed-solomon overrides the plugin values for the analysis tools. It is fairly complicated to setup each new project, since I need to combine maven3, git, eclipse, and a Jenkins project for each one. I had to generate the top and put it into the Jenkins repository, which is separate than the .m2 repository, but it works. I may switch to a public repository at some point. Anyways, once I get each project setup, it is gravy. Thanks, Rob From: Barrie Treloar [mailto:baerr...@gmail.com] On Sat, Oct 6, 2012 at 8:14 PM, Rob Withers reefed...@gmail.com wrote: As the subject asks: can I run mvn install with a no verify flag to skip the verify phase? Rob, please read the maven books. Your questions are showing you need to grasp the basics first. You will save yourself lots of pain. From: Robert Scholte [mailto:rfscho...@apache.org] Can you reach the age of 100 without ever being 99? You must find your solution in the plugin bound to the verify-phase. A strategy could be to make add a profile with the ITs. profile idrun-its/id /profile If you want it to be executed by default, add this kind of activation: activation property nameskipTests/name value!true/value /property /activation So mvn install -DskipTests=true will indeed skip the tests Otherwise activate it by id (that is: -Prun-its) Robert On Sat, 06 Oct 2012 12:44:36 +0200 Rob Withers reefed...@gmail.com wrote: As the subject asks: can I run mvn install with a no verify flag to skip the verify phase? Thanks, Rob - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: noob confusion about dependencies and repositories
From: Steinar Bang [mailto:s...@dod.no] Rob Withers reefed...@gmail.com: What's the directory layout of your projects? Where do you issue the command? What are the error messages you're getting. workspace/ murmur/ pom.xml murmur-events/ pom.xml I issue the command in the murmur-events dir and I have no parent pom.xml and the error is: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:2.7.1:check (default) on project murmur-events: You have 17 PMD violations. For more de tails see:C:\rob\comp\workspace\murmur-events\target\pmd.xml - [Help 1] Right... one fix would be to fix those 17 PMD violations...;-) Alternatively you can remove maven-pmd-plugin from the plugins section of the murmur-events/pom.xml. Or you can use that same entry to configure the maven-pmd-plugin to be less strict (not sure if that's possible...?). Exactly, I reduced the strictness. The violations were not preventing compilation. I want to be able to install if it runs, then browse the violations and fix those that make sense. I have one method that increments a parameter and I don't want to fix that for clarity, for example. 5.. If the jar is named ‘murmur-events-1.0.1-SNAPSHOT.jar’, will the above dependency of the following find it? Um... not sure I understood that...? This dependency section in the murmur pom: dependency groupIdorg.reefedjib/groupId artifactIdmurmur-events/artifactId version1.0.1-SNAPSHOT/version /dependency If that is the groupId+artifactId+version your actual murmur-events pom.xml has, and if murmur-events have been built and installed in your local repository, then yes, that shoud be enough. Yep, it all works now. 6.. What about setting up an internal repository? Would that be a better solution? What do you mean by an internal repository? A repository for internal to your project? Or a repository local to your site? Instead of a local repository, have a public repository at http://callistosheart.org/maven or something. If that is an option for you, then I'm sure it will be a good thing. I have only ever been allowed to set up an intranet repository...:-) You can add that repository in your top pom. So, how does this work? What does the site file structure look like? 7.. If I have the dependency in maven, will eclipse pick it up? Not eclipse by itself. But you can either use the eclipse m2e plugin that will make maven projects appear as eclipse projects, or you can use the maven- eclipse-plugin to let maven generate the eclipse project settings. You can also use maven as an external build tool in eclipse. Does Eclipse Juno include these plugins? m2e? By default? No idea. It does have some level of support, but I am finding I need to go to the command line to generate new projects. That isn't m2e or eclipse. That's the maven-eclipse-plugin. If you do mvn eclipse:eclipse on the workspace level this maven plugin will generate the eclipse project files/directories in murmur-events and murmur. The dependency from murmur to murmur-events will be a project dependency. Note that you also need to mvn eclipse:configure-workspace on the workspace level before starting eclipse. This will set the M2_REPO eclipse variable, pointing to your local repository. Very cool. Thinking about this, I think I will establish a sample project with everything and just copy it over to new projects I want to create and update the artifactId in the pom. This way I can have all my default dependencies setup. Hm... OK. Maybe my test project can help you a little bit. You can just start out with the project and verify that it builds, then add stuff and test builds and if it breaks figure out what makes it break Attached is the output from me doing mvn install on the test project. I included several dependencies in the top and then overrode some of the analysis dependencies in the one sub to be even less strict than the top. Works like grace. Thanks for your help, Rob - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: noob confusion about dependencies and repositories
Cool, I'll check it out after getting all my projects squared away... Rob -Original Message- From: Wayne Fay [mailto:wayne...@gmail.com] Sent: Saturday, October 06, 2012 5:27 PM To: Maven Users List Subject: Re: noob confusion about dependencies and repositories Instead of a local repository, have a public repository at http://callistosheart.org/maven or something. If that is an option for you, then I'm sure it will be a good thing. I have only ever been allowed to set up an intranet repository...:-) You can add that repository in your top pom. So, how does this work? What does the site file structure look like? Most people here run an MRM like Nexus, Artifactory, or Archiva. You can find lots of information about these systems at their respective sites. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: noob confusion about dependencies and repositories
I am guilty for being lazy. I really hate all this build config stuff and with maven, git and Jenkins, plus FindBugs and PMD in all three environments, it gets to me. I am totally up and running, minus some issues as I split my project apart that I am working on. If I do go for the public maven repos, I will be sure to read the books. You have given me a crash course on it and I can us it effectively now. Now, back to coding, which is what I really like to do (minus a trip back into JBoss land). Cheers, Rob -Original Message- From: Barrie Treloar [mailto:baerr...@gmail.com] Sent: Saturday, October 06, 2012 7:00 PM To: Maven Users List Subject: Re: noob confusion about dependencies and repositories On Sun, Oct 7, 2012 at 7:57 AM, Wayne Fay wayne...@gmail.com wrote: Instead of a local repository, have a public repository at http://callistosheart.org/maven or something. If that is an option for you, then I'm sure it will be a good thing. I have only ever been allowed to set up an intranet repository...:-) You can add that repository in your top pom. So, how does this work? What does the site file structure look like? Most people here run an MRM like Nexus, Artifactory, or Archiva. You can find lots of information about these systems at their respective sites. Do not add a repository section to you pom. That will cause everyone else who uses your artifacts pain. As Wayne says you want to set up a MRM and then in your ~/.m2/settings.xml you activate a profile that points to your MRM. Again, if you read the books at http://maven.apache.org/articles.html, specifically : * Maven: The Definitive Guide * Better Builds with Maven You will gain the understanding you need to answer your own questions that you have posed on the list. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
noob confusion about dependencies and repositories
Hey y’all, I am trying to link one project’s jar to another project. I am totally confused and hope someone can take some time to explain. I have been reading the following pages on the site: http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html http://maven.apache.org/guides/getting-started/index.html#How_do_I_create_a_JAR_and_install_it_in_my_local_repository http://maven.apache.org/guides/introduction/introduction-to-repositories.html I have the following tools: a.. eclipse b.. maven c.. git d.. jenkins e.. findbugs f.. pmd my two projects are murmur-events and the other is murmur. Murmur has a dependency to murmur-events. My murmur-events pom has pmd and findbugs and failures in the mojo s preventing installation of the jar. Here is the dependency in the murmur pom: dependency groupIdmurmur-events/groupId artifactIdmurmur-events/artifactId scoperuntime/scope version1.0.1-SNAPSHOT/version /dependency Here are my questions, I suppose: 1.. How can I install murmur-events, even though pmd/findbugs is issuing warnings? The mvn install is failing. 2.. Where is the local repository where these get installed? 3.. Do I need to have a parent pom with two modules, one for each project? Does this impact where my local repository is? 4.. Should I specify the murmur-events-1.0.1-SNAPSHOT.jar, as a dependency in the murmur project, by system file path? 5.. If the jar is named ‘murmur-events-1.0.1-SNAPSHOT.jar’, will the above dependency of the following find it? 6.. What about setting up an internal repository? Would that be a better solution? 7.. If I have the dependency in maven, will eclipse pick it up? Many thanks, Rob