dev@glassfish.java.net

Re: About a problem of HK2 building

From: Romain Grecourt <romain.grecourt_at_oracle.com>
Date: Wed, 10 Oct 2012 16:31:43 +0200

Hi Tang,

On 10/10/2012 04:11 PM, 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.
The steps I've described should work as is on the 1.x branch, if not let
me know.
As I said previously, because it's working in the branch and in the tag,
It's likely that your local changes are the cause of the failure you are
facing.

Here are two ways of updating the versions:

[pre-requisite]:
-> populate regular 1.x snapshot in your local repository (the steps
I've described previously)

1)
- release:update-versions (
http://maven.apache.org/plugins/maven-release-plugin/update-versions-mojo.html)

2)
- use release:prepare -B --fail-never
-DreleaseVersion=1.1.15-ty-00005-SNAPSHOT
-DpreparationGoals="A_NON_EXISTENT_GOAL"

Note that those steps why not be completely accurate.
Also, why the need for such custom version ? why not simply use the 1.x
branch ?


If -Prelease-phase1 fails because it's not able to find some
1.1.15-ty-00005-SNAPSHOT artifacts, it should mean that you may have
forgot to update a pom.xml somewhere.

Thanks,
Romain
>
> 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
>>>>>>>>>
>>