You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tim Cederman <tc...@trovix.com> on 2007/03/21 20:45:14 UTC

Snapshots being packaged with datestamps instead of "SNAPSHOT".

Hi,

I'm having a pretty weird problem with Maven at the moment.  When I run
mvn package on a project, it collects all the correct and most recent
jar files for me in the lib directory, however in the zip file instead
of naming them <project>-3.0-SNAPSHOT.jar (for example) it will name
them <project>-20070318.080720-37.jar.  

Meanwhile in the project's own jar file, the manifest will point to
./lib/<project>-3.0-SNAPSHOT.jar.  This means the packaged project does
not run.

It doesn't do this for every single dependency snapshot, and I can't
seem to work out a pattern as to which get named correctly and which
don't.

I have two repositories in my pom file:

<repositories>
	<repository>
		<id>common-repository</id>
		<name> Common Repository</name>
		<url>http://repository/common-repository</url>
	</repository>
	<repository>
		<id>snapshot-repository</id>
		<name>Trovix Snapshot Repository</name>
		<url>http://repository/snapshots</url>
		<snapshots>
			<enabled>true</enabled>
			<updatePolicy>always</updatePolicy>
		</snapshots>
	</repository>
</repositories>

If I try to disable them manually (and use only the local repository),
the problem persists.  However, this is where it gets weird.  If I
unplug my network cable - my package file is created perfectly!

However - if I unplug my network cable with the snapshot repository
removed, it creates the package incorrectly once again!

This seems to be the key part of what is making it work (blacklisting
the snapshot-repository):

[INFO]    task-segment: [package]
[INFO]
---------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] snapshot com:com.benchmark:3.0-SNAPSHOT: checking for updates
from snapshot-repository
[WARNING] repository metadata for: 'snapshot
com:com.benchmark:3.0-SNAPSHOT' could not be retrieved from repository:
 snapshot-repository due to an error: Error transferring file
[INFO] Repository 'snapshot-repository' will be blacklisted
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]

I have also run mvn -X package, and the debug log shows that it thinks
it is collecting all the correct SNAPSHOT named jars, even though it
then stores the date-stamped ones.

Can anyone help with this please?  Also I should ask - has anyone
figured out how to stop Maven from using GMT as its default time zone?

Thanks very much!

Cheers,
Tim

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Snapshots being packaged with datestamps instead of "SNAPSHOT".

Posted by kalebral <ka...@gmail.com>.
Using uniqueVersion=false only makes matters worse for us. When we do, the
jar files which we are dependent upon are not downloaded to the local cache
as they should be when a dependent jar file has been updated. These are some
very serious bugs that are really hindering us. Has anyone found a work
around?

-Lee


Joern Huxhorn wrote:
> 
> Jörg Schaible wrote:
>> Hi Tim,
>>
>> Tim Cederman wrote on Wednesday, March 21, 2007 8:45 PM:
>>
>>   
>>> Hi,
>>>
>>> I'm having a pretty weird problem with Maven at the moment.
>>> When I run
>>> mvn package on a project, it collects all the correct and most recent
>>> jar files for me in the lib directory, however in the zip file instead
>>> of naming them <project>-3.0-SNAPSHOT.jar (for example) it will name
>>> them <project>-20070318.080720-37.jar.
>>>
>>> Meanwhile in the project's own jar file, the manifest will point to
>>> ./lib/<project>-3.0-SNAPSHOT.jar.  This means the packaged
>>> project does
>>> not run.
>>>
>>> It doesn't do this for every single dependency snapshot, and I can't
>>> seem to work out a pattern as to which get named correctly and which
>>> don't. 
>>>
>>> I have two repositories in my pom file:
>>>
>>> <repositories>
>>> 	<repository>
>>> 		<id>common-repository</id>
>>> 		<name> Common Repository</name>
>>> 		<url>http://repository/common-repository</url>
>>> 	</repository>
>>> 	<repository>
>>> 		<id>snapshot-repository</id>
>>> 		<name>Trovix Snapshot Repository</name>
>>> 		<url>http://repository/snapshots</url>
>>> 		<snapshots>
>>> 			<enabled>true</enabled>
>>> 			<updatePolicy>always</updatePolicy>
>>> 		</snapshots>
>>> 	</repository>
>>> </repositories>
>>>     
>>
>> [snip]
>>
>> Have a look at the "uniqueVersion" entry, it's true by default:
>> http://maven.apache.org/pom.html#Repository
>>
>> - Jörg
>>
>>   
> It's true that
>     <distributionManagement>
>         <repository>
>             <uniqueVersion>false</uniqueVersion>
>             [..]
>             </repository>
>     </distributionManagement>
> is a workaround for the described problem. That's how we configured our 
> local snapshot repos because of this problem. But I think that the 
> uniqueVersion-feature is quite nice. This should/must be fixed in the 
> maven-jar-plugin so that
>     <build>
>         <plugins>
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-jar-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifest>
>                             <mainClass>[..]</mainClass>
>                             <packageName>[..]</packageName>
>                             <addClasspath>true</addClasspath>
>                         </manifest>
>                         [..]
>                     </archive>
>                 </configuration>
>             </plugin>
>         </plugins>
>     </build>
> the class-path of the manifest does also reference the timestamped 
> snapshots. Beside this problem timestamped snapshots are really usefull!
> 
> Jörn
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Snapshots-being-packaged-with-datestamps-instead-of-%22SNAPSHOT%22.-tf3443210s177.html#a9642558
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org