Announcement Announcement Module
Collapse
No announcement yet.
Roo, cloudbees, and maven - not complete joy can anyone help? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roo, cloudbees, and maven - not complete joy can anyone help?

    Hi, everyone...

    I'm launching a repository of add-ons, the "Silly Weasel" roo add-ons repo, as a way to try to spur additional add-on development. I'm going to start adding samples, and build them up over time.

    I'm currently using CloudBees as my git repository and my maven repo. I'll be adding CI via Jenkins so I can do easy CI builds.

    However, I'm having two problems:

    1) I can't do a maven releaseerform as maven tells me that it got error '1' - with NO OTHER MESSAGE
    2) I can manually deploy (mvn deploy) into the release, however...
    when I use osgi obr url add to add the repo, it works, BUT
    when I do osgi obr install to install the add-on, I get an error (shown below).

    Anyone run into this? I know it signs my gpg key, because I see it in target. However, my credentials are right because I can manually deploy, and it's signing and creating the keys.

    I'm attaching my maven pom.

    Code:
    roo> osgi obr start --bundleSymbolicName org.sillyweasel.addons.jqueryui:VERSION=0.9.1
    Target resource(s):
    -------------------
       jqueryui (0.9.1)
    
    Deploying...done.
    
    Unknown bundle - VERSION
    Unknown bundle - 0.9.1
    
    [Thread-4] [org.apache.felix.bundlerepository [6]] Resolver: Install error - org.sillyweasel.addons.jqueryui
               java.lang.NullPointerException: Unable to retrieve signature from stream
                   at org.apache.commons.lang3.Validate.notNull(Validate.java:222)
                   at org.springframework.roo.felix.pgp.PgpServiceImpl.isSignatureAcceptable(PgpServiceImpl.java:254)
                   at org.springframework.roo.felix.HttpPgpUrlStreamHandlerServiceImpl.openConnection(HttpPgpUrlStreamHandlerServiceImpl.java:110)
                   at org.apache.felix.framework.URLHandlersStreamHandlerProxy.openConnection(URLHandlersStreamHandlerProxy.java:271)
                   at java.net.URL.openConnection(URL.java:945)
                   at org.apache.felix.bundlerepository.impl.FileUtil.openURL(FileUtil.java:199)
                   at org.apache.felix.bundlerepository.impl.ResolverImpl.deploy(ResolverImpl.java:598)
                   at org.apache.felix.bundlerepository.impl.ObrCommandImpl._deploy(ObrCommandImpl.java:395)
                   at org.apache.felix.bundlerepository.impl.ObrCommandImpl.deploy(ObrCommandImpl.java:333)
                   at org.apache.felix.bundlerepository.impl.ObrCommandImpl.execute(ObrCommandImpl.java:119)
                   at org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:286)
                   at org.springframework.roo.felix.FelixDelegator.perform(FelixDelegator.java:208)
                   at org.springframework.roo.felix.FelixDelegator.obrStart(FelixDelegator.java:146)
                   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:597)
                   at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:46)
                   at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:169)
                   at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:226)
                   at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:43)
                   at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:225)
                   at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:135)
                   at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:420)
                   at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:538)
                   at java.lang.Thread.run(Thread.java:680)
    roo> roo>

  • #2
    Here is the POM file

    Code:
    <project...>
        <modelVersion>4.0.0</modelVersion>
        <groupId>org.sillyweasel.addons.jqueryui</groupId>
        <artifactId>org.sillyweasel.addons.jqueryui</artifactId>
        <packaging>bundle</packaging>
        <version>0.9.1</version>
        <name>jqueryui</name>
    ...
        <description>Installs jQuery UI</description>
        <url>http://www.rimple.com/sillyweasel</url>
        <properties>
            <roo.version>1.2.1.RELEASE</roo.version>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <google.code.project.name>${project.name}</google.code.project.name>
            <repo.folder>org/sillyweasel/addons/jqueryui</repo.folder>
        </properties>
        <repositories>
            <repository>
                <id>spring-roo-repository</id>
                <name>Spring Roo Repository</name>
                <url>http://spring-roo-repository.springsource.org/release</url>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>spring-roo-repository</id>
                <name>Spring Roo Repository</name>
                <url>http://spring-roo-repository.springsource.org/release</url>
            </pluginRepository>
        </pluginRepositories>
        <dependencies>
            <!-- OSGi -->
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.core</artifactId>
                <version>4.2.0</version>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.compendium</artifactId>
                <version>4.2.0</version>
            </dependency>
            <!-- Apache Felix -->
            <dependency>
                <groupId>org.apache.felix</groupId>
                <artifactId>org.apache.felix.scr.annotations</artifactId>
                <version>1.6.0</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.roo</groupId>
                <artifactId>org.springframework.roo.metadata</artifactId>
                <version>${roo.version}</version>
                <type>bundle</type>
            </dependency>
            <dependency>
                <groupId>org.springframework.roo</groupId>
                <artifactId>org.springframework.roo.process.manager</artifactId>
                <version>${roo.version}</version>
                <type>bundle</type>
            </dependency>
            <dependency>
                <groupId>org.springframework.roo</groupId>
                <artifactId>org.springframework.roo.project</artifactId>
                <version>${roo.version}</version>
                <type>bundle</type>
            </dependency>
            <dependency>
                <groupId>org.springframework.roo</groupId>
                <artifactId>org.springframework.roo.support</artifactId>
                <version>${roo.version}</version>
                <type>bundle</type>
            </dependency>
            <dependency>
                <groupId>org.springframework.roo</groupId>
                <artifactId>org.springframework.roo.shell</artifactId>
                <version>${roo.version}</version>
                <type>bundle</type>
            </dependency>
            <dependency>
                <groupId>org.springframework.roo</groupId>
                <artifactId>org.springframework.roo.bootstrap</artifactId>
                <version>${roo.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.roo</groupId>
                <artifactId>org.springframework.roo.model</artifactId>
                <version>${roo.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.roo</groupId>
                <artifactId>org.springframework.roo.classpath</artifactId>
                <version>${roo.version}</version>
                <type>bundle</type>
            </dependency>
        </dependencies>
        <scm>
            <connection>scm:git:ssh://[email protected]/sillyweasel/jquery-roo-addon.git</connection>
            <url>git:ssh://[email protected]/sillyweasel/jquery-roo-addon.git</url>
            <developerConnection>scm:git:ssh://[email protected]/sillyweasel/jquery-roo-addon.git</developerConnection>
        </scm>
        <distributionManagement>
            <repository>
                <id>sillyweasel-release</id>
                <url>dav:https://repository-sillyweasel.forge.cloudbees.com/release/</url>
            </repository>
            <snapshotRepository>
                <id>sillyweasel-release</id>
                <url>dav:https://repository-sillyweasel.forge.cloudbees.com/snapshot/</url>
            </snapshotRepository>
        </distributionManagement>
        <build>
            <extensions>
                <extension>
                    <groupId>org.apache.maven.wagon</groupId>
                    <artifactId>wagon-webdav-jackrabbit</artifactId>
                    <!-- Upgraded to 2.2 from 1.0.6 beta by KJR-->
                    <version>2.2</version>
                </extension>
            </extensions>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.1</version>
                    <executions>
                        <execution>
                            <id>copy-dependencies</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <outputDirectory>${project.build.directory}/all</outputDirectory>
                        <silent>true</silent>
                        <includeScope>compile</includeScope>
                        <excludeArtifactIds>org.apache.felix.scr.annotations</excludeArtifactIds>
                        <excludeGroupIds>org.osgi</excludeGroupIds>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.2.1</version>
                    <configuration>
                        <descriptors>
                            <descriptor>src/main/assembly/assembly.xml</descriptor>
                        </descriptors>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.1.2</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.2</version>
                    <configuration>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.3</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.3.4</version>
                    <extensions>true</extensions>
                    <configuration>
                        <instructions>
                            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                            <Bundle-Copyright>Copyright ${project.organization.name}. All Rights Reserved.
                            </Bundle-Copyright>
                            <Bundle-DocURL>${project.url}</Bundle-DocURL>
                            <Export-Package />
                        </instructions>
                        <remoteOBR>true</remoteOBR>
                        <bundleUrl>
                          httppgp://repository-sillyweasel.forge.cloudbees.com/snapshot/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}.jar
                        </bundleUrl>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <source>1.5</source>
                        <target>1.5</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-scr-plugin</artifactId>
                    <version>1.7.2</version>
                    <executions>
                        <execution>
                            <id>generate-scr-scrdescriptor</id>
                            <goals>
                                <goal>scr</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <parseJavaDoc>false</parseJavaDoc>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>

    Comment


    • #4
      It's quite an interesting addon

      Regarding point 1) mvn perform release,
      I believe the version of your pom.xml should be a -SNAPSHOT
      Try to change to: <version>0.9.1-SNAPSHOT</version>. A 0.9.1 version release will be generated and an update of the pom to 0.9.2-SNAPSHOT. It's how I usually perform releases within maven.

      Comment


      • #5
        Ok, I found out the cause(s). There were multiple layers to this problem:
        1. I can't type properly (the pom.xml file had inconsistent pathing and snapshot -vs- release settings in the wrong places)
        2. Roo can't deal with redirects from http:// -> https:// when loading from an OBR repository, and it expects you are only using an http:// one
        3. I was using an https:// based maven repo with cloudbees, but Roo tried to access it as http://, only to be requested to switch with a 302 MOVED - they aren't using http client, but that is an easy fix and it would follow redirects.
        4. Further, there should be support for a httpspgp:// url pattern as well as a httppgp:// pattern so that we don't start with http:// only, therefore cause a redirect in the first place

        Details...

        My POM file for review: https://gist.github.com/2378379 - it could still use some cleanup but it works for me now.

        The maven pom.xml file is generated assuming you use a http:// based Maven repository during deployment of an add-on. However, https:// is what I use.

        I am going to point to a gist of my working pom.xml file for those of you who have ever struggled with setting one up on git - I know I have and will post a blog entry on this shortly.

        Here is the offending block that causes the pain for accessing SSL repositories, in the middle of the soup:

        Code:
                    <plugin>
                        <groupId>org.apache.felix</groupId>
                        <artifactId>maven-bundle-plugin</artifactId>
                        <version>2.3.4</version>
                        <extensions>true</extensions>
                        <configuration>
                     ...
                            <bundleUrl>httppgp://ec2-54-248-4-46.ap-northeast-1.compute.amazonaws.com:8081/nexus/content/repositories/releases/org/sillyweasel/addons/jqueryui/org.sillyweasel.addons.jqueryui/${project.version}/${project.artifactId}-${project.version}.jar
        </bundleUrl>
                        </configuration>
                    </plugin>
        Because Roo has this special bundleUrl entry with a prefix httppgp it can't handle SSL requests. It doesn't have a correlated httpspgp to handle that. So, we request non-SSL traffic on an SSL port, and the Nexus server is nice enough to return a 302 MOVED script pointing to the SSL version. At which point, Roo chokes.

        This is easily fixed by using HTTP Client, I think, and also by adding an httpspgp prefix and just chopping off pgp from the end of either of them.

        So, for now until Roo can handle public ssl-based repositories, try to either upload the artifacts by hand or use a manual local repo build. For example, you can build into a directory structure like this:

        Code:
        mvn -DaltDeploymentRepository=snapshot-repo::default::file:../sillyweasel-maven-repos/snapshots clean deploy
        The above: -DaltDeploymentRepository says to take the server id'ed 'snapshot-repo' in the distributionManagement section, and replace it with a deployment to a file-based directory on your hard disk. That can be a git repo btw, which you can then add your changes to and push up. YAY.

        Also, one more thing:

        With this setup and with httppgp, you can't necessarily use mvn release prepare and release perform. I had trouble doing this even with releases. When Roo writes out the repository.xml OBR directory in the root, it has to manipulate a lock file, and that makes the lock file have to respond to a re-writing of the value. Except with nexus, that file is not allowed to be changed (we are uploading releases so no replacements). So I had to disable checks on this as well. I will potentially be filing another JIRA as a result of this.

        I'll keep you all posted on the patch I'm working on, plus make sure to let you know what I run into as I keep going deeper into add-on writing.

        Best,

        Ken

        Comment

        Working...
        X