5 Replies Latest reply on Mar 5, 2015 6:21 PM by dtognola

    Install artifacts to Guvnor Maven Repo

    joao.pereira

      Hi,

       

      I have a maven project that are my dependencies for some rules authored in Kie workbench and I need to deploy these dependencies to guvnor maven repository.

       

      My .m2/settings.xml contains:

       

      <server>

            <id>guvnor-m2-repo</id>

            <username>admin</username>

            <password>admin</password>

      <configuration>

              <wagonProvider>httpclient</wagonProvider>

              <httpConfiguration>

                <all>

                  <usePreemptive>true</usePreemptive>

                </all>

              </httpConfiguration>

            </configuration>

          </server>

       

      My pom.xml contains :

       

       

       

          <repositories>

              <repository>

                  <id>jboss-public-repository-group</id>

                  <name>JBoss Public Repository Group</name>

                  <url>http://repository.jboss.org/nexus/content/groups/public/</url>

                  <layout>default</layout>

                  <releases>

                      <enabled>true</enabled>

                      <updatePolicy>never</updatePolicy>

                  </releases>

                  <snapshots>

                      <enabled>true</enabled>

                      <updatePolicy>never</updatePolicy>

                  </snapshots>

              </repository>

              <repository>

                  <id>guvnor-m2-repo</id>

                  <name>Guvnor M2 Repo</name>

                  <url>http://localhost:8080/jbpm-console/maven2/</url>

              </repository>

          </repositories>

       

      When I try to to do:

       

      mvn deploy

       

      I'm getting:

       

      Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project com.xxxx.parent: Failed to deploy artifacts: Could not transfer artifact com.xxxx:com.xxxx.parent:pom:1.0-20140424.114545-1 from/to guvnor-m2-repo (http://localhost:8080/jbpm-console/maven2/): Failed to transfer file: http://localhost:8080/jbpm-console/maven2/comtxxxx/parent/1.0-SNAPSHOT/com.xxx.parent-1.0-20140424.114545-1.pom. Return code is: 405, ReasonPhrase: Method Not Allowed. -> [Help 1]

       

      Also, if I go to http://localhost:8080/jbpm-console/maven2/ in the browser, I get 404.

       

      The jbpm-console is running, as I can access it through http://localhost:8080/jbpm-console

       

      I'm using maven 3.1.1 with oracle's java 1.7

       

      Any documentation about how to configure guvnor maven repo? Anyone knows this error?

       

      Thanks

        • 1. Re: Install artifacts to Guvnor Maven Repo
          sanjay05222

          Hi João Pereira

           

          Were you able to resolve this issue ?

          I am facing similar issue as well.

           

          thanks

          Sanjay Gautam,

          • 2. Re: Install artifacts to Guvnor Maven Repo
            swiderski.maciej

            guvnor maven repository is currently (6.1.0) read only from outside point of view. It can only install artifacts built in kie-wb. It is scheduled to be available in next versions. You could install artifacts over file system either local or scp as a workaround for now.

             

            HTH

            • 3. Re: Install artifacts to Guvnor Maven Repo
              dtognola

              Very helpful comment Maciej !

               

              1) How do I install artifacts via the file system (e.g. just for local development), probably a dumb question but I can't find any docs..

              2) Once a Deployment Unit is created, can I get it to re-read the artifact from the local repository (after I made and installed a change) or do I have to undeploy and re-create the Deployment Unit after each change ?

               

              Cheers,

              Diego

              • 4. Re: Install artifacts to Guvnor Maven Repo
                swiderski.maciej

                Dtognola Dtognola wrote:

                 

                Very helpful comment Maciej !

                 

                1) How do I install artifacts via the file system (e.g. just for local development), probably a dumb question but I can't find any docs..

                assuming kie-workbench runs on the same machine it should be enough to run mvn clean install and workbench should be able to find it

                 

                Dtognola Dtognola wrote:

                2) Once a Deployment Unit is created, can I get it to re-read the artifact from the local repository (after I made and installed a change) or do I have to undeploy and re-create the Deployment Unit after each change ?

                either you have to redeploy it after change has been done or restart the server. Once deployment unit is loaded in workbench there is no auto redeploy based on changes in maven repo. Mainly due to implications it might bring into the actual (non development) environment.

                Note there is REST api do do deployments so you can automate that as well...

                 

                HTH

                • 5. Re: Install artifacts to Guvnor Maven Repo
                  dtognola

                  Great clarification again thanks !

                   

                  1) Nice, but how do I point KIE to my ~/.m2/repository ? Or if KIE is using its own MVN repo by default - where is it ? And how do I do the initial deployment of the kjar, given that Deployment Units do not work ?

                  2) I get the point about blocking hot-deploy in PROD. Is there a plan to add a switch to enable it for DEV though ? Quick redeployments during the frequent development cycle would be a very, very big advantage in terms of productivity. Are you aware of any Maven plugins that use the REST API you mention ?

                   

                  Sorry to ask these basic questions but I couldn't find the information anywhere. This is basic but unfortunately also make-or-break stuff when selecting technology and bootstrapping development projects ;-)

                   

                  Cheers,

                  Diego