On Wed, Mar 10, 2010 at 5:07 PM, Andreas Netter <[email protected]> wrote:
> > Hi Ross, > > it seems that the additional "_" is not only a problem in multi project > builds. > We have a similiar behaviour in a normal project build. > > The gradle version we use: gradle-0.9-20100121145940+1100 > > During publish to our Ivy Repository, the [module] part of our ivy pattern > is replaced by "_". > > The module name is the project name as Adam Murdoch posted in another > thread. > The project name is a read-only property. It is the name of the directory > containing the build script. > To my understanding, there is no (miss-)configuration of module name / > project name possible, as it is set per convention. > > We've checked the project name during build. It is set correct. It seems > that it gets lost when publishing to Ivy. > First of all. The reason why we use the underscore as a replacement for the colon is that windows does not accept colons as part of file names. The single _ when publishing a root project is owed to the fact that we use project.path to determine the name for the ivy module. In the case of the root project this is :. This is obviously a bug. For subprojects the path is always : + project name. Therefore the _one Let's say we have the following project structure (in brackets possible strategies for module name) superapp (superapp) - superapp (superapp_superapp, superapp) - api (superapp_api, api) - services (superapp_services, services) -- web1 (superapp_services_web1, services_web1, web1) I tend to prefer just the project name as the default. You always have the group as an additional distinguisher. And you can change the project name in the settings.gradle if you don't want to use the directory name. What do you think? Eventually this needs to be fully customizable which we will tackle after 0.9. - Hans -- Hans Dockter Founder, Gradle http://www.gradle.org, http://twitter.com/gradleorg CEO, Gradle Inc. - Gradle Training, Support, Consulting http://www.gradle.biz > > Regards, > Andi > > > Ross Black-2 wrote: > > > > Hi, > > > > I have been migrating a project from 0.8 to 0.9 (using > > gradle-0.9-20100308090020+0300) and have struck a problem with the > > publication of artifacts to an ivy repository when using a multi-project > > layout. > > > > Artifacts are published to a directory that uses the path name of the > > sub-project. For example, with a subproject "one" artifacts are > published > > to a directory "_one". > > > > eg. > > > > When running gradle -i one:uploadArchives with the gradle build file > > below, > > artifacts are published with the following layout: > > > > Publishing to Resolver localPublications > > published one to /home/ross/devel/publications/_one/2.0/one.jar > > published ivy to /home/ross/devel/publications/_one/2.0/ivy.xml > > > > The published ivy.xml file has module="one" revision="2.0", which is what > > I > > would expect. > > > > Am i missing something in the configuration? > > Is there some way to specify the directory / module name? > > > > Thanks, > > Ross > > > > > > build.gradle > > ========= > > > > import org.gradle.api.artifacts.Configuration > > import org.gradle.api.artifacts.ProjectDependency > > import org.gradle.api.Project > > > > String ivyPattern = '/[module]/[revision]/ivy.xml' > > String artifactPattern = '/[module]/[revision]/[artifact](.[ext])' > > File localPublicationsDir = file('../publications') > > > > dependsOnChildren() > > > > subprojects { > > apply id:'java' > > group = 'example' > > version = '2.0' > > repositories { > > add(new org.apache.ivy.plugins.resolver.FileSystemResolver()) { > > name = 'localPublications' > > validate = false > > addIvyPattern(localPublicationsDir.absolutePath + ivyPattern) > > addArtifactPattern(localPublicationsDir.absolutePath + > > artifactPattern) > > } > > } > > uploadArchives { > > uploadDescriptor = true > > repositories { > > add project.repositories.localPublications > > } > > } > > } > > ===== > > > > > > -- > View this message in context: > http://old.nabble.com/basic-ivy-publication-question-tp27831360p27851895.html > Sent from the gradle-user mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > >
