Am 24.01.2012 10:58, schrieb Cem Koc:
> For those who wants another use case for custom unique version is:
>
> At our legacy application based on JPA has persistence.xml. Our domain jars
> were divided into the two module and they are included at our
> persistence.xml at like this:
>
>     <persistence-unit name="SearchV2PU">
>         <jta-data-source>SearchV2DS</jta-data-source>
>         <jar-file>domain-A-${A-version}.jar</jar-file>
>         <jar-file>domain-B-${B-version}.jar</jar-file>
>     </persistence-unit>
>
> Our persistence.xml file is filtered at build time by maven. However because
> of the unique version of each SNAPSHOT, it can not be filtered correctly. 
>
> Our persistence provider Eclipse can not locate domain-A-***.jar since the
> name of it changing daily.
>
> Please do not suggest me to use release version of domain A dependency. This
> domain dependency is changing very rapidly and its daily usage is very
> critical.
>
> I strongly need "custom unique version" of the snapshot and filter my
> persistense.xml. 
>
> Still looking for a solution.

You could roughly follow these steps:

- make your persistence.xml a non-filtered resource, put in fixed JAR
file names.
- define the JAR files in your POM as SNAPSHOT dependency and configure
your settings.xml accordingly, so that they get updated in the interval
you want (or use -U on the mvn command line to force updates)
- use maven-dependency-plugin to download domain-A.jar and domain-B.jar.
Tell this plugin to strip version numbers (you'll then get the JAR file
names with versions stripped out).
- make sure the dependency plugin copies them into the directory where
your application would expect them

Snapshots are meant to change. Leave the details how snapshots are
managed to maven. Just tell it to use the snapshot. Don't mess with
internal "unique versions".

Best regards

Ansgar

>  
>
> Thanks
>  
>
> --
> View this message in context: 
> http://maven.40175.n5.nabble.com/custom-unique-version-tp5159884p5281260.html
> Sent from the Maven - Users 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]

Reply via email to