[go: up one dir, main page]

File: maven.xml

package info (click to toggle)
libcommons-logging-java 1.1.1-9
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,300 kB
  • sloc: java: 5,405; xml: 3,887; makefile: 22
file content (103 lines) | stat: -rw-r--r-- 4,173 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!--

 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at
 
      http://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

-->

<project default="jar:jar" xmlns:j="jelly:core">

  <!-- ==================================================================
    -   COMMONS-BUILD TWEAKS
    -
    -  Ensure commons-build stylesheets are copied into target directory
    -  when executing the xdoc goal (part of the site goal), so that the
    -  resulting website has the correct look-and-feel.
    -
    -  This goal assumes that commons-build is checked out as a sibling
    -  to the directory we are doing the build in. 
    -
    -  Copy the release notes into the target directory, so that they
    -  are available on the website.
    ================================================================== -->

  <postGoal name="xdoc:copy-resources">  
    <copy todir="${basedir}/target/docs/" failonerror="false">
      <fileset dir="${basedir}">
        <include name='RELEASE-NOTES.txt'/>
      </fileset>
    </copy>
  </postGoal>

  <!-- ==================================================================
    -  JAR tweaks
    -
    - Unit test tweaks
    ================================================================== -->

  <preGoal name="test:test">
    <echo level="warning">
      Unit testing cannot be done in Maven; the tests require classpaths and
      system properties to be set differently for different unit tests which
      Maven does not support. Please run "ant test" to execute the unit tests.
    </echo>
  </preGoal>
  
  <!-- ==================================================================
    -  JAR tweaks
    -
    - Maven is designed to create only one jar file ("artifact") for each
    - project.xml file. However we want to create a couple of additional
    - jars that contain subsets of the main "commons-digester.jar" file.
    - So here we arrange for those jars to be created.
    -
    - We unpack the main jar into a temp dir, then create a new jar file
    - including or excluding the relevant files. This is simpler than
    - trying to recreate an appropriate MANIFEST.MF file.
    ================================================================== -->

  <postGoal name="jar:jar">
  
    <j:set var="logging.api.work.dir">${maven.build.dir}/logging-api-work</j:set>

    <delete dir="${logging.api.work.dir}"/>
    <mkdir dir="${logging.api.work.dir}"/>
    <unzip 
      src="${maven.build.dir}/${maven.final.name}.jar" 
      dest="${logging.api.work.dir}"/>
    
    <delete file="${maven.build.dir}/${maven.final.name}-api.jar"/>
    <zip destfile="${maven.build.dir}/${maven.final.name}-api.jar"
      index="${maven.jar.index}"
      compress="${maven.jar.compress}">
      <fileset dir="${logging.api.work.dir}">
        <exclude name="**/AvalonLogger.class"/>
        <exclude name="**/Jdk13LumberjackLogger.class"/>
        <exclude name="**/Log4jFactory.class"/>
        <exclude name="**/Log4JLogger.class"/>
        <exclude name="**/LogKitLogger.class"/>
      </fileset>
    </zip>
      
    <delete file="${maven.build.dir}/${maven.final.name}-adapters.jar"/>
    <zip destfile="${maven.build.dir}/${maven.final.name}-adapters.jar"
      index="${maven.jar.index}"
      compress="${maven.jar.compress}">
      <fileset dir="${logging.api.work.dir}">
        <include name="**/impl/**.class"/>
      </fileset>
    </zip>
  </postGoal>  
</project>