Thanks again!
I have made some more research on deploy plugin and managed to get needed
information. Below is source code that constructs URL. It is not perfect but
it does the work:
final RepositoryMetadata metadata = new
SnapshotArtifactRepositoryMetadata(artifact);
repositoryMetadataManager.resolveAlways(metadata, localRepository,
deploymentRepository);
final Snapshot snapshot =
metadata.getMetadata().getVersioning().getSnapshot();
final String pathOf = deploymentRepository.getUrl() + "/" +
deploymentRepository.pathOf(artifact).replace("-SNAPSHOT-", "-" +
snapshot.getTimestamp() + "-" + snapshot.getBuildNumber() + "-");
BRIAN FOX-5 wrote:
>
> The only way to do this reliably would be to go get the metadata from
> the repository and use that...it's inside the deploy plugin that this
> transformation occurs and it happens based on the metadata that it
> just retrieved.
>
> Alternatively you could do this with a repo manager. Nexus provides
> rss feeds and it would be trivial to make a plugin to send an email
> for new snapshot deployments.
>
> On Thu, Oct 22, 2009 at 11:56 AM, Michal Mally <[email protected]> wrote:
>>
>> Hello,
>>
>> Basically what I need to do is simple mail notification after new
>> snapshot
>> is deployed. I plan to attach to deploy phase with plugin that is able to
>> send an email and this is no problem. The problem arises when I want to
>> get
>> an url for just deployed snapshot to include it in email.
>>
>> eg. When artifact com.example.X is deployed to maven repository under
>> address http://snapshots.example.com/ I would like to get an url from
>> which
>> this atrifact can be downloaded. So something like
>> http://snapshots.example.com/com/example/X/1.0-SNAPSHOT/X-1.0-<timestamp>-<buildNumber>.jar
>>
>> I have spent some hours trying to do that - experimenting with Maven API
>> with no success yet. As one of my desperate approach I even tried getting
>> Metadata for 1.0-SNAPSHOT and then build an URL manually. Unfortunately I
>> was never able to resolve it the way the Snapshot.buildNumber and
>> Snapshot.timestamp are filled with correct values.
>>
>> Could anyone help me with that task. At least which component should be
>> used and what is the correct order of execution.
>>
>> Thanks in advance.
>>
>> Best regards,
>> Michal Mally
>> --
>> View this message in context:
>> http://www.nabble.com/Download-path-for-just-deployed-snapshot-tp26012587p26012587.html
>> Sent from the Maven Developers mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://www.nabble.com/Download-path-for-just-deployed-snapshot-tp26012587p26023746.html
Sent from the Maven Developers mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]