Showing posts with label configuration. Show all posts
Showing posts with label configuration. Show all posts

Thursday, December 13, 2012

Maven Source Properties That Don't Work


When I do 'Maven > Update Project Configuration' in Eclipse, this seems not to work: 

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.source>1.6</project.build.source>
        <project.build.target>1.6</project.build.target>
    </properties>
    
But this seems to work: 

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
     ...
    
Too bad, since the first xml is neater. 

---

PS. One sign that there is some mix-up with 1.5/1.6, is that the @Override annotation acts up.

Tuesday, December 4, 2012

Maven Is Back, Stronger Than Ever

Guess what this does, in proper maven resource plugin context:

<configuration>
<outputDirectory>target/classes</outputDirectory>
<excludes>
<exclude>**/*.java</exclude>
<exclude>**/*.class</exclude>
<exclude>**/.svn</exclude>
</excludes>
<resources>
<resource>
<directory>src/test/java</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>

Copies resources out of src/test/java and src/main/java, excluding files matching the specified patterns? 

Wrong. Or, mostly wrong. 

The exclusions will apply to the src/test/java directory paths, but not the src/main/java. Yep, at least in the version we use. 

Caveat utilitor.