dev@glassfish.java.net

Re: About a problem of HK2 building

From: Tang Yong <tangyong_at_cn.fujitsu.com>
Date: Thu, 11 Oct 2012 00:07:03 +0900

Hi Romain,

  The whole exception is as following:
...
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @
hk2-parent ---
[INFO] Installing E:\gfv4\hk2\1.1.15New2\pom.xml to
E:\gfv4\gflocalrepo\org\glassfish\hk2\hk2-parent\1.1.15-ty-00008-SNAPSHOT\hk2-parent-1.1.15-ty-00008-SNAPSHOT.pom
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building Class Model for Hk2 1.1.15-ty-00008-SNAPSHOT
[INFO]
------------------------------------------------------------------------
Downloading:
http://repo1.maven.org/maven2/org/glassfish/hk2/osgiversion-maven-plugin/1.1.15-ty-00008-SNAPSHOT/maven-metadata.xml
Downloading:
http://repo1.maven.org/maven2/org/glassfish/hk2/osgiversion-maven-plugin/1.1.15-ty-00008-SNAPSHOT/osgiversion-maven-plugin-1.1.15-ty-00008-SNAPSHOT.jar
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Modules Subsystem ................................. SUCCESS [1.641s]
[INFO] Class Model for Hk2 ............................... FAILURE [5.094s]
[INFO] org.objectweb.asm.all version 3.3 repackaged as a module SKIPPED
[INFO] Maven Plugin for computing OSGi versions from Maven versions SKIPPED
[INFO] Inversion of Control / Autodependency mechanism ... SKIPPED
[INFO] Inhabitants' index generator ...................... SKIPPED
[INFO] Validation API (JSR 303) version 1.0, Hibernate Validator version
4.3.0.Final and its dependencies repackaged as OSGi bundle SKIPPED
[INFO] HK2 configuration module .......................... SKIPPED
[INFO] HK2 core module ................................... SKIPPED
[INFO] HK2 configuration reader generator module ......... SKIPPED
[INFO] OSGi repackaging of HK2 dependencies .............. SKIPPED
[INFO] Module system maven support ....................... SKIPPED
[INFO] HK2 OSGi Adapter .................................. SKIPPED
[INFO] Static Analyser for verifying module dependency ... SKIPPED
[INFO] Maven Plugin for hk2 .............................. SKIPPED
[INFO] hk2-dependency-visualizer ......................... SKIPPED
[INFO] consolidated bundle Maven plugin .................. SKIPPED
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 7.141s
[INFO] Finished at: Wed Oct 10 23:47:30 JST 2012
[INFO] Final Memory: 6M/16M
[INFO]
------------------------------------------------------------------------
[ERROR] Plugin
org.glassfish.hk2:osgiversion-maven-plugin:1.1.15-ty-00008-SNAPSHOT or
one of its dependencies could not be resolved: Could not find artifact
org.glassfish.hk2:osgiversion-maven-plugin:jar:1.1.15-ty-00008-SNAPSHOT
in maven-central (http://repo1.maven.org/maven2/) -> [Help 1]
[ERROR]

So, osgiversion-maven-plugin version maybe should not be updated.
However, if not updating osgiversion-maven-plugin, this will interrupted
auto-building. What's more, I still worry about whether having other
similar problems or not even though not updating
osgiversion-maven-plugin version.

Thanks!
-Tang

Tang Yong wrote:
> Hi Romain,
>
> I have done according to your advice as following, however, building
> still failed.
>
> 1)
>> The right way is to update ALL poms first
>
> mvn release:update-versions
>
> Result: OK.
>
> 2) mvn -Prelease-phase1 install
>
> Result: failed.
> ...
> Plugin
> org.glassfish.hk2:osgiversion-maven-plugin:1.1.15-ty-00008-SNAPSHOT or
> one of its dependencies could not be resolved: Could not find artifact
> org.glassfish.hk2:osgiversion-maven-plugin:jar:1.1.15-ty-00008-SNAPSHOT
> in maven-central (http://repo1.maven.org/maven2/) -> [Help 1]
> ...
>
> Then, I checked osgiversion-maven-plugin's pom and version has been updated.
>
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <groupId>org.glassfish.hk2</groupId>
> <artifactId>hk2-parent</artifactId>
> <version>1.1.15-ty-00008-SNAPSHOT</version>
> <relativePath>../pom.xml</relativePath>
> </parent>
>
> <artifactId>osgiversion-maven-plugin</artifactId>
> <version>1.1.15-ty-00008-SNAPSHOT</version>
> <packaging>maven-plugin</packaging>
> ...
>
> The exception is similar to the exception which I refered on my earlier
> thread.
>
> Thanks!
> --Tang
>
> Romain Grecourt wrote:
>> On 10/10/2012 04:21 PM, Tang Yong wrote:
>>>> If first setting 1.1.15-ty-00005-SNAPSHOT on hk2-parent pom, while
>>>> executing mvn -Prelease-phase1 install, building must be failed.
>>> There is a way that can resolve the problem.
>>>
>>> 1) firstly building hk2-maven-plugin with 1.1.15-ty-00005-SNAPSHOT and
>>> not setting 1.1.15-ty-00005-SNAPSHOT on other hk2 modules(keeping 1.1.15)
>>> 2) setting 1.1.15-ty-00005-SNAPSHOT on other hk2 modules
>>> 3) mvn clean install
>> Seems like you are still trying to do something based on the tag...
>> The right way is to update ALL poms first, and then to follow the
>> regular building steps:
>>> mvn -Prelease-phase1
>>> mvn install
>>>
>>> However, the way has fatal problem: auto-building missing.
>> Sorry, I don't understand. Could you please clarify ?
>>
>> Thanks,
>> Romain
>>> So, I need team's help very much.
>>>
>>> Thanks!
>>> --Tang
>>>
>>> Tang Yong wrote:
>>>> Hi Romain
>>>>
>>>> Thanks your quick reply.
>>>>
>>>>> release.sh is not made for building but for releasing.
>>>> Right, I know th point because it used maven-release-plugin to release
>>>> hk2 new version.
>>>>
>>>>> I don't know where release:prepare failed for you but if you don't have
>>>>> software developer role on hk2 project you won't be able to run this
>>>> script.
>>>>
>>>> Yeah, you are also right and because maven-release-plugin will use scm
>>>> to check file's modification.
>>>>
>>>>> The steps to build hk2 1.x branch are the following:
>>>>>> mvn -Prelease-phase1 install
>>>>>> mvn install
>>>> I can understand what you said, however, on user's machine, if he/she
>>>> wants to build a customized hk2 1.x *snapshot*, then, only executing
>>>> above commands is not enough because building will failed. About the
>>>> point, I want to say that I have tried many times and my env setting,etc
>>>> is also no problem.
>>>>
>>>> So, could you understand my use case? Or, I want to firstly ask a question.
>>>>
>>>> While I want to build a customized version 1.1.15-ty-00005-SNAPSHOT,
>>>> how to set 1.1.15-ty-00005-SNAPSHOT version?
>>>>
>>>> If first setting 1.1.15-ty-00005-SNAPSHOT on hk2-parent pom, while
>>>> executing mvn -Prelease-phase1 install, building must be failed.
>>>>
>>>> So, release.sh used maven-release-plugin to update a new version.
>>>>
>>>> Thanks!
>>>> --Tang
>>>>
>>>> Romain Grecourt wrote:
>>>>> Hi Tang,
>>>>>
>>>>> release.sh is not made for building but for releasing.
>>>>> I don't know where release:prepare failed for you but if you don't have
>>>>> software developer role on hk2 project you won't be able to run this script.
>>>>>
>>>>> The steps to build hk2 1.x branch are the following:
>>>>>> mvn -Prelease-phase1 install
>>>>>> mvn install
>>>>> Thanks,
>>>>> Romain
>>>>>
>>>>> On 10/10/2012 03:55 PM, Tang Yong wrote:
>>>>>> According my investigation, while hk2 team release a new hk2 version,
>>>>>> building will run a shell script hk2's release.sh on a inner hudson
>>>>>> build machine. I also tried the script on my machine, however, on
>>>>>> executing "mvn -e -B -DuseEditMode=true release:prepare", building failed.
>>>>>>
>>>>>> So, on user's machine, I want to ask how to build a new hk2 1.x snapshot?
>>>>>>
>>>>>> Thanks!
>>>>>> --Tang
>>>>>>
>>>>>> Tang Yong wrote:
>>>>>>> Hi Romain, HK2 building)Team,
>>>>>>>
>>>>>>> Normally, a user needs not to build a customized hk2
>>>>>>> version(eg.1.1.15-gf-00007-SNAPSHOT), however, I have such a case.
>>>>>>> According to hk2 1.x 's building script(eg. firstly "mvn -P
>>>>>>> release-phase1 install"), auto-building failed, so this is my problem.
>>>>>>>
>>>>>>> Although I have interrupted team to see back hk2 1.x, I really wish
>>>>>>> team can give me more advice.
>>>>>>>
>>>>>>> Thanks again!
>>>>>>> --Tang
>>>>>>>
>>>>>>> Tang Yong wrote:
>>>>>>>> Hi Romain,
>>>>>>>>
>>>>>>>>> Since hk2 1.1.15 still references maven.glassfish.org, this workaround
>>>>>>>>> is necessary if behind some proxy (depending on the proxy, maven will
>>>>>>>>> save html files as artifacts and it will corrupt your local repository).
>>>>>>>> I can understand the point because I have checked my env and set the proxy.
>>>>>>>>
>>>>>>>>>>>> [Problem]
>>>>>>>>>>>> After I checked out hk2 1.1.15[1], I plan to release a new hk2
>>>>>>>>>>>> version(1.1.15-gf-00007-SNAPSHOT) based 1.1.15. Then, I made the
>>>>>>>>>>>> following modification.
>>>>>>>>>>>>
>>>>>>>>>>>> 1) modify <version> in hk2-parent pom into 1.1.15-gf-00007-SNAPSHOT
>>>>>>>>>>>> 2) modify <parent><version> in hk2-related modules into
>>>>>>>>>>>> 1.1.15-gf-00007-SNAPSHOT
>>>>>>>>>>>>
>>>>>>>>>>>> Then, I start to execute the following command:
>>>>>>>>>>>>
>>>>>>>>>>>> mvn -P release-phase1 install
>>>>>>>> The above is my real problem, and kernel of the problem is that I want
>>>>>>>> to release a new hk2 version(1.1.15-gf-00007-SNAPSHOT) based 1.1.15. I
>>>>>>>> can build hk2 1.1.15 successfully, however, after I made the above
>>>>>>>> modifications, building failed.
>>>>>>>>
>>>>>>>> Thanks!
>>>>>>>> --Tang
>>>>>>>>
>>>>>>>> Romain Grecourt wrote:
>>>>>>>>> On 10/09/2012 11:53 AM, Tang Yong wrote:
>>>>>>>>>> Hi Romain,
>>>>>>>>>>
>>>>>>>>>> Thanks your quick reply!
>>>>>>>>>>
>>>>>>>>>> > Which mvn version are you using ?
>>>>>>>>>> maven 3.0.4
>>>>>>>>>> jdk 1.6.0_34
>>>>>>>>>>
>>>>>>>>>> > Are you using the following workaround ?
>>>>>>>>>>> https://wikis.oracle.com/display/GlassFish/FullBuildInstructions#FullBuildInstructions-Settings.xml
>>>>>>>>>> Romain, this is to gf trunk , what I built is HK2. I can build gf's
>>>>>>>>>> building successfully.
>>>>>>>>> Since hk2 1.1.15 still references maven.glassfish.org, this workaround
>>>>>>>>> is necessary if behind some proxy (depending on the proxy, maven will
>>>>>>>>> save html files as artifacts and it will corrupt your local repository).
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Romain
>>>>>>>>>> Thanks!
>>>>>>>>>> --Tang
>>>>>>>>>>
>>>>>>>>>> Romain Grecourt wrote:
>>>>>>>>>>> Hi Tang,
>>>>>>>>>>>
>>>>>>>>>>> Which mvn version are you using ?
>>>>>>>>>>> Are you using the following workaround ?
>>>>>>>>>>> https://wikis.oracle.com/display/GlassFish/FullBuildInstructions#FullBuildInstructions-Settings.xml
>>>>>>>>>>>
>>>>>>>>>>> Please, see my comments inline.
>>>>>>>>>>>
>>>>>>>>>>> On 10/09/2012 10:22 AM, Tang Yong wrote:
>>>>>>>>>>>> Hi HK2)Team
>>>>>>>>>>>> CC: Sahoo
>>>>>>>>>>>>
>>>>>>>>>>>> Today, I met a hk2 1.1.15(hk2 earlier version) building problem and
>>>>>>>>>>>> want to ask a right solution.
>>>>>>>>>>>>
>>>>>>>>>>>> [Problem]
>>>>>>>>>>>> After I checked out hk2 1.1.15[1], I plan to release a new hk2
>>>>>>>>>>>> version(1.1.15-gf-00007-SNAPSHOT) based 1.1.15. Then, I made the
>>>>>>>>>>>> following modification.
>>>>>>>>>>>>
>>>>>>>>>>>> 1) modify <version> in hk2-parent pom into 1.1.15-gf-00007-SNAPSHOT
>>>>>>>>>>>> 2) modify <parent><version> in hk2-related modules into
>>>>>>>>>>>> 1.1.15-gf-00007-SNAPSHOT
>>>>>>>>>>>>
>>>>>>>>>>>> Then, I start to execute the following command:
>>>>>>>>>>>>
>>>>>>>>>>>> mvn -P release-phase1 install
>>>>>>>>>>>>
>>>>>>>>>>>> However, the following execption happened on cmd shell,
>>>>>>>>>>>> ...
>>>>>>>>>>>> [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ external ---
>>>>>>>>>>>> [INFO] Forking Inversion of Control / Autodependency mechanism
>>>>>>>>>>>> 1.1.15-gf-00007-SNAPSHOT
>>>>>>>>>>>> ...
>>>>>>>>>>>> [INFO] Reactor Summary:
>>>>>>>>>>>> [INFO]
>>>>>>>>>>>> [INFO] Modules Subsystem ................................. SUCCESS [1.234s]
>>>>>>>>>>>> [INFO] Class Model for Hk2 ............................... FAILURE [34.422s]
>>>>>>>>>>>> ...
>>>>>>>>>>>> [ERROR] Failed to execute goal on project auto-depends: Could not
>>>>>>>>>>>> resolve dependencies for project
>>>>>>>>>>>> org.glassfish.hk2:auto-depends:jar:1.1.15-gf-00007-SNAPSHOT: Could not
>>>>>>>>>>>> find artifact
>>>>>>>>>>>> org.glassfish.hk2.external:asm-all-repackaged:jar:1.1.15-gf-00007-SNAPSHOT
>>>>>>>>>>>> ...
>>>>>>>>>>>>
>>>>>>>>>>>> [My Trying]
>>>>>>>>>>>> After seeing the above exception, I checked my maven local repo and have
>>>>>>>>>>>> not found class-model-1.1.15-gf-00007-SNAPSHOT.jar on there although
>>>>>>>>>>>> seeing from class-model's pom, class-model does not depend on
>>>>>>>>>>>> auto-depends and asm-all-repackaged.
>>>>>>>>>>> 1)
>>>>>>>>>>> It says "Failed to execute goal on project auto-depends" and the reactor
>>>>>>>>>>> summary says that there is a failure in class-model. Class-model does
>>>>>>>>>>> not depend on auto-depends!
>>>>>>>>>>>
>>>>>>>>>>> 2)
>>>>>>>>>>> The failure you reported is actually related to auto-depends which
>>>>>>>>>>> depends on asm-all-repackaged:
>>>>>>>>>>> /
>>>>>>>>>>> [INFO] [dependency:tree {execution: default-cli}]
>>>>>>>>>>> [INFO] org.glassfish.hk2:auto-depends:jar:1.1.15
>>>>>>>>>>> [INFO] +- org.jvnet:tiger-types:jar:1.2:compile
>>>>>>>>>>> [INFO] +- org.glassfish.hk2:class-model:jar:1.1.15:compile
>>>>>>>>>>> [INFO] | \- (junit:junit:jar:4.3.1:compile - omitted for duplicate)
>>>>>>>>>>> [INFO] +- junit:junit:jar:4.3.1:provided (scope not updated to compile)
>>>>>>>>>>> [INFO] \- org.glassfish.hk2.external:asm-all-repackaged:jar:1.1.15:compile/
>>>>>>>>>>>
>>>>>>>>>>> 3)
>>>>>>>>>>> Why do you have version=1.1.15-gf-000007-SNAPSHOT if you are trying to
>>>>>>>>>>> build a tag ?
>>>>>>>>>>> I'm almost sure all of this is related to the version updates you did
>>>>>>>>>>> locally.
>>>>>>>>>>>
>>>>>>>>>>> If you want to work on the 1.1.x branch, here is the SVN URL:
>>>>>>>>>>>
>>>>>>>>>>> > https://svn.java.net/svn/hk2~svn/branches/hk2-parent-1.1.x
>>>>>>>>>>>> Then, I tried to adjust building order in hk2-parent pom and put
>>>>>>>>>>>> <module>external</module> before <module>class-model</module>, but the
>>>>>>>>>>>> similar problem still happened.
>>>>>>>>>>> The module order in the pom.xml does not really matter, maven figures
>>>>>>>>>>> the reactor and the build order on its own.
>>>>>>>>>>>> Then, I tried to build the external module and other related modules
>>>>>>>>>>>> manually once simlar problems happened. As a result, anything is OK.
>>>>>>>>>>>> Then, I start to execute "mvn -P release-phase1 install" and this time,
>>>>>>>>>>>> executing is OK.
>>>>>>>>>>>>
>>>>>>>>>>>> [My Analyse]
>>>>>>>>>>>> 1) Before HK2 releases a hk2 version and source, whether team has
>>>>>>>>>>>> uploaded built jars of the version into remote maven repository in order
>>>>>>>>>>>> to make user can download these jars while executing "mvn -P
>>>>>>>>>>>> release-phase1 install" or not?
>>>>>>>>>>> No, the hk2 1.x build is split in two phases because it contains maven
>>>>>>>>>>> plugins that are also used during the build.
>>>>>>>>>>> -Prelease-phase1 builds the 1st phase which contains the maven plugins.
>>>>>>>>>>>> 2) Maybe my modification way is not right at all.
>>>>>>>>>>>>
>>>>>>>>>>>> [Request]
>>>>>>>>>>>> Could team please tell me a right doing way?
>>>>>>>>>>> I was not able to reproduce your issue.
>>>>>>>>>>> I've able to build the tag using mvn 2.2.1 and 3.0.3 (removing
>>>>>>>>>>> org/glassfish/hk2 from my local repo each time).
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> Romain
>>>>>>>>>>>> [1]: https://svn.java.net/svn/hk2~svn/tags/hk2-parent-1.1.15
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks
>>>>>>>>>>>> --Tang
>>>>>>>>>>>>
>>
>