The Framework Renaissance of 2011-2012

Three years into the Oracle era, and I have to admit - the Java ecosystem has exploded with innovation. The fears about corporate control stifling open source development have proven largely unfounded.

Spring's Dominance Solidifies

Spring Framework 3.1 introduced profiles and environment abstraction, which revolutionized how we handled different deployment environments:

@Configuration

@Profile("development")

public class DevConfig {

   

    @Bean

    public DataSource dataSource() {

        DriverManagerDataSource dataSource = new DriverManagerDataSource();

        dataSource.setDriverClassName("org.h2.Driver");

        dataSource.setUrl("jdbc:h2:mem:testdb");

        return dataSource;

    }

}

 

@Configuration

@Profile("production")

public class ProdConfig {

   

    @Bean

    public DataSource dataSource() {

        HikariDataSource dataSource = new HikariDataSource();

        dataSource.setJdbcUrl("jdbc:postgresql://prod-db:5432/myapp");

        dataSource.setUsername("${db.username}");

        dataSource.setPassword("${db.password}");

        return dataSource;

    }

}

The Maven Revolution

By 2012, Maven had become the de facto standard for Java projects. The ecosystem of plugins and repositories was maturing rapidly:

<project>

    <build>

        <plugins>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-compiler-plugin</artifactId>

                <version>2.5.1</version>

                <configuration>

                    <source>1.7</source>

                    <target>1.7</target>

                </configuration>

            </plugin>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-surefire-plugin</artifactId>

                <version>2.12</version>

                <configuration>

                    <includes>

                        <include>**/*Test.java</include>

                        <include>**/*Tests.java</include>

                    </includes>

                </configuration>

            </plugin>

        </plugins>

    </build>

</project>

 

Comments