@@ -149,29 +149,35 @@ <h3 class="subtema" id="gradle">Usage from a Gradle project</h3>
149
149
</ p >
150
150
< h3 class ="subtema " id ="maven "> Usage from a Maven build</ h3 >
151
151
< p >
152
- If you build your project (that depends on css4j) with Apache Maven, please note that some of the css4j dependencies are not in
153
- Maven Central:
152
+ If you build your project (that depends on css4j) with Apache Maven, please note that neither css4j nor some of its
153
+ dependencies are in Maven Central:
154
154
</ p >
155
155
< ul >
156
156
< li > < a href ="https://sourceforge.net/projects/jclf/ "> JCLF</ a > .</ li >
157
157
< li > < a href ="https://github.com/xmlpull-xpp3/xmlpull-xpp3 "> XMLPull-XPP3</ a > (v1.2, dependency of the DOM4J module only).</ li >
158
158
</ ul >
159
159
< p >
160
- You may want to install them manually into your local Maven repository, which can be done easily with the:
160
+ So you may want to add css4j's Maven repository to your POM file:
161
+ </ p >
162
+ < pre class ="code "> < code class ="language-xml "> <repositories>
163
+ <repository>
164
+ <id>css4j</id>
165
+ <name>CSS4J repository</name>
166
+ <url>https://css4j.github.io/maven/</url>
167
+ </repository>
168
+ </repositories>
169
+ </ code > </ pre >
170
+ < p >
171
+ Alternatively, you can also install the artifacts manually into your local Maven repository,
172
+ which can be done easily with the:
161
173
</ p >
162
174
< ul >
175
+ < li > < a href ="https://raw.githubusercontent.com/css4j/css4j-dist/master/maven/install-css4j.sh "> < code > install-css4j.sh</ code > </ a > </ li >
163
176
< li > < a href ="https://raw.githubusercontent.com/css4j/css4j-dist/master/maven/install-jclf.sh "> < code > install-jclf.sh</ code > </ a > </ li >
164
177
< li > < a href ="https://raw.githubusercontent.com/css4j/css4j-dist/master/maven/install-xpp3.sh "> < code > install-xpp3.sh</ code > </ a > </ li >
165
178
</ ul >
166
179
< p >
167
- scripts.
168
- </ p >
169
- < p >
170
- You can also directly install the CSS4J artifacts into your local Maven repository, with the similar
171
- < a href ="https://raw.githubusercontent.com/css4j/css4j-dist/master/maven/install-css4j.sh "> < code > install-css4j.sh</ code > </ a > .
172
- </ p >
173
- < p >
174
- And then, add the following to the < code > <dependencies></ code > section of your < code > pom.xml</ code > :
180
+ scripts. And then, add the following to the < code > <dependencies></ code > section of your < code > pom.xml</ code > :
175
181
</ p >
176
182
< pre class ="code "> < code class ="language-xml "> <!-- This artifact is not in Maven Central -->
177
183
<dependency>
@@ -282,18 +288,44 @@ <h2>Examples with DOM4J</h2>
282
288
api "io.sf.carte:css4j-dom4j:${css4jDom4jVersion}"
283
289
}
284
290
</ code > </ pre >
285
- < p > or with Apache Maven:</ p >
291
+ < p > But please remember that you have to set up css4j's repository, if you haven't already:</ p >
292
+ < pre class ="code "> < code class ="language-groovy "> repositories {
293
+ maven {
294
+ url "https://css4j.github.io/maven/"
295
+ mavenContent {
296
+ releasesOnly()
297
+ }
298
+ content {
299
+ includeGroup 'io.sf.carte'
300
+ includeGroup 'io.sf.jclf'
301
+ includeGroup 'xmlpull'
302
+ includeGroup 'xpp3'
303
+ }
304
+ }
305
+ }
306
+ </ code > </ pre >
307
+ < p > Same with Apache Maven:</ p >
286
308
< pre class ="code "> < code class ="language-xml "> <dependency>
287
309
<groupId>io.sf.carte</groupId>
288
310
<artifactId>css4j-dom4j</artifactId>
289
311
<version>${css4jDom4j.version}</version>
290
312
</dependency>
291
313
</ code > </ pre >
314
+ < p > Again, please keep in mind adding css4j's Maven repository to your POM file:
315
+ </ p >
316
+ < pre class ="code "> < code class ="language-xml "> <repositories>
317
+ <repository>
318
+ <id>css4j</id>
319
+ <name>CSS4J repository</name>
320
+ <url>https://css4j.github.io/maven/</url>
321
+ </repository>
322
+ </repositories>
323
+ </ code > </ pre >
292
324
< p > The < code > css4j-dom4j</ code > artifact transitively implies the < code > css4j</ code > core module, but since both artifacts have
293
325
different release cycles you may want to add an explicit dependency for the core module, with the latest version.</ p >
294
326
< p > As explained in the < a href ="#modules "> modules section</ a > , recent < code > css4j-dom4j</ code > artifacts are compatible with < code > css4j</ code >
295
327
artifacts that have the same major version number, for example both < code > css4j-dom4j</ code > 3.5.2 and 3.6.0 are compatible with
296
- < code > css4j</ code > 3.7.0 .</ p >
328
+ < code > css4j</ code > 3.9.1 .</ p >
297
329
< h3 class ="subtema " id ="dom4j-parsing "> Loading and parsing an XML document</ h3 >
298
330
< p > This is the easiest way to parse an XML document to use this package with DOM4J, using that library's < code > SAXReader</ code > :</ p >
299
331
< pre class ="code "> < code class ="language-java "> SAXReader reader = new SAXReader(XHTMLDocumentFactory.getInstance());
0 commit comments