dev@glassfish.java.net

Re: Serious issue with Grizzly pom.xml

From: Justin Lee <Justin.Lee_at_Sun.COM>
Date: Fri, 09 Oct 2009 11:05:42 -0400

Sahoo wrote:
> While trying to debug a GFv3 startup problem on AIX platform [1], I
> had to build grizzly version 1.9.18b in order to look at the source
> for a generated class. While building the above version, I noticed mvn
> using a SNAPSHOT version of HK2 in the build. That was a bit
> surprising as I was building a non-SNAPSHOT version of grizzly. When I
> ran
> 'mvn help:effective-pom -f /tmp/grizzly-1.9.18b/modules/config/pom.xml,'
> I found the following lines in the effective pom which explains why
> the build was using SNAPSHOT version of HK2:
>
> / <plugin>
> <groupId>com.sun.enterprise</groupId>
> <artifactId>hk2-maven-plugin</artifactId>
> <version>0.3.99-SNAPSHOT</version>
> /
> Looking further, I saw there was no mention of version in
> config/pom.xml for the above plugin, so mvn decided to use
> 0.3.99-SNAPSHOT as the version as that's the latest version out there.
> It really makes the build non-reproducible. So, I suggest grizzly team
> take a look at their pom and add an explicit version wherever it is
> missing.
I don't know what you're reading but here's what's in the trunk. It's
been this way for a long, long time so I don't know why you're seeing a
-SNAPSHOT reference.

        <dependency>
            <groupId>com.sun.enterprise</groupId>
            <artifactId>hk2</artifactId>
            <version>${hk2.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.enterprise</groupId>
            <artifactId>config-types</artifactId>
            <version>${hk2.version}</version>
        </dependency>
...
        <hk2.version>0.3.88</hk2.version>

The only thing wrong with this particular definition is that the scope
should probably be "provided" so it picks up whatever glassfish happens
to be using...
>
> I also noticed a couple more issues in their pom.xmls. e.g., parent
> pom.xml uses maven-bundle-plugin version 1.4.3 where as config/pom.xml
> uses version 1.4.0. Use pluginManagement and dependencyManagement to
> avoid such issues. I also noticed duplicate repository definitions;
> some configure the repo with SNAPSHOT update policy as default and
> some as never.
I'm updating the poms in grizzly to use the management sections. It's
been on my list of things to do but more pressing matters have always
taken precedence.
>
> I also noticed that maven-bundle-plugin has been configured with a
> fixed set of packages in Import-Package instructions. I doubt grizzly
> developers keep it in synch with source code, otherwise we would not
> have missed some mandatory packages in Import-Package. This wasted my
> entire day.
The very last line in the Import-Package directive in osgi.bundle is
"*." This seems to make the preceding lines a bit redundant so I'm
removing those. Given the scarcity/nonobviousness of documentation on
how to use this stuff, it looks like I'll spend *my* day testing all
this on AIX (which prompted all this to start with). Since the fix to
this file was so obvious, a patch would've been nice to simply apply and
learn from but I'll do my best to correct things as best I can.
>
> The reason for writing this email in dev@ is that I am hoping other
> developers who are maintaining such pom.xmls outside glassfish/v3
> should review them from these angles.
>
> Thanks,
> Sahoo
>
> [1] https://glassfish.dev.java.net/issues/show_bug.cgi?id=9986
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>