dev@glassfish.java.net

Re: how to build v3 offline ?

From: Timothy Quinn <Timothy.Quinn_at_Sun.COM>
Date: Tue, 04 Mar 2008 10:42:36 -0600

My point is that we should not be creating poms in the first place that
make maven command-line options like -o unusable.

So if this is what the setting should be, then that's how it should be
in the repository. Each developer should not have to edit his or her
copies of the poms to make it work.

I'm not objecting to your suggestion for what the setting should be.
I'm saying that if that's what's correct let's make it correct in the
repository and not tell everyone to hand-edit the setting themselves.

- Tim

Sahoo wrote:
> I don't see much wrong with this. All we are doing is changing the
> default value from "daily" to "never" to take control over when we
> want to update the local repo with newer snapshot builds.
>
> Sahoo
>
> Timothy Quinn wrote:
>> As a workaround I can see this as OK, but surely it should not be
>> necessary for us to change such settings to be able to build locally,
>> should it?
>>
>> - Tim
>>
>> Sahoo wrote:
>>> Anissa,
>>>
>>> Try setting the "updatePolicy" to "never" in your ~/.m2/settings.xml
>>> for the java.net repositories like this:
>>> <repository>
>>> <id>java.net-m2-repository</id>
>>> <url>http://download.java.net/maven/2</url>
>>> <layout>default</layout>
>>> <snapshots>
>>> <updatePolicy>always</updatePolicy>
>>> </snapshots>
>>> </repository>
>>>
>>> Do this for http://download.java.net/maven/glassfish repository as
>>> well.
>>>
>>> When you want to refresh things, run mvn -U option.
>>>
>>> Thanks,
>>> Sahoo
>>>
>>> Anissa Lam wrote:
>>>>
>>>> Hi Kohsuke,
>>>> Do you have any comment on this ? Without able to control a
>>>> working environment is really hurting me.
>>>> This morning, i am having the same issue. 'mvn -o' requires
>>>> new download.
>>>> All i want is to keep everything the same except to compile 1
>>>> single file as i said earlier
>>>>> Can someone tell me how i can achieve what i intended, ie, don't
>>>>> check for anything, just use everything in my local repository,
>>>>> only recompile that 1 file for me. Is this doable ?
>>>>
>>>> anissa-lams-computer:~/Awork/V3/v3/admingui/plugin anilam$ mvn -o
>>>> install
>>>> [INFO]
>>>> NOTE: Maven is executing in offline mode. Any artifacts not already
>>>> in your local
>>>> repository will be inaccessible.
>>>>
>>>> [INFO] Scanning for projects...
>>>> [INFO] snapshot
>>>> org.glassfish.build:maven-glassfish-extension:1.0-SNAPSHOT:
>>>> checking for updates from glassfish-repository
>>>> [INFO] snapshot
>>>> org.glassfish.build:maven-glassfish-extension:1.0-SNAPSHOT:
>>>> checking for updates from glassfish-repository-wsinterop
>>>> [INFO] snapshot
>>>> org.glassfish.build:maven-glassfish-extension:1.0-SNAPSHOT:
>>>> checking for updates from java-dev-repository
>>>> [INFO] snapshot
>>>> org.glassfish.build:maven-glassfish-extension:1.0-SNAPSHOT:
>>>> checking for updates from repo1.maven.org
>>>> [INFO] snapshot
>>>> org.glassfish.build:maven-glassfish-extension:1.0-SNAPSHOT:
>>>> checking for updates from maven2.java.net
>>>> [INFO] snapshot
>>>> org.glassfish.build:maven-glassfish-extension:1.0-SNAPSHOT:
>>>> checking for updates from maven2.java.net-backup
>>>> [INFO] snapshot org.glassfish.build:build:10.0-SNAPSHOT: checking
>>>> for updates from glassfish-repository
>>>> [INFO] snapshot org.glassfish.build:build:10.0-SNAPSHOT: checking
>>>> for updates from glassfish-repository-wsinterop
>>>> [INFO] snapshot org.glassfish.build:build:10.0-SNAPSHOT: checking
>>>> for updates from java-dev-repository
>>>> [INFO] snapshot org.glassfish.build:build:10.0-SNAPSHOT: checking
>>>> for updates from repo1.maven.org
>>>> [INFO] snapshot org.glassfish.build:build:10.0-SNAPSHOT: checking
>>>> for updates from maven2.java.net
>>>> [INFO] snapshot org.glassfish.build:build:10.0-SNAPSHOT: checking
>>>> for updates from maven2.java.net-backup
>>>> [INFO] snapshot com.sun.enterprise:hk2-maven-plugin:0.2-SNAPSHOT:
>>>> checking for updates from glassfish-repository
>>>> [INFO] snapshot com.sun.enterprise:hk2-maven-plugin:0.2-SNAPSHOT:
>>>> checking for updates from glassfish-repository-wsinterop
>>>> [INFO] snapshot com.sun.enterprise:hk2-maven-plugin:0.2-SNAPSHOT:
>>>> checking for updates from maven2.java.net
>>>> [INFO] snapshot com.sun.enterprise:hk2-maven-plugin:0.2-SNAPSHOT:
>>>> checking for updates from maven2.java.net-wsinterop
>>>> [INFO] snapshot com.sun.enterprise:hk2-maven-plugin:0.2-SNAPSHOT:
>>>> checking for updates from java-dev-repository
>>>> [INFO] snapshot com.sun.enterprise:hk2-maven-plugin:0.2-SNAPSHOT:
>>>> checking for updates from repo1.maven.org
>>>> [INFO] snapshot com.sun.enterprise:hk2-maven-plugin:0.2-SNAPSHOT:
>>>> checking for updates from maven2.java.net-backup
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>> [ERROR] BUILD ERROR
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>> [INFO] Failed to resolve artifact.
>>>>
>>>> GroupId: com.sun.enterprise
>>>> ArtifactId: hk2-maven-plugin
>>>> Version: 0.2-SNAPSHOT
>>>>
>>>> Reason: System is offline.
>>>>
>>>> com.sun.enterprise:hk2-maven-plugin:pom:0.2-SNAPSHOT
>>>>
>>>> NOTE: Maven is executing in offline mode. Any artifacts not already
>>>> in your local
>>>> repository will be inaccessible.
>>>>
>>>>
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>> [INFO] For more information, run Maven with the -e switch
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>> [INFO] Total time: 1 second
>>>> [INFO] Finished at: Fri Feb 29 09:34:08 PST 2008
>>>> [INFO] Final Memory: 3M/8M
>>>>
>>>> Thanks
>>>> Anissa
>>>>
>>>>
>>>>
>>>> Anissa Lam wrote:
>>>>>
>>>>> Kedar, Thanks for sharing your instructions.
>>>>>
>>>>> It seems that building with 'mvn -o install' works for the day
>>>>> until it passes 'mid-night'. ie , the day changed. It will then
>>>>> try to bring over or require new SNAPSHOT jars if it has changed.
>>>>> At least thats my experience. I have done '-o' repeatedly
>>>>> during the day without needing to update any artifact and then the
>>>>> build failed when i do the same thing around 12:10am. And this
>>>>> happened before.
>>>>>
>>>>> Thanks
>>>>> Anissa
>>>>>
>>>>>
>>>>> Kedar Mhaswade wrote:
>>>>>> Do you build HK-2 sources, at least once?
>>>>>> Maybe doing that would solve the problem.
>>>>>>
>>>>>> Otherwise, I don't know why this won't work,
>>>>>> of course, based on my very limited understanding
>>>>>> of Maven and our build system. But I have been
>>>>>> routinely successful in doing mvn -o compile
>>>>>> and mvn -o install of v3 sources.
>>>>>>
>>>>>> The recipe that has been working for me:
>>>>>> 1- start afresh, delete ~/.m2
>>>>>> 2- co hk2, build using mvn install.
>>>>>> 3- co v3, (or a portion of it) and build using mvn install.
>>>>>> 4- now make changes to v3 sources and always build as mvn -i
>>>>>> install.
>>>>>> 5- repeat 4 until tired of this work-space :)
>>>>>>
>>>>>> - Kedar
>>>>>>
>>>>>> Anissa Lam wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have a working environment, everything is great. Then i
>>>>>>> changed one line in my admingui code and want to just recompile
>>>>>>> and test the change.
>>>>>>> I want all the server bits stays the same. So, i use the '-o'
>>>>>>> offline mode.
>>>>>>> I don't expect and don't want it to go out and check for any
>>>>>>> updates and thus risk messing up my working environment.
>>>>>>> Yet, i am getting the following error.
>>>>>>>
>>>>>>> Can someone tell me how i can archive what i intended, ie,
>>>>>>> don't check for anything, just use everything in my local
>>>>>>> repository, only recompile that 1 file for me. Is this doable ?
>>>>>>>
>>>>>>> thanks
>>>>>>> Anissa
>>>>>>>
>>>>>>> anissa-lams-computer:~/Awork/V3/v3/admingui/core anilam$ mvn -o
>>>>>>> install
>>>>>>> [INFO]
>>>>>>> NOTE: Maven is executing in offline mode. Any artifacts not
>>>>>>> already in your local
>>>>>>> repository will be inaccessible.
>>>>>>>
>>>>>>> [INFO] Scanning for projects...
>>>>>>> [INFO] snapshot
>>>>>>> org.glassfish.build:maven-glassfish-extension:1.0-SNAPSHOT:
>>>>>>> checking for updates from glassfish-repository
>>>>>>> [INFO] snapshot
>>>>>>> org.glassfish.build:maven-glassfish-extension:1.0-SNAPSHOT:
>>>>>>> checking for updates from glassfish-repository-wsinterop
>>>>>>> [INFO] snapshot
>>>>>>> org.glassfish.build:maven-glassfish-extension:1.0-SNAPSHOT:
>>>>>>> checking for updates from java-dev-repository
>>>>>>> [INFO] snapshot
>>>>>>> org.glassfish.build:maven-glassfish-extension:1.0-SNAPSHOT:
>>>>>>> checking for updates from repo1.maven.org
>>>>>>> [INFO] snapshot
>>>>>>> org.glassfish.build:maven-glassfish-extension:1.0-SNAPSHOT:
>>>>>>> checking for updates from maven2.java.net
>>>>>>> [INFO] snapshot
>>>>>>> org.glassfish.build:maven-glassfish-extension:1.0-SNAPSHOT:
>>>>>>> checking for updates from maven2.java.net-backup
>>>>>>> [INFO]
>>>>>>> ------------------------------------------------------------------------
>>>>>>>
>>>>>>> [ERROR] BUILD ERROR
>>>>>>> [INFO]
>>>>>>> ------------------------------------------------------------------------
>>>>>>>
>>>>>>> [INFO] Failed to resolve artifact.
>>>>>>>
>>>>>>> Missing:
>>>>>>> ----------
>>>>>>> 1) org.glassfish.build:maven-glassfish-extension:jar:1.0-SNAPSHOT
>>>>>>>
>>>>>>> Try downloading the file manually from the project website.
>>>>>>>
>>>>>>> Then, install it using the command:
>>>>>>> mvn install:install-file -DgroupId=org.glassfish.build
>>>>>>> -DartifactId=maven-glassfish-extension \
>>>>>>> -Dversion=1.0-SNAPSHOT -Dpackaging=jar
>>>>>>> -Dfile=/path/to/file
>>>>>>> Alternatively, if you host your own repository you can deploy
>>>>>>> the file there: mvn deploy:deploy-file
>>>>>>> -DgroupId=org.glassfish.build
>>>>>>> -DartifactId=maven-glassfish-extension \
>>>>>>> -Dversion=1.0-SNAPSHOT -Dpackaging=jar
>>>>>>> -Dfile=/path/to/file \
>>>>>>> -Durl=[url] -DrepositoryId=[id]
>>>>>>>
>>>>>>> Path to dependency:
>>>>>>> 1) org.glassfish.admingui:console-core:hk2-jar:1.0-SNAPSHOT
>>>>>>> 2)
>>>>>>> org.glassfish.build:maven-glassfish-extension:jar:1.0-SNAPSHOT
>>>>>>>
>>>>>>> ----------
>>>>>>> 1 required artifact is missing.
>>>>>>>
>>>>>>> for artifact:
>>>>>>> org.glassfish.admingui:console-core:hk2-jar:1.0-SNAPSHOT
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>>
>>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>>
>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>