You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Ryan Daum (JIRA)" <ji...@apache.org> on 2010/01/14 17:20:54 UTC

[jira] Commented: (CASSANDRA-697) Mitigate unpublished dependencies when using Cassandra with Maven

    [ https://issues.apache.org/jira/browse/CASSANDRA-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800240#action_12800240 ] 

Ryan Daum commented on CASSANDRA-697:
-------------------------------------

This seems like a reasonable approach in the short term but really pushes the burden onto the artifact user.

It would seem more ideal to get thrift, json-simple, clhm (see http://code.google.com/p/concurrentlinkedhashmap/issues/detail?id=3) and high-scale to get their artifacts into a public maven repo and solve this problem once and for all.

I guess the bigger question is whether Cassandra is truly used often as a library linked into an application. If it's not, it's not a huge issue to force the burden onto those few users who choose to use it this way.

I previously contributed patches for both 0.5 and trunk which dealt with the SNAPSHOT issue in a different way. IMHO, 0.5 should not have unless someone with committer privileges is committed to changing it to 0.5 once the release is complete, while trunk should have 0.9-SNAPSHOT as it is not in a release process.

> Mitigate unpublished dependencies when using Cassandra with Maven
> -----------------------------------------------------------------
>
>                 Key: CASSANDRA-697
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-697
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core, Tools
>    Affects Versions: 0.5
>            Reporter: Stephen Gargan
>            Priority: Minor
>             Fix For: 0.5
>
>         Attachments: dependency-patch.txt
>
>
> So I have a suggestion to improve the maven build and help mitigate the fact that cassandra relies on unpublished dependencies. While the system dependency approach works fine for building cassandra alone, it breaks down somewhat if you include cassandra as a dependency in another project. The problem stems from the fac that system dependency paths must be absolute, but in the cassandra pom they are relative to the project root. When cassandra is then used as a dependency elsewhere, all the dependencies from the cassandra pom are ignored
> [WARNING] POM for 'org.apache.cassandra:cassandra:pom:0.5:compile' is invalid. It will be ignored for artifact resolution. Reason: Failed to validate POM for project org.apache.cassandra:c
> [DEBUG] Reason: Failed to validate POM for project org.apache.cassandra:cassandra at Artifact [org.apache.cassandra:cassandra:pom:0.5:compile]
> [DEBUG] 
> Validation Errors:
> [DEBUG] For dependency Dependency {groupId=high-scale-lib, artifactId=high-scale-lib, version=UNKNOWN, type=jar}: system-scoped dependency must specify an absolute path systemPath.
> [DEBUG] For dependency Dependency {groupId=libthrift, artifactId=libthrift, version=UNKNOWN, type=jar}: system-scoped dependency must specify an absolute path systemPath.
> [DEBUG] For dependency Dependency {groupId=reardencommerce, artifactId=reardencommerce, version=UNKNOWN, type=jar}: system-scoped dependency must specify an absolute path systemPath.
> [DEBUG] For dependency Dependency {groupId=jsonsimple, artifactId=jsonsimple, version=UNKNOWN, type=jar}: system-scoped dependency must specify an absolute path systemPath.
> [DEBUG] For dependency Dependency {groupId=com.reardencommerce, artifactId=clhm, version=UNKNOWN, type=jar}: system-scoped dependency must specify an absolute path systemPath.
> There are a couple of ways to fix this. Ideally if the failing deps could get published to a public repo the problem goes away. As a stopgap (for this less than perfect world) it would nice if it were easy to install the respective jars from the ant build to a local or network maven repo, so I've created a pom to do this.
> The pom, in the lib dir, specifies two profiles install and deploy; The 'install' profile  is run via
> mvn validate -Pinstall
> and will install them in the local repo on your machine.
> Just having install is a pain where you have more than one developer as it will require each to get the source and execute the profile, so to make them available for a whole team the 'deploy' profile can be used to deploy them to an enterprise repository such as nexus. This is done via
> mvn -Pdeploy validate -DrepositoryId=thirdparty -DrepositoryUrl=http://mfdevrepo:8081/nexus/content/repositories/thirdparty
> The pom now references the dependencies as normal from the local repo. The version was specified where it was obvious and where not 'cassandra-version' was used to avoid collisions and hint at the origin.
>  <dependency>
>       <groupId>high-scale-lib</groupId>
>       <artifactId>high-scale-lib</artifactId>
>       <version>cassandra-${version}</version>
>     </dependency>
>     <dependency>
>       <groupId>libthrift</groupId>
>       <artifactId>libthrift</artifactId>
>       <version>r894924</version>
>     </dependency>
>     <dependency>
>       <groupId>json-simple</groupId>
>       <artifactId>json-simple</artifactId>
>       <version>1.1</version>
>     </dependency>
>     <dependency>
>       <groupId>com.reardencommerce</groupId>
>       <artifactId>clhm</artifactId>
>       <version>cassandra-${version}</version>
>     </dependency>
> I took the liberty of adding SNAPSHOT to the pom version too as having a non SNAPSHOT version will cause maven to think the pom is released and cast in stone and subsequent updates will not be retrieved and problems related to this can be hard to track down.
> I hope you can get some use from this. Thanks for the great project!
> rgds,
> ste

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.