Asked  6 Months ago    Answers:  5   Viewed   44 times

I am a bit confused about the meaning of a Maven Snapshot and why we build one?

 Answers

57

A snapshot version in Maven is one that has not been released.

The idea is that before a 1.0 release (or any other release) is done, there exists a 1.0-SNAPSHOT. That version is what might become 1.0. It's basically "1.0 under development". This might be close to a real 1.0 release, or pretty far (right after the 0.9 release, for example).

The difference between a "real" version and a snapshot version is that snapshots might get updates. That means that downloading 1.0-SNAPSHOT today might give a different file than downloading it yesterday or tomorrow.

Usually, snapshot dependencies should only exist during development and no released version (i.e. no non-snapshot) should have a dependency on a snapshot version.

Tuesday, June 1, 2021
 
nomie
answered 6 Months ago
100

Use Android packaging, e.g. <packaging>apk</packaging>.

If Maven couldn't download the artifact, it would complain much sooner in the build lifecycle. The problem is that artifact is downloaded, but not used. aar is not a standard Maven artifact, so Maven doesn't know what to do with it. Using it requires a third party plugin with extensions, hence usage of android-maven-plugin. Reading its documentation, it has some requirements to work properly. Specifically you didn't use android packaging as mentioned here:

usage of a supported packaging: apk, aar or apklib

Indeed, looking at the plugin source code it checks for android packaging before adding anything from aar to classpath.

Tuesday, August 3, 2021
 
Scott Kausler
answered 4 Months ago
78

Using R2 is only necessary for building Android Library projects.

https://github.com/JakeWharton/butterknife#library-projects

It has to do with fact that the values in the R.java generated class aren't declared as "final" when built as part of a library. The annotations used for @BindView() need these R. values to be final and not subject to change later on.

I'm sure someone could explain all of this better -- but the bottom line is - you're just fine using "R." values in @BindView in an Android application

Monday, August 16, 2021
 
Jeffrey Stilwell
answered 4 Months ago
17

Run mvn dependency:analyze. It should do the work.

Saturday, October 2, 2021
 
anjan
answered 2 Months ago
44

Your answer was pretty close. I would define object publication as the act by one thread of making a reference to an object visible to another thread. Usually, this is connected with object creation: you need to ensure that a newly-created object is published in such a way that the other thread will see it in an initialised state.

The classic text on this (and many other thread-related matters) is Java Concurrency in Practice. If you don't have a copy of that, and can't be bothered to google up a pirated PDF, not that i would suggest you do that, and indeed even if you do or can, you should heed the mighty CERT Oracle Secure Coding Standard for Java's advice that you Do not publish partially initialized objects.

Friday, October 29, 2021
 
Magn3s1um
answered 1 Month ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :  
Share