I would like to know why some of the libraries are not released during a normal release cycle. For example, from http://repo2.maven.org/maven2/org/springframework/
while spring-core have 3.0.3-RELEASE, spring-remoting and spring-jmx were released only in 2.0.8. Can someone tell me what this would mean? I agree that if there are no changes in the component say spring-jmx then they don't have to release it, but since 90% of the world uses Maven for dependency management can they not just re-release the same libs (of spring-remoting and spring-jmx?)
I ask this because I declare my deps like,
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-remoting</artifactId>
<version>${spring.version}</version>
</dependency>
and I would prefer supplying one spring.version instead of keeping version numbers upto date for all components?
The four libraries of interest to me are spring-dao, spring-support, spring-jmx, spring-remoting
spring-remoting and spring-jmx became a part of spring-context, so newer versions are released with spring-context.
Related
The framework I am developing on has to support 2 versions of the same library. Those versions contain breaking changes, but we don't need those parts! What we would like now is to guarantee that those methods are never called on accident.
e.g.
guava 18.0 HostAndPort.from("127.0.0.1").getHostText()
guava 23.0 HostAndPort.from("127.0.0.1").getHost()
Is there any way to ensure that such breaking methods are never called for future commits without manually checking each commit?
What we have done so far is, that we provide the library in version 23.0 with some sub-module (foo.a) and added the 18.0 version as provided in the "higher level" module (b).
module foo.a
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>23.0</version>
</dependency>
module b
<dependency>
<groupId>foo</groupId>
<artifactId>a</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
<scope>provided</scope>
</dependency>
This way integration tests should identify any clashes, if we manage to have 100% line coverage. BUT unittests would not, see "provided" quote maven:
This scope is only available on the compilation and test classpath, and is not transitive.
meaning unit tests would still use version 18.0
I saw many tutorial some people use maven dependency such way
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
and some people use maven dependency such way
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.3.RELEASE</version>
</dependency>
What is the main difference between <version>${spring.version}</version> and <version>4.3.3.RELEASE</version> in maven?
The notation of ${spring.version} is a POM variable. This means that somewhere in POM (or in one of parent POMs), you'll see a definition similar to this:
<spring.version>4.3.3.RELEASE</spring.version>
They both achieve the same end result, but using variables is a bit easier to maintain, especially if you use several artifacts sharing the same version. This way, when you choose to upgrade them, you only need to change the version in one place instead of once per artifact.
I have an executable JAR (not a web app being deployed to a standard container like Tomcat, etc.) that needs to connect to a DB and cache a lot of stuff.
If at all possible, I'd like to use the JCache API and inject (via Guice) the Hazelcast implementation. I will code 100% against the JCache API, so that if I ever change my mind and choose another implementation, the swap out should be (relatively) painless.
One problem: where can I get the latest stable JCache JAR?!? (What are the Maven coordinates?)
On Maven Central, all I can find are some dev JARs from 2005! So I ask: where is the JCache?
The jar are available here : javax.cache/cache-api
If you want to use Ehcache implementations, copy/past the dependencies below:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.1.1</version>
<scope>runtime</scope>
</dependency>
Find a complete example here.
When I create a Spring project in IntelliJ IDEA, it suggests I use Spring 4.1.6. I want to use 4.2.1 (which I can do after creating the project).
Where can I make the change?
Thanks,
Andy
I don't know if you can change that yourself without an upgrade but you can allow it to create it with that version then manually change it your pom.xml file.
For example,
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
You can also provide a property that an be used on all your Spring dependencies and then you only have to change it one place.
For example,
<properties>
<org.springframework.version>4.2.0.RELEASE</org.springframework.version>
...
</properties>
Then use it like...
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
I am starting out with Spring and I am reading Pro Spring 2.5. On page 17 they talk about Spring dependencies and I wonder if I need to add this myself in the POM, or does the dependency I have added below do this? Such as CGLib, dom4j etc?
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
You shouldn't need to. Maven will read the pom for spring-context and get any necessary dependencies that it has too, so you won't need to specifically put them in your own pom.
Check out this link it's really handy.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
This will just instruct maven that the current POM in which this is declared is dependent on this artfact, so when you compile the app it would make it available for you in classpath