Hi Andrey,
On Thu, Mar 11, 2010 at 10:57 AM, Andrey Adamovich <
[email protected]> wrote:
> Hi gradle gurus!
>
> I have defined the following repository:
>
> libDir = file('lib').absolutePath
>
> repositories {
> flatDir name: 'localRepository', dirs: [libDir]
> }
>
> repositories.localRepository {
> addArtifactPattern(libDir +
> '/[organization]/[artifact]/jars/[artifact]-[revision].[ext]')
> }
>
> And the following publishing settings:
>
> uploadArchives {
> uploadDescriptor = false
> repositories {
> add project.repositories.localRepository
> }
> }
>
> But when I do gradle uploadArchives, it does not put created jar in the
> nice directory structure defined by the pattern, but just in the root of the
> lib folder i.e.
>
Just use another repository definition instead of the flat dir one.
Something like
repositories {
add(new org.apache.ivy.plugins.resolver.FileSystemResolver()) {
name = 'local'
addArtifactPattern(libDir +
'/[organization]/[artifact]/jars/[artifact]-[revision].[ext]')
}
}
That should work.
>
> /lib/service-1.0.jar
>
> instead of
>
> /lib/com.myorg/service/jars/service-1.0.jar
>
> Is there a default way to make uploadArchives to honor the repository
> pattern?
>
> Thanks in advance!
> Andrey
>
>