[jira] [Commented] (NPANDAY-322) Resync Reference doesn't update SNAPSHOT artifact from local repository that already exist in .references folder

2011-11-07 Thread Lars Corneliussen (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/NPANDAY-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145541#comment-13145541
 ] 

Lars Corneliussen commented on NPANDAY-322:
---

Hi. My fault. I have no profile in my setting, which makes NPanday complain. I 
created NPANDAY-478 and fixed it locally.

Find my on Skype "lcorneliussen" or on webchat.freenode.net in the #npanday 
channel

> Resync Reference doesn't update SNAPSHOT artifact from local repository that 
> already exist in .references folder
> 
>
> Key: NPANDAY-322
> URL: https://issues.apache.org/jira/browse/NPANDAY-322
> Project: NPanday
>  Issue Type: Bug
>  Components: Visual Studio Add-in
>Affects Versions: 1.4-incubating
>Reporter: Dmitry L
>Assignee: Lars Corneliussen
>Priority: Minor
> Fix For: 1.2.1, 1.4.1-incubating
>
> Attachments: ArtifactUtils.cs, Connect.cs, 
> NPANDAY-322_and_NPANDAY-476.diff, ReferenceManager.cs, 
> TEST-npanday.its.IntegrationTestSuite.xml, 
> npanday.its.IntegrationTestSuite.txt
>
>
> Steps:
> 1. Install Library1 into local maven repo
> 2. Add Library1 as dependency using Resync Reference to ProjectA (it will be 
> copied into .references folder)
> 3. Update and reinstall Library1 into local maven repo
> 4. Invoke Resync Reference for ProjectA
> 5. Error: Library1 won't be updated in .references folder
> Expected: newer version (in terms of file timestamp) of Library1 (if any) 
> should be copied into .references folder from local maven repo during Resync 
> Reference
> Issue exist in trunk r59731

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (NPANDAY-322) Resync Reference doesn't update SNAPSHOT artifact from local repository that already exist in .references folder

2011-11-07 Thread Stoyan Damov (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/NPANDAY-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145529#comment-13145529
 ] 

Stoyan Damov commented on NPANDAY-322:
--

I'll try to make it clearer:

First, here's the new code:

{code}
if (!ArtifactUtils.Exists(artifact) || (isSnapshot && resyncFromRemoteRepo))
{
if (!ArtifactUtils.DownloadFromRemoteRepository(artifact, logger))
{
RaiseError("Unable to get the artifact {0} from any of your 
repositories.", artifact.ArtifactId);
return;
}
}

CopyToReferenceFolder(artifact, referenceFolder);
{code}

*TODO*: gotta go, will comment a bit later tonight.


> Resync Reference doesn't update SNAPSHOT artifact from local repository that 
> already exist in .references folder
> 
>
> Key: NPANDAY-322
> URL: https://issues.apache.org/jira/browse/NPANDAY-322
> Project: NPanday
>  Issue Type: Bug
>  Components: Visual Studio Add-in
>Affects Versions: 1.4-incubating
>Reporter: Dmitry L
>Assignee: Lars Corneliussen
>Priority: Minor
> Fix For: 1.2.1, 1.4.1-incubating
>
> Attachments: ArtifactUtils.cs, Connect.cs, 
> NPANDAY-322_and_NPANDAY-476.diff, ReferenceManager.cs, 
> TEST-npanday.its.IntegrationTestSuite.xml, 
> npanday.its.IntegrationTestSuite.txt
>
>
> Steps:
> 1. Install Library1 into local maven repo
> 2. Add Library1 as dependency using Resync Reference to ProjectA (it will be 
> copied into .references folder)
> 3. Update and reinstall Library1 into local maven repo
> 4. Invoke Resync Reference for ProjectA
> 5. Error: Library1 won't be updated in .references folder
> Expected: newer version (in terms of file timestamp) of Library1 (if any) 
> should be copied into .references folder from local maven repo during Resync 
> Reference
> Issue exist in trunk r59731

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (NPANDAY-322) Resync Reference doesn't update SNAPSHOT artifact from local repository that already exist in .references folder

2011-11-07 Thread Lars Corneliussen (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/NPANDAY-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145503#comment-13145503
 ] 

Lars Corneliussen commented on NPANDAY-322:
---

I still get an exception, if the artifact is not deployed to any of the remote 
repositories. That's not correct, is it?

Both Resync and Resync from Local Repo should work in that case, right?

Just that Resync from Local Repo should give local snapshots precedence over 
remote ones, even if the remote ones are newer. Right, too?

> Resync Reference doesn't update SNAPSHOT artifact from local repository that 
> already exist in .references folder
> 
>
> Key: NPANDAY-322
> URL: https://issues.apache.org/jira/browse/NPANDAY-322
> Project: NPanday
>  Issue Type: Bug
>  Components: Visual Studio Add-in
>Affects Versions: 1.4-incubating
>Reporter: Dmitry L
>Assignee: Lars Corneliussen
>Priority: Minor
> Fix For: 1.2.1, 1.4.1-incubating
>
> Attachments: ArtifactUtils.cs, Connect.cs, 
> NPANDAY-322_and_NPANDAY-476.diff, ReferenceManager.cs, 
> TEST-npanday.its.IntegrationTestSuite.xml, 
> npanday.its.IntegrationTestSuite.txt
>
>
> Steps:
> 1. Install Library1 into local maven repo
> 2. Add Library1 as dependency using Resync Reference to ProjectA (it will be 
> copied into .references folder)
> 3. Update and reinstall Library1 into local maven repo
> 4. Invoke Resync Reference for ProjectA
> 5. Error: Library1 won't be updated in .references folder
> Expected: newer version (in terms of file timestamp) of Library1 (if any) 
> should be copied into .references folder from local maven repo during Resync 
> Reference
> Issue exist in trunk r59731

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (NPANDAY-322) Resync Reference doesn't update SNAPSHOT artifact from local repository that already exist in .references folder

2011-11-04 Thread Lars Corneliussen (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/NPANDAY-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13144141#comment-13144141
 ] 

Lars Corneliussen commented on NPANDAY-322:
---

I have committed the fix without changes. I'll test if it works on my machine 
next week.

> Resync Reference doesn't update SNAPSHOT artifact from local repository that 
> already exist in .references folder
> 
>
> Key: NPANDAY-322
> URL: https://issues.apache.org/jira/browse/NPANDAY-322
> Project: NPanday
>  Issue Type: Bug
>  Components: Visual Studio Add-in
>Affects Versions: 1.4-incubating
>Reporter: Dmitry L
>Assignee: Lars Corneliussen
>Priority: Minor
> Fix For: 1.2.1, 1.4.1-incubating
>
> Attachments: ArtifactUtils.cs, Connect.cs, 
> NPANDAY-322_and_NPANDAY-476.diff, ReferenceManager.cs, 
> TEST-npanday.its.IntegrationTestSuite.xml, 
> npanday.its.IntegrationTestSuite.txt
>
>
> Steps:
> 1. Install Library1 into local maven repo
> 2. Add Library1 as dependency using Resync Reference to ProjectA (it will be 
> copied into .references folder)
> 3. Update and reinstall Library1 into local maven repo
> 4. Invoke Resync Reference for ProjectA
> 5. Error: Library1 won't be updated in .references folder
> Expected: newer version (in terms of file timestamp) of Library1 (if any) 
> should be copied into .references folder from local maven repo during Resync 
> Reference
> Issue exist in trunk r59731

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (NPANDAY-322) Resync Reference doesn't update SNAPSHOT artifact from local repository that already exist in .references folder

2011-11-03 Thread Stoyan Damov (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/NPANDAY-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13143177#comment-13143177
 ] 

Stoyan Damov commented on NPANDAY-322:
--

I just did, here's the output:

{code}
---
 T E S T S
---
Running npanday.its.IntegrationTestSuite
Using NPanday version 1.4.1-incubating-SNAPSHOT
Available framework versions: [v2.0.50727, v4.0.30319]
Selected framework version: v4.0.30319

Bootstrap.testBootstrap   OK
NPANDAY_377_WithCustomNPandaySettingsFile.testOK
NPANDAY_377_WithCustomNPandaySettingsDirectory.test   OK
NPANDAY_329_VS2010WcfProjectSupport.testWCF2010ProjectOK
NPANDAY_328_VS2010WpfProjectSupport.testWPF2010ProjectOK
NPANDAY_330_VS2010MvcProjectSupport.testMVC2010ProjectOK
NPANDAY_288_Net40Support.testNet40Project OK
NPANDAY_302_SnapshotUpdates.testUniqueSnapshotUpdates OK
NPANDAY_292_CompilerParamForOptioninfer.testWithOptionInfer   OK
NPANDAY_140_ConflictingExtensions.testConflictingExtensions
NPANDAY_268_TransitiveDependencies.testLadderBuildOK
NPANDAY_268_TransitiveDependencies.testTransitiveDependenciesNotOnCompileOK
NPANDAY_262_ResolvingMixedVersions.testMixedVersionResolution OK
NPANDAY_196_MvcSupport.testMVCProject OK
NPANDAY_245_WpfGeneratedResourcesHandling.testWpfProject  OK
NPANDAY_198_MissingGroupOrVersion.testMissingGroupIdAndVersionShouldBeInheritedOK
NPANDAY_208_MsBuildCopyReferences.testMsBuildCopyReferences   OK
NPANDAY_202_MsBuildErrorHandling.testMsBuildErrorsHandled OK
NPANDAY_121_ResGenWithErrorInFileName.testResGenWithErrorInFileName   OK
NPandayIT0014WithResourceFile.testWithResourceFileOK
NPandayIT0013WebAppInstall.testWebAppInstall  OK
NPandayIT0012VBWebApp.testWebAppInstall   OK
NPandayIT0011SnapshotResolution.testUniqueSnapshotResolution  OK
NPandayIT0011SnapshotResolution.testNonUniqueSnapshotResolution   OK
NPandayIT0041Net35.testNet35Project   OK
NPandayIT0040IntraProjectDependency.testIntraProjectDependencyOK
NPandayIT0039ConsoleApplication.testConsoleApplicationOK
NPandayIT0038CompilerWithArgs.testCompilerWithArgsOK
NPandayIT0037ClassLibWithWebRefInstall.testClassLibWithWebRefInstall  OK
NPandayIT0036InstalledArtifactsVerification.testIT0036InstalledArtifactsOK
NPandayIT0035VBRootNamespace.testVBRootNamespace  OK
NPandayIT0032CompileExclusions.testCompileExclusions  OK
NPandayIT0029RemoteRepo.testDeployNonSnapshotRemoteRepo   OK
NPandayIT0028RemoteSnapshotRepo.testSnapDeploymentRemoteRepoNotUnique OK
NPandayIT0022StrongNameKeyAddedToAssembly.testStrongNameKeyAddedToAssemblyOK
NPandayIT0020EmbeddedResources.testEmbeddedResources  OK
NPandayIT0010VBCompilation.testVBCompilation  OK
NPandayIT0007XSDVerification.testGenerateXsdFromXml   OK
NPandayIT0006StockingHandlers.testXsdPlugin   OK
NPandayIT0004NUnitTestVerification.testNUnitTestsRun  OK
NPandayIT0001CompilerVerification.testCompiler
OK@SLTests run: 41, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
496.292 sec <<< FAILURE!

Results :

Tests in error:
  testConflictingExtensions(npanday.its.NPANDAY_140_ConflictingExtensionsTest)

Tests run: 41, Failures: 0, Errors: 1, Skipped: 0

[INFO] 
[ERROR] BUILD FAILURE
[INFO] 
[INFO] There are test failures.

Please refer to C:\Work\svn\npanday-its\target\surefire-reports for the 
individual test results.
[INFO] 
[INFO] For more information, run Maven with the -e switch
[INFO] 
[INFO] Total time: 8 minutes 18 seconds
[INFO] Finished at: Thu Nov 03 15:35:17 EET 2011
[INFO] Final Memory: 9M/22M
[INFO] 
C:\Work\svn\npanday-its>
{code}

I'm not sure whether this is something which I broke or something known. Let me 
know if I should invest time to check or this is something known.
I'll attach the surefire-reports files in a minute.

Thanks,
Stoyan

> Resync Reference doesn't update SNAPSHOT artifact from local repository that 
> already exist in .references folder
> ---

[jira] [Commented] (NPANDAY-322) Resync Reference doesn't update SNAPSHOT artifact from local repository that already exist in .references folder

2011-11-03 Thread Lars Corneliussen (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/NPANDAY-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13143111#comment-13143111
 ] 

Lars Corneliussen commented on NPANDAY-322:
---

Sure, comments would be fine.
Also, have you run the integration tests locally?

I'll test your patch locally tomorrow, and commit it, if it's fine.

> Resync Reference doesn't update SNAPSHOT artifact from local repository that 
> already exist in .references folder
> 
>
> Key: NPANDAY-322
> URL: https://issues.apache.org/jira/browse/NPANDAY-322
> Project: NPanday
>  Issue Type: Bug
>  Components: Visual Studio Add-in
>Affects Versions: 1.4-incubating
>Reporter: Dmitry L
>Priority: Minor
> Fix For: 1.2.1
>
> Attachments: ArtifactUtils.cs, Connect.cs, 
> NPANDAY-322_and_NPANDAY-476.diff, ReferenceManager.cs
>
>
> Steps:
> 1. Install Library1 into local maven repo
> 2. Add Library1 as dependency using Resync Reference to ProjectA (it will be 
> copied into .references folder)
> 3. Update and reinstall Library1 into local maven repo
> 4. Invoke Resync Reference for ProjectA
> 5. Error: Library1 won't be updated in .references folder
> Expected: newer version (in terms of file timestamp) of Library1 (if any) 
> should be copied into .references folder from local maven repo during Resync 
> Reference
> Issue exist in trunk r59731

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (NPANDAY-322) Resync Reference doesn't update SNAPSHOT artifact from local repository that already exist in .references folder

2011-11-03 Thread Stoyan Damov (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/NPANDAY-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13143094#comment-13143094
 ] 

Stoyan Damov commented on NPANDAY-322:
--

h3. Added {{ArtifactUtils}} helper class with the following methods:

{code}
bool IsSnapshot(Artifact.Artifact artifact)
{code}

Checks whether the artifact is a snapshot one, implementation checks whether 
artifact's version ends on {{-SNAPSHOT}}.

{code}
bool Exists(Artifact.Artifact artifact)
{code}

Checks whether the artifact exists in the local repository (impl. in terms of 
{{artifact.FileInfo.Exists}})

{code}
bool DownloadFromRemoteRepository(Artifact.Artifact artifact, 
NPanday.Logging.Logger logger)
{code}

Downloads the artifact from the remote repository. Same as 
{{NPanday.ProjectImporter.Digest.Model.Reference.DownloadArtifact(artifact, 
logger)}}.

{code}
string GetArtifactReferenceFolder(Artifact.Artifact artifact, string 
referenceFolder)
{code}

Returns the reference folder for the artifact, modified to match the .dll 
searched in {{NPanday.ProjectImporter.Digest.Model.Reference.cs}}. The format 
is {{referenceFolder\groupId\artifactId-version}}, e.g. 
{{SomeFolder\.references\com.company.something\artifact-1.0-SNAPSHOT}}

{code}
string GetArtifactReferenceFilePath(Artifact.Artifact artifact, string 
referenceFolder)
{code}

Returns path to the artifact's file in the local reference folder in the format 
{{GetArtifactReferenceFolder()\artifactId.extension}}, e.g. 
{{SomeFolder\.references\com.company.something\artifact-1.0-SNAPSHOT\artifact.dll}}.

{code}
DateTime GetArtifactTimestamp(Artifact.Artifact artifact)
{code}

Returs the artifact's timestamp in the local repository. Attempts to get the 
timestamp off {{maven-metadata-repoId.xml}} or {{maven-metadata-local.xml}}, 
falls back to file's {{LastWriteStampUtc}}.

{code}
bool IsEarlierArtifactTimestamp(DateTime value, DateTime comparand)
{code}

Compares two timestamps disregarding the milliseconds (timestamps in 
{{maven-metadata-*.xml}} do not have milliseconds).


> Resync Reference doesn't update SNAPSHOT artifact from local repository that 
> already exist in .references folder
> 
>
> Key: NPANDAY-322
> URL: https://issues.apache.org/jira/browse/NPANDAY-322
> Project: NPanday
>  Issue Type: Bug
>  Components: Visual Studio Add-in
>Affects Versions: 1.4-incubating
>Reporter: Dmitry L
>Priority: Minor
> Fix For: 1.2.1
>
> Attachments: ArtifactUtils.cs, Connect.cs, 
> NPANDAY-322_and_NPANDAY-476.diff, ReferenceManager.cs
>
>
> Steps:
> 1. Install Library1 into local maven repo
> 2. Add Library1 as dependency using Resync Reference to ProjectA (it will be 
> copied into .references folder)
> 3. Update and reinstall Library1 into local maven repo
> 4. Invoke Resync Reference for ProjectA
> 5. Error: Library1 won't be updated in .references folder
> Expected: newer version (in terms of file timestamp) of Library1 (if any) 
> should be copied into .references folder from local maven repo during Resync 
> Reference
> Issue exist in trunk r59731

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (NPANDAY-322) Resync Reference doesn't update SNAPSHOT artifact from local repository that already exist in .references folder

2011-11-03 Thread Stoyan Damov (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/NPANDAY-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13143066#comment-13143066
 ] 

Stoyan Damov commented on NPANDAY-322:
--

The fix which I'm about to attach to this ticket (btw what should be it? a 
.patch or a .diff file?) reverts to File.Copy.

> Resync Reference doesn't update SNAPSHOT artifact from local repository that 
> already exist in .references folder
> 
>
> Key: NPANDAY-322
> URL: https://issues.apache.org/jira/browse/NPANDAY-322
> Project: NPanday
>  Issue Type: Bug
>  Components: Visual Studio Add-in
>Affects Versions: 1.4-incubating
>Reporter: Dmitry L
>Priority: Minor
> Fix For: 1.2.1
>
>
> Steps:
> 1. Install Library1 into local maven repo
> 2. Add Library1 as dependency using Resync Reference to ProjectA (it will be 
> copied into .references folder)
> 3. Update and reinstall Library1 into local maven repo
> 4. Invoke Resync Reference for ProjectA
> 5. Error: Library1 won't be updated in .references folder
> Expected: newer version (in terms of file timestamp) of Library1 (if any) 
> should be copied into .references folder from local maven repo during Resync 
> Reference
> Issue exist in trunk r59731

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (NPANDAY-322) Resync Reference doesn't update SNAPSHOT artifact from local repository that already exist in .references folder

2011-11-03 Thread Lars Corneliussen (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/NPANDAY-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13143057#comment-13143057
 ] 

Lars Corneliussen commented on NPANDAY-322:
---

I can't see, why File.Copy has been changed..
Who made the change? Ask the committer why he made this change..

Also I really, sorry, hate the silent-catches all over NPanday. This is an 
error - not showing it, doesn't make it any better.

> Resync Reference doesn't update SNAPSHOT artifact from local repository that 
> already exist in .references folder
> 
>
> Key: NPANDAY-322
> URL: https://issues.apache.org/jira/browse/NPANDAY-322
> Project: NPanday
>  Issue Type: Bug
>  Components: Visual Studio Add-in
>Affects Versions: 1.4-incubating
>Reporter: Dmitry L
>Priority: Minor
> Fix For: 1.2.1
>
>
> Steps:
> 1. Install Library1 into local maven repo
> 2. Add Library1 as dependency using Resync Reference to ProjectA (it will be 
> copied into .references folder)
> 3. Update and reinstall Library1 into local maven repo
> 4. Invoke Resync Reference for ProjectA
> 5. Error: Library1 won't be updated in .references folder
> Expected: newer version (in terms of file timestamp) of Library1 (if any) 
> should be copied into .references folder from local maven repo during Resync 
> Reference
> Issue exist in trunk r59731

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (NPANDAY-322) Resync Reference doesn't update SNAPSHOT artifact from local repository that already exist in .references folder

2011-11-02 Thread Stoyan Damov (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/NPANDAY-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142494#comment-13142494
 ] 

Stoyan Damov commented on NPANDAY-322:
--

I checked out the trunk and it's a bit worse there because the actual file copy 
in {{ReferenceManager.CopyToReferenceFolder}} changed from:

{code}
File.Copy(artifact.FileInfo.FullName, artifactFileName, true);
{code}

to:

{code}
try
{
byte[] contents = File.ReadAllBytes(artifact.FileInfo.FullName);
File.WriteAllBytes(artifactFileName, contents);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
{code}

Ignoring the {{Console.WriteLine}} call (and postponing the *why?*), the code 
above creates a new file (with a new last write timestamp) in the 
{{.references}} folder which means that if the artifact got updated between the 
resync and the actual copy, next time the check for a sooner timestamp will 
fail.

The best thing to do is to not deal with file timestamps at all, and instead 
read {{maven-metadata*.xml}} files in the local repo and get the timestamp from 
there. This also means that copying the artifact to the {{.references}} folder 
should either copy the .xml files as well, or create a timestamp file or at 
least change the file timestamp to the one from the xml(s).

What do you think about that?

Other than that, I already started working on the patch (deleted the quick & 
dirty one I had in order to make something which will hopefully be accepted for 
commit).


> Resync Reference doesn't update SNAPSHOT artifact from local repository that 
> already exist in .references folder
> 
>
> Key: NPANDAY-322
> URL: https://issues.apache.org/jira/browse/NPANDAY-322
> Project: NPanday
>  Issue Type: Bug
>  Components: Visual Studio Add-in
>Affects Versions: 1.4-incubating
>Reporter: Dmitry L
>Priority: Minor
> Fix For: 1.2.1
>
>
> Steps:
> 1. Install Library1 into local maven repo
> 2. Add Library1 as dependency using Resync Reference to ProjectA (it will be 
> copied into .references folder)
> 3. Update and reinstall Library1 into local maven repo
> 4. Invoke Resync Reference for ProjectA
> 5. Error: Library1 won't be updated in .references folder
> Expected: newer version (in terms of file timestamp) of Library1 (if any) 
> should be copied into .references folder from local maven repo during Resync 
> Reference
> Issue exist in trunk r59731

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (NPANDAY-322) Resync Reference doesn't update SNAPSHOT artifact from local repository that already exist in .references folder

2011-11-02 Thread Lars Corneliussen (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/NPANDAY-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13141980#comment-13141980
 ] 

Lars Corneliussen commented on NPANDAY-322:
---

I agree; I even stumbled upon the same problem just a couple of days ago.

Would you consider submitting a patch we could then apply?

> Resync Reference doesn't update SNAPSHOT artifact from local repository that 
> already exist in .references folder
> 
>
> Key: NPANDAY-322
> URL: https://issues.apache.org/jira/browse/NPANDAY-322
> Project: NPanday
>  Issue Type: Bug
>  Components: Visual Studio Add-in
>Affects Versions: 1.4-incubating
>Reporter: Dmitry L
>Priority: Minor
> Fix For: 1.2.1
>
>
> Steps:
> 1. Install Library1 into local maven repo
> 2. Add Library1 as dependency using Resync Reference to ProjectA (it will be 
> copied into .references folder)
> 3. Update and reinstall Library1 into local maven repo
> 4. Invoke Resync Reference for ProjectA
> 5. Error: Library1 won't be updated in .references folder
> Expected: newer version (in terms of file timestamp) of Library1 (if any) 
> should be copied into .references folder from local maven repo during Resync 
> Reference
> Issue exist in trunk r59731

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (NPANDAY-322) Resync Reference doesn't update SNAPSHOT artifact from local repository that already exist in .references folder

2011-11-01 Thread Stoyan Damov (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/NPANDAY-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13141596#comment-13141596
 ] 

Stoyan Damov commented on NPANDAY-322:
--

I can't re-open the ticket but the problem is still there in 
NPanDay.VisualStudio.Plugin (mainly in ReferenceManager).

In ReferenceManager.CopyArtifact there's this snippet

{code}
if (!artifact.FileInfo.Exists || artifact.Version.EndsWith("SNAPSHOT"))
{
if 
(!NPanday.ProjectImporter.Digest.Model.Reference.DownloadArtifact(artifact,logger))
{
ReferenceErrorEventArgs e = new ReferenceErrorEventArgs();
e.Message = string.Format("Unable to get the artifact {0} from any of 
your repositories.", artifact.ArtifactId);
onError(e);
return;
}
}
{code}

The check for SNAPSHOT above forces "Resync references" to try and download the 
artifact off the remote repository.
If the artifact is not yet installed (which is common if I'm developing a new 
module but don't want to commit/push it yet), what happens is that:
# The resync fails (which is bad) and
# If the artifact is installed in the local repo, it gets deleted (which is
worse)

What should happen (for SNAPSHOTs) instead is this:

# Try to get timestamp of artifact in remote repo. If that fails, it shouldn't 
be a problem, the artifact might not be deployed (yet).
# Try to get timestamp of artifact in local repo. If that fails, then this is 
an error and should be reported.
# Get the timestamp of the local file (in .references/...)
# If there's a remote timestamp and it's greater than the local one, update the 
local repo's artifact.
# If the local repo's timestamp (possibly updated at point 4) is greater than 
the timestamp of the local file, update the file in .references/...

For steps 1 and 2 use the timestamp in maven-metadata(-local?).xml (in 
ReferenceManager.copyToReferenceFolder there's already a TODO which suggests
to use {{metadata/versioning/lastUpdated}} for the timestamp). Currently, the 
local repo's timestamp is considered to be the file's last write time (not even 
{{.LastWriteTimeUtc}}, which is another bug).

To make it clear, since we're all developers, here's the algo in pseudo code 
(this might not compile, I'm writing it in Jira):

{code}
DateTime remoteRepoTimestamp, localRepoTimestamp, localFileTimestamp;
bool hasRemoteTimestamp =TryGetArtifactRemoteRepositoryTimestamp(artifact, 
logger, out remoteRepoTimestamp);
bool hasLocalRepoTimestamp = TryGetArtifactLocalRepositoryTimestamp(artifact, 
logger, out localRepoTimestamp);
localFileTimestamp = GetLocalFileTimestamp(artifact.FileInfo, logger);

if (hasRemoteTimestamp && hasLocalRepoTimestamp && remoteRepoTimestamp > 
localRepoTimestamp)
{
UpdateLocalRepoArtifact(); // == 
NPanday.ProjectImporter.Digest.Model.Reference.DownloadArtifact(artifact, 
logger)
// ^^ error handling above omitted for brevity
localRepoTimestamp = remoteRepoTimestamp;
}
if (hasLocalRepoTimestamp && localRepoTimestamp > localFileTimestamp)
{
copyToReferenceFolder(artifact, referenceFolder);
}
{code}

Something like this.

> Resync Reference doesn't update SNAPSHOT artifact from local repository that 
> already exist in .references folder
> 
>
> Key: NPANDAY-322
> URL: https://issues.apache.org/jira/browse/NPANDAY-322
> Project: NPanday
>  Issue Type: Bug
>Reporter: Dmitry L
>Assignee: Joe Ocaba
>Priority: Minor
> Fix For: 1.2.1
>
>
> Steps:
> 1. Install Library1 into local maven repo
> 2. Add Library1 as dependency using Resync Reference to ProjectA (it will be 
> copied into .references folder)
> 3. Update and reinstall Library1 into local maven repo
> 4. Invoke Resync Reference for ProjectA
> 5. Error: Library1 won't be updated in .references folder
> Expected: newer version (in terms of file timestamp) of Library1 (if any) 
> should be copied into .references folder from local maven repo during Resync 
> Reference
> Issue exist in trunk r59731

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira