File: README.maven

package info (click to toggle)
lucene-solr 3.6.2%2Bdfsg-27
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 91,144 kB
  • sloc: java: 465,555; xml: 24,939; javascript: 5,291; ruby: 3,453; jsp: 2,637; python: 1,619; sh: 1,556; perl: 1,407; cpp: 305; makefile: 41
file content (159 lines) | stat: -rw-r--r-- 5,789 bytes parent folder | download | duplicates (7)
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
====================================
Lucene/Solr Maven build instructions
====================================

Contents:

A. How to use nightly Jenkins-built Lucene/Solr Maven artifacts
B. How to generate Maven artifacts
C. How to deploy Maven artifacts to a repository
D. How to use Maven to build Lucene/Solr

-----

A. How to use nightly Jenkins-built Lucene/Solr Maven artifacts

   The most recently produced nightly Jenkins-built Lucene and Solr Maven
   snapshot artifacts are available in the Apache Snapshot repository here:
   
      http://repository.apache.org/snapshots
      
   An example POM snippet:
   
     <project ...>
       ...
       <repositories>
         ...
         <repository>
           <id>apache.snapshots</id>
           <name>Apache Snapshot Repository</name>
           <url>http://repository.apache.org/snapshots</url>
           <releases>
             <enabled>false</enabled>
           </releases>
         </repository>


B. How to generate Lucene/Solr Maven artifacts

   Prerequisites: JDK 1.5+ and Ant 1.7.X

   Run 'ant generate-maven-artifacts' to create an internal Maven
   repository, including POMs, binary .jars, source .jars, and javadoc
   .jars.

   You can run the above command in three possible places: the top-level
   directory; under lucene/; or under solr/.  From the top-level directory
   or from lucene/, the internal repository will be located at dist/maven/.
   From solr/, the internal repository will be located at package/maven/.


C. How to deploy Maven artifacts to a repository

   Prerequisites: JDK 1.5+ and Ant 1.7.X

   You can deploy targets for all of Lucene/Solr, only Lucene, or only
   Solr, as in B. above.  To deploy to a Maven repository, the command is
   the same as in B. above, with the addition of two system properties:

      ant -Dm2.repository.id=my-repo-id \
          -Dm2.repository.url=http://example.org/my/repo \
          generate-maven-artifacts

   The repository ID given in the above command corresponds to a <server>
   entry in either your ~/.m2/settings.xml or ~/.ant/settings.xml.  See
   <http://maven.apache.org/settings.html#Servers> for more information.
   (Note that as of version 2.1.3, Maven Ant Tasks cannot handle encrypted
   passwords.)


D. How to use Maven to build Lucene/Solr

   In summary, to enable Maven builds, perform the following:

         svn update
         ant get-maven-poms
         mvn -N -Pbootstrap install [ -Divy.default.ivy.user.dir=... ]

         If your ivy user directory is not in the default location, you can
         specify it via -Divy.default.ivy.user.dir=... -- otherwise you don't
         need to give this property setting.

   The details, followed by some example Maven commands:

   1. Prerequisites: JDK 1.5+; Maven 2.2.1 or 3.0.X

   2. Make sure your sources are up to date.  If you checked your sources out
      from the Apache Subversion repository, run "svn update" from the top
      level.

   3. Copy the Maven POM templates from under dev-tools/maven/ to where they
      they need to go in order to drive the Maven build, using the following
      command from the top-level directory:

         ant get-maven-poms

      Note that you will need to do this whenever changes to the POM
      templates are committed.  It's a good idea to follow every "svn update"
      with "ant get-maven-poms" for this reason.

      The above command copies all of the POM templates from dev-tools/maven/,
      filling in the project version with the default "X.X-SNAPSHOT".  If you
      want the POMs and the Maven-built artifacts to have a version other than
      the default, you can supply an alternate version on the command line
      with the above command, e.g.:

         ant -Dversion=4.0-my-special-version get-maven-poms

      Note: if you change the version in the POMs, there is one test method
      that will fail under maven-surefire-plugin:
      o.a.l.index.TestCheckIndex#testLuceneConstantVersion().  It's safe to
      @Ignore this test method, since it's just comparing the value of the
      lucene.version system property (set in the maven-surefire-plugin
      configuration in the lucene-core POM) against a hard-wired official
      version (o.a.l.util.Constants.LUCENE_MAIN_VERSION).

   4. Populate your local repository with .jars & POMs for dependencies that
      are not available from public Maven repositories (a.k.a. "non-mavenized
      dependencies"):

         mvn -N -Pbootstrap install [ -Divy.default.ivy.user.dir=... ]

         If your ivy user directory is not in the default location, you can
         specify it via -Divy.default.ivy.user.dir=... -- otherwise you don't
         need to give this property setting.

      Note that you will need to do this whenever changes to the non-Mavenized
      dependencies are committed.  It's a good idea to follow every
      "svn update" with "ant get-maven-poms" and "mvn -N -Pbootstrap install"
      for this reason.


   Some example Maven commands you can use after you perform the above
   preparatory steps:

   - Compile, package, and install all binary artifacts to your local
     repository:

         mvn install

     After compiling and packaging, but before installing each module's 
     artifact, the above command will also run all the module's tests.

   - Compile, package, and install all binary artifacts to your local
     repository, without running any tests:

         mvn -DskipTests install

   - Compile, package, and install all binary and source artifacts to your
     local repository, without running any tests:

         mvn -DskipTests source:jar-no-fork install

   - Run all tests:

         mvn test

   - Run all test methods defined in a test class:

         mvn -Dtest=TestClassName test