You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "alex322 (JIRA)" <ji...@apache.org> on 2008/11/04 19:52:46 UTC
[jira] Created: (IVY-965) Support useOrigin for artifacts with a
set url attribute
Support useOrigin for artifacts with a set url attribute
--------------------------------------------------------
Key: IVY-965
URL: https://issues.apache.org/jira/browse/IVY-965
Project: Ivy
Issue Type: Improvement
Components: Core
Affects Versions: 2.0-RC1
Reporter: alex322
Currently artifacts with a specified url are always considered remote because the code instantiates URLResource.
This change would allow using FileResource when the url is "file://*".
--- BasicResolver.java.original Mon Oct 20 16:47:15 2008
+++ BasicResolver.java Mon Nov 03 15:38:48 2008
@@ -64,6 +64,8 @@
import org.apache.ivy.plugins.repository.ArtifactResourceResolver;
import org.apache.ivy.plugins.repository.Resource;
import org.apache.ivy.plugins.repository.ResourceDownloader;
+import org.apache.ivy.plugins.repository.file.FileRepository;
+import org.apache.ivy.plugins.repository.file.FileResource;
import org.apache.ivy.plugins.repository.url.URLRepository;
import org.apache.ivy.plugins.repository.url.URLResource;
import org.apache.ivy.plugins.resolver.util.MDResolvedResource;
@@ -918,7 +920,14 @@
URL url = artifact.getUrl();
Message.verbose("\tusing url for " + artifact + ": " + url);
logArtifactAttempt(artifact, url.toExternalForm());
- ret = new ResolvedResource(new URLResource(url), artifact.getModuleRevisionId()
+ Resource resource;
+ if ("file".equals(url.getProtocol())) {
+ resource = new FileResource(new FileRepository(), new File(url.getPath()));
+ }
+ else {
+ resource = new URLResource(url);
+ }
+ ret = new ResolvedResource(resource, artifact.getModuleRevisionId()
.getRevision());
}
return ret;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (IVY-965) Support useOrigin for artifacts with a
set url attribute
Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Maarten Coene resolved IVY-965.
-------------------------------
Resolution: Fixed
Fix Version/s: trunk
Assignee: Maarten Coene
Thanks for the patch, I've applied it into SVN trunk.
Could you provide us your full name so we can you proper credits for your contribution?
thanks,
Maarten
> Support useOrigin for artifacts with a set url attribute
> --------------------------------------------------------
>
> Key: IVY-965
> URL: https://issues.apache.org/jira/browse/IVY-965
> Project: Ivy
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.0-RC1
> Reporter: alex322
> Assignee: Maarten Coene
> Fix For: trunk
>
>
> Currently artifacts with a specified url are always considered remote because the code instantiates URLResource.
> This change would allow using FileResource when the url is "file://*".
> {noformat}
> --- BasicResolver.java.original Mon Oct 20 16:47:15 2008
> +++ BasicResolver.java Mon Nov 03 15:38:48 2008
> @@ -64,6 +64,8 @@
> import org.apache.ivy.plugins.repository.ArtifactResourceResolver;
> import org.apache.ivy.plugins.repository.Resource;
> import org.apache.ivy.plugins.repository.ResourceDownloader;
> +import org.apache.ivy.plugins.repository.file.FileRepository;
> +import org.apache.ivy.plugins.repository.file.FileResource;
> import org.apache.ivy.plugins.repository.url.URLRepository;
> import org.apache.ivy.plugins.repository.url.URLResource;
> import org.apache.ivy.plugins.resolver.util.MDResolvedResource;
> @@ -918,7 +920,14 @@
> URL url = artifact.getUrl();
> Message.verbose("\tusing url for " + artifact + ": " + url);
> logArtifactAttempt(artifact, url.toExternalForm());
> - ret = new ResolvedResource(new URLResource(url), artifact.getModuleRevisionId()
> + Resource resource;
> + if ("file".equals(url.getProtocol())) {
> + resource = new FileResource(new FileRepository(), new File(url.getPath()));
> + }
> + else {
> + resource = new URLResource(url);
> + }
> + ret = new ResolvedResource(resource, artifact.getModuleRevisionId()
> .getRevision());
> }
> return ret;
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (IVY-965) Support useOrigin for
artifacts with a set url attribute
Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648393#action_12648393 ]
maartenc edited comment on IVY-965 at 11/17/08 2:43 PM:
-------------------------------------------------------------
Thanks for the patch, I've applied it into SVN trunk.
Could you provide us your full name so we can give you proper credits for your contribution?
thanks,
Maarten
was (Author: maartenc):
Thanks for the patch, I've applied it into SVN trunk.
Could you provide us your full name so we can you proper credits for your contribution?
thanks,
Maarten
> Support useOrigin for artifacts with a set url attribute
> --------------------------------------------------------
>
> Key: IVY-965
> URL: https://issues.apache.org/jira/browse/IVY-965
> Project: Ivy
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.0-RC1
> Reporter: alex322
> Assignee: Maarten Coene
> Fix For: trunk
>
>
> Currently artifacts with a specified url are always considered remote because the code instantiates URLResource.
> This change would allow using FileResource when the url is "file://*".
> {noformat}
> --- BasicResolver.java.original Mon Oct 20 16:47:15 2008
> +++ BasicResolver.java Mon Nov 03 15:38:48 2008
> @@ -64,6 +64,8 @@
> import org.apache.ivy.plugins.repository.ArtifactResourceResolver;
> import org.apache.ivy.plugins.repository.Resource;
> import org.apache.ivy.plugins.repository.ResourceDownloader;
> +import org.apache.ivy.plugins.repository.file.FileRepository;
> +import org.apache.ivy.plugins.repository.file.FileResource;
> import org.apache.ivy.plugins.repository.url.URLRepository;
> import org.apache.ivy.plugins.repository.url.URLResource;
> import org.apache.ivy.plugins.resolver.util.MDResolvedResource;
> @@ -918,7 +920,14 @@
> URL url = artifact.getUrl();
> Message.verbose("\tusing url for " + artifact + ": " + url);
> logArtifactAttempt(artifact, url.toExternalForm());
> - ret = new ResolvedResource(new URLResource(url), artifact.getModuleRevisionId()
> + Resource resource;
> + if ("file".equals(url.getProtocol())) {
> + resource = new FileResource(new FileRepository(), new File(url.getPath()));
> + }
> + else {
> + resource = new URLResource(url);
> + }
> + ret = new ResolvedResource(resource, artifact.getModuleRevisionId()
> .getRevision());
> }
> return ret;
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (IVY-965) Support useOrigin for artifacts with a
set url attribute
Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Maarten Coene updated IVY-965:
------------------------------
Fix Version/s: (was: trunk)
2.0
This will be included in the 2.0.0 final release.
> Support useOrigin for artifacts with a set url attribute
> --------------------------------------------------------
>
> Key: IVY-965
> URL: https://issues.apache.org/jira/browse/IVY-965
> Project: Ivy
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.0-RC1
> Reporter: alex322
> Assignee: Maarten Coene
> Fix For: 2.0
>
>
> Currently artifacts with a specified url are always considered remote because the code instantiates URLResource.
> This change would allow using FileResource when the url is "file://*".
> {noformat}
> --- BasicResolver.java.original Mon Oct 20 16:47:15 2008
> +++ BasicResolver.java Mon Nov 03 15:38:48 2008
> @@ -64,6 +64,8 @@
> import org.apache.ivy.plugins.repository.ArtifactResourceResolver;
> import org.apache.ivy.plugins.repository.Resource;
> import org.apache.ivy.plugins.repository.ResourceDownloader;
> +import org.apache.ivy.plugins.repository.file.FileRepository;
> +import org.apache.ivy.plugins.repository.file.FileResource;
> import org.apache.ivy.plugins.repository.url.URLRepository;
> import org.apache.ivy.plugins.repository.url.URLResource;
> import org.apache.ivy.plugins.resolver.util.MDResolvedResource;
> @@ -918,7 +920,14 @@
> URL url = artifact.getUrl();
> Message.verbose("\tusing url for " + artifact + ": " + url);
> logArtifactAttempt(artifact, url.toExternalForm());
> - ret = new ResolvedResource(new URLResource(url), artifact.getModuleRevisionId()
> + Resource resource;
> + if ("file".equals(url.getProtocol())) {
> + resource = new FileResource(new FileRepository(), new File(url.getPath()));
> + }
> + else {
> + resource = new URLResource(url);
> + }
> + ret = new ResolvedResource(resource, artifact.getModuleRevisionId()
> .getRevision());
> }
> return ret;
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (IVY-965) Support useOrigin for artifacts with a
set url attribute
Posted by "alex322 (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
alex322 updated IVY-965:
------------------------
Description:
Currently artifacts with a specified url are always considered remote because the code instantiates URLResource.
This change would allow using FileResource when the url is "file://*".
{noformat}
--- BasicResolver.java.original Mon Oct 20 16:47:15 2008
+++ BasicResolver.java Mon Nov 03 15:38:48 2008
@@ -64,6 +64,8 @@
import org.apache.ivy.plugins.repository.ArtifactResourceResolver;
import org.apache.ivy.plugins.repository.Resource;
import org.apache.ivy.plugins.repository.ResourceDownloader;
+import org.apache.ivy.plugins.repository.file.FileRepository;
+import org.apache.ivy.plugins.repository.file.FileResource;
import org.apache.ivy.plugins.repository.url.URLRepository;
import org.apache.ivy.plugins.repository.url.URLResource;
import org.apache.ivy.plugins.resolver.util.MDResolvedResource;
@@ -918,7 +920,14 @@
URL url = artifact.getUrl();
Message.verbose("\tusing url for " + artifact + ": " + url);
logArtifactAttempt(artifact, url.toExternalForm());
- ret = new ResolvedResource(new URLResource(url), artifact.getModuleRevisionId()
+ Resource resource;
+ if ("file".equals(url.getProtocol())) {
+ resource = new FileResource(new FileRepository(), new File(url.getPath()));
+ }
+ else {
+ resource = new URLResource(url);
+ }
+ ret = new ResolvedResource(resource, artifact.getModuleRevisionId()
.getRevision());
}
return ret;
{noformat}
was:
Currently artifacts with a specified url are always considered remote because the code instantiates URLResource.
This change would allow using FileResource when the url is "file://*".
--- BasicResolver.java.original Mon Oct 20 16:47:15 2008
+++ BasicResolver.java Mon Nov 03 15:38:48 2008
@@ -64,6 +64,8 @@
import org.apache.ivy.plugins.repository.ArtifactResourceResolver;
import org.apache.ivy.plugins.repository.Resource;
import org.apache.ivy.plugins.repository.ResourceDownloader;
+import org.apache.ivy.plugins.repository.file.FileRepository;
+import org.apache.ivy.plugins.repository.file.FileResource;
import org.apache.ivy.plugins.repository.url.URLRepository;
import org.apache.ivy.plugins.repository.url.URLResource;
import org.apache.ivy.plugins.resolver.util.MDResolvedResource;
@@ -918,7 +920,14 @@
URL url = artifact.getUrl();
Message.verbose("\tusing url for " + artifact + ": " + url);
logArtifactAttempt(artifact, url.toExternalForm());
- ret = new ResolvedResource(new URLResource(url), artifact.getModuleRevisionId()
+ Resource resource;
+ if ("file".equals(url.getProtocol())) {
+ resource = new FileResource(new FileRepository(), new File(url.getPath()));
+ }
+ else {
+ resource = new URLResource(url);
+ }
+ ret = new ResolvedResource(resource, artifact.getModuleRevisionId()
.getRevision());
}
return ret;
> Support useOrigin for artifacts with a set url attribute
> --------------------------------------------------------
>
> Key: IVY-965
> URL: https://issues.apache.org/jira/browse/IVY-965
> Project: Ivy
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.0-RC1
> Reporter: alex322
>
> Currently artifacts with a specified url are always considered remote because the code instantiates URLResource.
> This change would allow using FileResource when the url is "file://*".
> {noformat}
> --- BasicResolver.java.original Mon Oct 20 16:47:15 2008
> +++ BasicResolver.java Mon Nov 03 15:38:48 2008
> @@ -64,6 +64,8 @@
> import org.apache.ivy.plugins.repository.ArtifactResourceResolver;
> import org.apache.ivy.plugins.repository.Resource;
> import org.apache.ivy.plugins.repository.ResourceDownloader;
> +import org.apache.ivy.plugins.repository.file.FileRepository;
> +import org.apache.ivy.plugins.repository.file.FileResource;
> import org.apache.ivy.plugins.repository.url.URLRepository;
> import org.apache.ivy.plugins.repository.url.URLResource;
> import org.apache.ivy.plugins.resolver.util.MDResolvedResource;
> @@ -918,7 +920,14 @@
> URL url = artifact.getUrl();
> Message.verbose("\tusing url for " + artifact + ": " + url);
> logArtifactAttempt(artifact, url.toExternalForm());
> - ret = new ResolvedResource(new URLResource(url), artifact.getModuleRevisionId()
> + Resource resource;
> + if ("file".equals(url.getProtocol())) {
> + resource = new FileResource(new FileRepository(), new File(url.getPath()));
> + }
> + else {
> + resource = new URLResource(url);
> + }
> + ret = new ResolvedResource(resource, artifact.getModuleRevisionId()
> .getRevision());
> }
> return ret;
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.