Thanks for the ideas--I'll have to look into scripting for the future in
order to be robust enough to always have the right entries in
spring.handlers and spring.schemas.  The shade plugin actually wasn't being
invoked as I thought it was because I wasn't calling the package target. 
When I did, there was another issue with a manifest entry being missing,
leading me down another googling path.  

Here, though, is what I finally did.  I created a custom assembly and
referenced it from my module's POM.  I disabled unpacking of spring.* and
included my pre-made versions of the same.  It gets me by for now.

Here is the source of the assembly, called assembly.xml in the same folder
as the pom:

<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd";>
    <id>jar-with-dependencies-exclude-spring-handlers</id>
    <formats>
        <format>jar</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <dependencySets>
        <dependencySet>
            <outputDirectory>/</outputDirectory>
            <useProjectArtifact>true</useProjectArtifact>
            <unpack>true</unpack>
            <scope>runtime</scope>
            <unpackOptions>
                <excludes>
                    <exclude>META-INF/spring.handlers</exclude>
                    <exclude>META-INF/spring.schemas</exclude>
                </excludes>
            </unpackOptions>
        </dependencySet>
    </dependencySets>
    <files>
        <file>
            <source>src/main/resources/META-INF/spring.handlers</source>
            <outputDirectory>META-INF</outputDirectory>
        </file>
        <file>
            <source>src/main/resources/META-INF/spring.schemas</source>
            <outputDirectory>META-INF</outputDirectory>
        </file>
    </files>
</assembly>

>From my POM, here is how I invoke it:

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>${maven.assembly.plugin.version}</version>
                <configuration>
                    <descriptors>
                        <descriptor>assembly.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>
        </plugins>
    </build>

The maven assembly plugin version is defined in the parent project.  

--
View this message in context: 
http://maven.40175.n5.nabble.com/spring-handlers-tp5048978p5052522.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to