pom.xml revision 308
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
9afe19d634946d50eab30e3b90cb5cebcde39eeaDaniel Lezcano The contents of this file are subject to the terms of either the GNU
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler General Public License Version 2 only ("GPL") or the Common Development
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler and Distribution License("CDDL") (collectively, the "License"). You
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler may not use this file except in compliance with the License. You can
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler obtain a copy of the License at
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler or packager/legal/LICENSE.txt. See the License for the specific
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler language governing permissions and limitations under the License.
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler When distributing the software, include this License Header Notice in each
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler file and include the License file at packager/legal/LICENSE.txt.
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler GPL Classpath Exception:
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler Oracle designates this particular file as subject to the "Classpath"
250b1eec71b074acdff1c5f6b5a1f0d7d2c20b77Stéphane Graber exception as provided by Oracle in the GPL Version 2 section of the License
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler file that accompanied this code.
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler Modifications:
4d69b2939ce09fbe624636dc01734a542e050ef9Nikola Kotur If applicable, add the following below the License Header, with the fields
7f95145833bb24f54e037f73ecc37444d6635697Dwight Engen enclosed by brackets [] replaced by your own identifying information:
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler "Portions Copyright [year] [name of copyright owner]"
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler Contributor(s):
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler If you wish your version of this file to be governed by only the CDDL or
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler only the GPL Version 2, indicate your decision by adding "[Contributor]
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler elects to include this software in this distribution under the [CDDL or GPL
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler Version 2] license." If you don't indicate a single choice of license, a
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler recipient has the option to distribute your version of this file under
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler either the CDDL, the GPL Version 2 or to extend the choice of license to
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler its licensees as provided above. However, if you add GPL Version 2 code
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler and therefore, elected the GPL Version 2 license, then the option applies
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler only if the new code is made subject to such option by the copyright
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler<project xmlns="http://maven.apache.org/POM/4.0.0"
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <comments>A business-friendly OSS license</comments>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <url>https://glassfish.dev.java.net/public/CDDL+GPL.html</url>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <comments>GPL version 2 plus the Classpath Exception</comments>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <organization>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler </organization>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <mail.version>1.4.4-SNAPSHOT</mail.version>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <!-- like mail.version, but with underscores instead of dots -->
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <mail.zipversion>1_4_4-SNAPSHOT</mail.zipversion>
e986ea3dfa4a2957f71ae9bfaed406dd6e1ffff6Christian Brauner <mail.spec.version>1.4</mail.spec.version>
e986ea3dfa4a2957f71ae9bfaed406dd6e1ffff6Christian Brauner <activation-api.version>1.1</activation-api.version>
e986ea3dfa4a2957f71ae9bfaed406dd6e1ffff6Christian Brauner <!-- defaults that are overridden in mail module -->
e986ea3dfa4a2957f71ae9bfaed406dd6e1ffff6Christian Brauner javax.mail.*; version=${mail.spec.version}
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler javax.security.sasl;resolution:=optional,
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler sun.security.util;resolution:=optional,
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler jcifs.ntlmssp;resolution:=optional,
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <!-- for the osgiversion-maven-plugin -->
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <hk2.plugin.version>0.4.11</hk2.plugin.version>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <javac.path>/opt/jdk1.4/bin/javac</javac.path>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <project.build.sourceEncoding>iso-8859-1</project.build.sourceEncoding>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler </properties>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler </developers>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler This profile contains modules that should only be built
4d69b2939ce09fbe624636dc01734a542e050ef9Nikola Kotur but not installed or deployed.
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler </activation>
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler Activating this profile manually for deployment causes
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler the above profile to be deactivated, which works around
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler an apparent bug in maven that prevents me from manually
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler deactivating a profile. This profile purposely has none
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler of the modules I don't want to be deployed.
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler A special profile for compiling with the real JDK 1.4
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler compiler, to make sure there are no accidental dependencies
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler on JDK 1.5 APIs. Set the property javac.path to the path
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler to the JDK 1.4 compiler, e.g.,
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler "mvn -P1.4 -Djavac.path=/opt/jdk1.4/bin/javac".
7a0b0b5672a33c190eefb4b2d3e3693241c130f2Christian Seiler <artifactId>maven-compiler-plugin</artifactId>
7a0b0b5672a33c190eefb4b2d3e3693241c130f2Christian Seiler <configuration>
7a0b0b5672a33c190eefb4b2d3e3693241c130f2Christian Seiler <!-- these classes depend on JDK 1.5 APIs -->
7a0b0b5672a33c190eefb4b2d3e3693241c130f2Christian Seiler com/sun/mail/imap/protocol/IMAPSaslAuthenticator.java
7a0b0b5672a33c190eefb4b2d3e3693241c130f2Christian Seiler com/sun/mail/smtp/SMTPSaslAuthenticator.java
7a0b0b5672a33c190eefb4b2d3e3693241c130f2Christian Seiler </configuration>
799f96fdd8fc9c0685fffee5998aab2287ebc25fChristian Seiler </executions>
799f96fdd8fc9c0685fffee5998aab2287ebc25fChristian Seiler <distributionManagement>
799f96fdd8fc9c0685fffee5998aab2287ebc25fChristian Seiler <url>java-net:/maven2-repository/trunk/repository/</url>
799f96fdd8fc9c0685fffee5998aab2287ebc25fChristian Seiler </repository>
799f96fdd8fc9c0685fffee5998aab2287ebc25fChristian Seiler </distributionManagement>
799f96fdd8fc9c0685fffee5998aab2287ebc25fChristian Seiler Make sure we're using the correct version of maven,
799f96fdd8fc9c0685fffee5998aab2287ebc25fChristian Seiler required to allow us to build JavaMail with JDK 1.4
799f96fdd8fc9c0685fffee5998aab2287ebc25fChristian Seiler and build the tests with JDK 1.5. See the
799f96fdd8fc9c0685fffee5998aab2287ebc25fChristian Seiler maven-compiler-plugin configuration below.
799f96fdd8fc9c0685fffee5998aab2287ebc25fChristian Seiler <groupId>org.apache.maven.plugins</groupId>
799f96fdd8fc9c0685fffee5998aab2287ebc25fChristian Seiler <artifactId>maven-enforcer-plugin</artifactId>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <configuration>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <requireMavenVersion>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler </requireMavenVersion>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler </configuration>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler </executions>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler This plugin is reponsible for packaging artifacts
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler as OSGi bundles. Please refer to
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler for more information about how to use this plugin.
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler <artifactId>maven-bundle-plugin</artifactId>
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler <configuration>
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler <instructions>
a600d021adf34e58b3991269a9ceca3737c63aa8KATOH Yasufumi </instructions>
a600d021adf34e58b3991269a9ceca3737c63aa8KATOH Yasufumi </configuration>
a600d021adf34e58b3991269a9ceca3737c63aa8KATOH Yasufumi Since we don't change the packaging type to bundle, we
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler need to configure the plugin to execute the manifest goal
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler during the process-classes phase of the build life cycle.
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler </executions>
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler Since we don't want a qualifier like b05 or SNAPSHOT to
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler appear in the OSGi package version attribute, we use
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler the following plugin to populate a project property
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler with an OSGi version that is equivalent to the maven
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler version without the qualifier.
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler <artifactId>osgiversion-maven-plugin</artifactId>
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler <configuration>
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler <dropVersionComponent>qualifier</dropVersionComponent>
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler <versionPropertyName>mail.osgiversion</versionPropertyName>
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler </configuration>
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler </executions>
7a0b0b5672a33c190eefb4b2d3e3693241c130f2Christian Seiler Use the 1.4 compiler for JavaMail itself, but use the
7a0b0b5672a33c190eefb4b2d3e3693241c130f2Christian Seiler 1.5 compiler for the test classes, so we can use JUnit 4.
7a0b0b5672a33c190eefb4b2d3e3693241c130f2Christian Seiler <artifactId>maven-compiler-plugin</artifactId>
7a0b0b5672a33c190eefb4b2d3e3693241c130f2Christian Seiler <configuration>
e986ea3dfa4a2957f71ae9bfaed406dd6e1ffff6Christian Brauner </configuration>
e986ea3dfa4a2957f71ae9bfaed406dd6e1ffff6Christian Brauner <configuration>
e986ea3dfa4a2957f71ae9bfaed406dd6e1ffff6Christian Brauner </configuration>
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler </executions>
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler <!-- need at least this version to make excludes work -->
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler <configuration>
e13eeea2db3743bf8d3fe2833e069a80e2c4102cChristian Seiler <finalName>${project.artifactId}</finalName>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler Configure the maven-jar-plugin to pick up
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler META-INF/MANIFEST.MF that's generated by
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler the maven-bundle-plugin.
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <manifestFile>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler ${project.build.outputDirectory}/META-INF/MANIFEST.MF
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler </manifestFile>
49ee6cdcbf79d8b6fa617479ec8ab753ccca923dChristian Seiler <manifestEntries>