1 2 Previous Next 20 Replies Latest reply on Feb 16, 2009 3:19 PM by mazz

    precautions with a rebuild of jopr

      i have a postgresql db server running on my m/c listening on 5432 port... and a jopr server is also configured with that db... in an earlier post i read that using -Ddbsetup will result in erasure of the db... so i shouldn't be using that option... right ?... what else do i need to take care of given that i want my present jopr server and db configuration to stay the way it is ?
      basically i want the latest jboss plugin for jopr...

        • 1. Re: precautions with a rebuild of jopr
          mazz

          not sure what you mean by "m/c" - do you mean "JBoss Microcontainer?"

          Unsure if what I'm going to say answers your question, but I think it will help:

          What -Ddbsetup does is attempt to drop all Jopr tables and then recreate them. It does not do anything to the schema itself (i.e. doesn't drop the schema entirely) nor does it disable or destroy any other part of the database. It only touches those tables that Jopr created in the first place.

          • 2. Re: precautions with a rebuild of jopr

            oh sorry for that... m/c is machine... so as i was saying can i get the latest jboss plugin jar for jopr without going through the rebuild process ?

            • 3. Re: precautions with a rebuild of jopr
              mazz

              oh yes, building plugins are much easier then building the entire RHQ core. You don't even need to do a dbsetup. To run a build of RHQ, you can specify "-Ddbsetup-do-not-check-schema" on the mvn command line to ask it not to touch your database.

              If you want to build a Jopr plugin (that is, from the downstream Jopr SVN; i.e. not an plugin from the upstream RHQ source tree) you should be able to just svn checkout the jopr trunk and build only the plugin you are interested in:

              svn co https://anonsvn.jboss.org/repos/jopr/trunk/
              cd trunk/modules/plugins/jboss-as
              mvn -Dmaven.test.skip install
              cp target/jopr-jboss-as-plugin.jar [your server's rhq-downloads/rhq-plugins dir]


              Building from the Jopr tree never involves touching the database (there is no modules in the Jopr source tree that touch the DB - that's only needed to build the RHQ upstream project).

              If you are interested in rebuilding a plugin that comes with RHQ, just go to the modules/plugins directory within the RHQ source tree for the plugin you want and do the same "mvn" build and copy it to the same directory. Building a plugin maven module directly again never involves the database.

              If you have the latest RHQ build, hot deploying of the plugin should work. Otherwise, you can restart the server to pick up the updated plugin.

              • 4. Re: precautions with a rebuild of jopr

                again a perfect answer... exactly what i was looking for... and yes i am interested in the jopr plugin not rhq... thanks again John...

                • 5. Re: precautions with a rebuild of jopr

                  Hi there John, I was able to do run the svn part successfully... but after that when i went for building the jboss plugin through maven i got the following error stack trace...

                  [INFO] Scanning for projects...
                  [INFO] ------------------------------------------------------------------------
                  [ERROR] FATAL ERROR
                  [INFO] ------------------------------------------------------------------------
                  [INFO] Failed to resolve artifact.
                  
                  GroupId: org.jboss.on
                  ArtifactId: jopr-modules-parent
                  Version: 2.2.0-SNAPSHOT
                  
                  Reason: Unable to download the artifact from any repository
                  
                   org.jboss.on:jopr-modules-parent:pom:2.2.0-SNAPSHOT
                  
                  from the specified remote repositories:
                   central (http://repo1.maven.org/maven2)
                  
                  
                  [INFO] ------------------------------------------------------------------------
                  [INFO] Trace
                  org.apache.maven.reactor.MavenExecutionException: Cannot find parent: org.jboss.on:jopr-modules-parent for project: org.jboss.on:jopr-jboss-as-plugin:jar:null
                  or project org.jboss.on:jopr-jboss-as-plugin:jar:null
                   at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
                   at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
                   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
                   at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                   at java.lang.reflect.Method.invoke(Method.java:585)
                   at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
                   at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
                   at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                  
                   at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
                  Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: org.jboss.on:jopr-modules-parent for project: org.jboss.on:jopr-jboss-as-plugin:jar:null for project org.jboss.on:jopr-jboss-as-plugin:jar:null
                   at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1370)
                   at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:821)
                   at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:506)
                   at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:198)
                   at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:583)
                   at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:461)
                   at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)
                   ... 11 more
                  Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.jboss.on:jopr-modules-parent' not found in repository: Unable to download the artifact from any repository
                  
                   org.jboss.on:jopr-modules-parent:pom:2.2.0-SNAPSHOT
                  
                  from the specified remote repositories:
                   central (http://repo1.maven.org/maven2)
                   for project org.jboss.on:jopr-modules-parent
                   at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:603)
                   at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1366)
                   ... 17 more
                  Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unableto download the artifact from any repository
                  
                   org.jboss.on:jopr-modules-parent:pom:2.2.0-SNAPSHOT
                  
                  from the specified remote repositories:
                   central (http://repo1.maven.org/maven2)
                  
                   at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:212)
                   at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:74)
                   at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:556)
                   ... 18 more
                  Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
                   at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:331)
                   at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:200)
                   ... 20 more
                  [INFO] ------------------------------------------------------------------------
                  [INFO] Total time: < 1 second
                  [INFO] Finished at: Sat Feb 14 16:10:19 IST 2009
                  [INFO] Final Memory: 1M/127M
                  [INFO] ------------------------------------------------------------------------
                  


                  kindly help...

                  • 6. Re: precautions with a rebuild of jopr
                    mazz

                    Ah... we must not have the proper poms up in the maven repository.

                    I think the easiest way around this for now (until the latest poms are uploaded to the maven repo) is to checkout the entire Jopr SVN source tree (its not very large) and build it entirely (i.e. "mvn -Dmaven.test.skip install" from the Jopr trunk directory of your source working copy).

                    If Ian is listening... do we have a Jopr nightly hudson build that publishes the snapshot poms?

                    • 7. Re: precautions with a rebuild of jopr

                      the errors remain the same when i run the mvn install from the jopr trunk directory...

                      • 8. Re: precautions with a rebuild of jopr
                        mazz

                        Works for me. I wonder if you have bad metadata in your maven local repo.

                        Do you have this directory?

                        $HOME/.m2/repository/org/jboss/on

                        Some background:

                        jopr-parent is the pom for the jopr trunk. Look at:

                        https://anonsvn.jboss.org/repos/jopr/trunk/pom.xml

                        and you'll see:

                        <groupId>org.jboss.on</groupId>
                         <artifactId>jopr-parent</artifactId>
                         <version>2.2.0-SNAPSHOT</version>
                         <packaging>pom</packaging>
                        


                        jopr-modules-parent is the pom for the jopr 'modules' module. Look at:

                        https://anonsvn.jboss.org/repos/jopr/trunk/modules/pom.xml

                        and you'll see:

                        <groupId>org.jboss.on</groupId>
                         <artifactId>jopr-modules-parent</artifactId>
                         <packaging>pom</packaging>
                        


                        So those poms should be building. You need to run mvn from your working copy of 'https://anonsvn.jboss.org/repos/jopr/trunk' for these to build.

                        Go to:

                        $HOME/.m2/repository/org/jboss/on

                        and look in the directories 'jopr-parent' and 'jopr-modules-parent' - see if the metadata XML looks right (version should be 2.2.0-SNAPSHOT).

                        Let us know if you see any oddities. We really try hard to get the build system to work flawlessly but there still seems to be quirks that we haven't fully figured out (or at least documented :) So any notes/info you have for what your maven system is doing would be appreciated.

                        If you still can't build and things look OK, delete that '$HOME/.m2/repository/org/jboss/on' directory (and all its subdirectories) and try again. See what happens.

                        • 9. Re: precautions with a rebuild of jopr

                          i am not able to locate the path $HOME/.m2/repository/org/jboss/on in my machine... is that some path in the maven binary ?

                          • 10. Re: precautions with a rebuild of jopr
                            mazz

                            If you do not have those, then that is the problem and is what is causing your build failure. Because we do not have any Jopr 2.2.0-SNAPSHOT binaries up on our main maven repo on repository.jboss.com, you have to build those yourself. And it looks like you haven't built them.

                            Your user's home directory ($HOME), contains your local Maven repository (found in your home directory's ".m2/repository" subdirectory) - that is unless you overrode that location in your Maven settings.xml file - but you would have had to explicitly do this yourself by adding the new config setting in settings.xml which people rarely do). All of the binaries that you build with maven locally are stored in your local maven repository. Note on Windows XP, I don't think there is a %HOME% environment variable - it is something like "%HOMEPATH%" (which is normally something like C:\Documents and Settings\your-username). So if you are on Windows, and your username is "myuser", look in C:\Documents and Settings\myuser\.m2\repository .

                            As I pointed to earlier, you can see the full artifact names of the jopr modules in the pom files (e.g. org.jboss.on.jopr-parent and org.jboss.on.jopr-module-parent). These should get stored in the $HOME/.m2/repository/org/jboss/on directory because "org.jboss.on" is the "artifactId" as specified in the pom's.

                            If you do not have this org/jboss/on directory in your local repository, you must not be doing these steps properly. Please make sure you do this (this will perform a full Jopr build on your box, which includes building the individual Jopr pom modules found in trunk/ and trunk/modules):

                            1) svn co https://anonsvn.jboss.org/repos/jopr/trunk/
                            2) cd trunk
                            3) mvn -Dmaven.test.skip install

                            At this point, you should have all the Jopr modules inside $HOME/.m2/repository/org/jboss/on. If you still have problems after doing those steps above, take a look at the maven output from that "mvn" command and see what its doing (what local repo directory is it installing the poms and binaries to?).

                            NOTE: All of this is Maven related - its how Maven works - Jopr just uses the normal Maven things to do its builds. Because its Maven, it should "just work". But because we did not publish any Jopr snapshot builds, it is making it harder on you. I will ask around to see if we can correct this by putting the Jopr snapshot builds in our public maven repo (which would be at http://repository.jboss.com/maven2/org/jboss/on/), at which point, you will be able to just go into an individual Jopr plugin directory and build from there (rather than building all of Jopr).

                            • 11. Re: precautions with a rebuild of jopr

                              well, now i am getting an error in the svn checkout itself... ( though this is a separate machine that i am using )... anyways thanks John for all your help... i have left this activity for the time being and most probably will pursue it a little later...
                              but i will keep troubling you for other jopr doubts... ;)...

                              • 12. Re: precautions with a rebuild of jopr

                                the org/jboss/on is not getting created as a result of the mvn command... as for the mvn result , it is the same errors i reported on the first page of this thread...

                                • 13. Re: precautions with a rebuild of jopr
                                  mazz

                                  OK, so there is a problem on your box with the maven builds. A few things:

                                  1) are you on Windows?
                                  2) in your ~/.m2/settings.xml (I assume you have one), look to see if you set "XXX" and if so, what is your value of "XXX".
                                  3) go to "jopr/trunk" (i.e. the root directory of the jopr source working copy) and execute "mvn -N install" - the output of that command should tell you where the pom is getting installed (i.e. where your local repo is thought to be). Post the output of that command.

                                  • 14. Re: precautions with a rebuild of jopr
                                    mazz

                                    shoot - the forums stripped out my tags...

                                    That #2 was supposed to be:

                                    2) in your ~/.m2/settings.xml (I assume you have one),
                                    look to see if you set
                                    <localRepository>XXX</localRepository>
                                    and if so, what is your value of "XXX".


                                    1 2 Previous Next