* d/control: Add Recommends on devscripts (which provides licensecheck)
* mh_make:
- Improve generated copyright
- Fix generated rules for a build using ant
- When ignoring dependencies, don't fail the build
- When ant is used as the build tool, generate the build.xml file
required for multi projects.
- use licensecheck as an additional source of information for licenses
Ludovic Claude
13 years ago
109 | 109 | read -p "[y]/n > " RUN |
110 | 110 | RUN_TESTS="true" |
111 | 111 | if [ "$RUN" == "n" ]; then |
112 | RUN_TESTS="false" | |
112 | RUN_TESTS= | |
113 | 113 | fi |
114 | 114 | fi |
115 | 115 | |
119 | 119 | read -p "[y]/n > " GEN |
120 | 120 | GEN_JAVADOC="true" |
121 | 121 | if [ "$GEN" == "n" ]; then |
122 | GEN_JAVADOC="false" | |
123 | fi | |
124 | fi | |
125 | ||
126 | if [ -n "$FROM_SVN" ]; then | |
127 | echo | |
128 | SVN_OPTIONS= | |
129 | if [[ "$FROM_SVN" =~ https://.*\.dev\.java\.net/.* ]]; then | |
130 | echo "Press enter if a password is asked" | |
131 | SVN_OPTIONS="--username guest" | |
132 | fi | |
133 | svn export $FROM_SVN $PACKAGE $SVN_OPTIONS | |
134 | cd $PACKAGE | |
135 | fi | |
136 | ||
137 | if [ -e pom.xml.save ]; then | |
138 | mh_unpatchpoms -p$BIN_PACKAGE | |
122 | GEN_JAVADOC= | |
123 | fi | |
139 | 124 | fi |
140 | 125 | |
141 | 126 | echo |
146 | 131 | echo "Warning: apt-file doesn't seem to be configured" |
147 | 132 | echo "Running sudo apt-file update" |
148 | 133 | sudo apt-file update |
134 | else | |
135 | echo '[ok]' | |
149 | 136 | fi |
150 | 137 | else |
151 | 138 | echo "Warning: apt-file doesn't seem to be installed" |
155 | 142 | fi |
156 | 143 | |
157 | 144 | echo |
158 | java -cp /usr/share/java/maven-project.jar:/usr/share/java/maven-repo-helper.jar:/usr/share/java/maven-packager-utils.jar:/usr/share/maven2/lib/maven-debian-uber.jar org.debian.maven.packager.DependenciesSolver --package="$BIN_PACKAGE" ${ANT:+--ant} ${GEN_JAVADOC:+--generate-javadoc} ${RUN_TESTS:+--run-tests} ${VERBOSE:+--verbose} --maven-repo=/usr/share/maven-repo | |
145 | echo "Checking that licensecheck is installed..." | |
146 | if [ ! -f /usr/bin/licensecheck ]; then | |
147 | echo "Warning: licensecheck doesn't seem to be installed" | |
148 | echo "Installing licensecheck using sudo apt-get install devscripts" | |
149 | sudo apt-get install devscripts | |
150 | else | |
151 | echo '[ok]' | |
152 | fi | |
153 | ||
154 | if [ -n "$FROM_SVN" ]; then | |
155 | echo | |
156 | echo "Downloading the upstream sources..." | |
157 | SVN_OPTIONS= | |
158 | if [[ "$FROM_SVN" =~ https://.*\.dev\.java\.net/.* ]]; then | |
159 | echo "Press enter if a password is asked" | |
160 | SVN_OPTIONS="--username guest" | |
161 | fi | |
162 | svn export $FROM_SVN $PACKAGE $SVN_OPTIONS | |
163 | cd $PACKAGE | |
164 | fi | |
165 | ||
166 | if [ -e pom.xml.save ]; then | |
167 | mh_unpatchpoms -p$BIN_PACKAGE | |
168 | fi | |
169 | ||
170 | # Restore state after a brutal stop | |
171 | if [ -f debian/$BIN_PACKAGE.poms ]; then | |
172 | mh_unpatchpoms -p$BIN_PACKAGE | |
173 | fi | |
174 | if [ -f debian/patches/series ]; then | |
175 | quilt pop -a | |
176 | fi | |
177 | ||
178 | # Apply existing quilt patchs as source 3(quilt) is used in the package | |
179 | if [ -f debian/patches/series ]; then | |
180 | quilt push -a | |
181 | fi | |
182 | ||
183 | echo | |
184 | java -cp /usr/share/java/maven-project.jar:/usr/share/java/maven-repo-helper.jar:/usr/share/java/maven-packager-utils.jar:/usr/share/maven2/lib/maven-debian-uber.jar org.debian.maven.packager.DependenciesSolver --verbose --package="$BIN_PACKAGE" ${ANT:+--ant} ${GEN_JAVADOC:+--generate-javadoc} ${RUN_TESTS:+--run-tests} ${VERBOSE:+--verbose} --maven-repo=/usr/share/maven-repo | |
159 | 185 | |
160 | 186 | if [ $? != 0 ]; then |
187 | if [ -f debian/patches/series ]; then | |
188 | quilt pop -a | |
189 | fi | |
161 | 190 | exit 1 |
162 | 191 | fi |
163 | 192 | |
168 | 197 | mvn org.debian.maven:maven-packager-utils:$MH_VERSION:generate -Demail="$DEBEMAIL" -Dpackager="$DEBFULLNAME" -DpackagerLicense="$DEBLICENSE" -Dpackage="$PACKAGE" -Dbin.package="$BIN_PACKAGE" -DrunTests="$RUN_TESTS" -DgenerateJavadoc="$GEN_JAVADOC" -Dmaven.repo.local=/usr/share/maven-repo ${ANT:+-DpackageType=ant} ${FROM_SVN:+-DdownloadUrl=scm:svn:$FROM_SVN} --offline |
169 | 198 | |
170 | 199 | if [ $? != 0 ]; then |
200 | if [ -f debian/$BIN_PACKAGE.poms ]; then | |
201 | mh_unpatchpoms -p$BIN_PACKAGE | |
202 | fi | |
203 | if [ -f debian/patches/series ]; then | |
204 | quilt pop -a | |
205 | fi | |
171 | 206 | exit 1 |
172 | 207 | fi |
173 | 208 | |
176 | 211 | dch --create --newversion=${debianVersion}-1 --package=$PACKAGE "Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>" |
177 | 212 | fi |
178 | 213 | |
179 | mh_unpatchpoms -p$BIN_PACKAGE | |
180 | rm -f debian/*.substvars⏎ | |
214 | if [ -f debian/$BIN_PACKAGE.poms ]; then | |
215 | mh_unpatchpoms -p$BIN_PACKAGE | |
216 | fi | |
217 | if [ -f debian/patches/series ]; then | |
218 | quilt pop -a | |
219 | fi | |
220 | ||
221 | rm -f debian/*.substvars | |
222 | rm -f .debianVersion |
0 | maven-debian-helper (1.4) experimental; urgency=low | |
1 | ||
2 | * d/control: Add Recommends on devscripts (which provides licensecheck) | |
3 | * mh_make: | |
4 | - Improve generated copyright | |
5 | - Fix generated rules for a build using ant | |
6 | - When ignoring dependencies, don't fail the build | |
7 | - When ant is used as the build tool, generate the build.xml file | |
8 | required for multi projects. | |
9 | - use licensecheck as an additional source of information for licenses | |
10 | ||
11 | -- Ludovic Claude <ludovic.claude@laposte.net> Fri, 12 Nov 2010 12:26:37 +0100 | |
12 | ||
0 | 13 | maven-debian-helper (1.3) experimental; urgency=low |
1 | 14 | |
2 | 15 | * ${maven:Depends} and similar substitution vars: add |
17 | 17 | libmaven-clean-plugin-java, libmaven-resources-plugin-java, |
18 | 18 | libmaven-compiler-plugin-java, libmaven-jar-plugin-java, libmaven-site-plugin-java, |
19 | 19 | libsurefire-java, velocity, libplexus-velocity-java |
20 | Recommends: apt-file, subversion | |
20 | Recommends: apt-file, devscripts, subversion | |
21 | 21 | Suggests: libmaven-javadoc-plugin-java |
22 | 22 | Description: Helper tools for building Debian packages with Maven |
23 | 23 | Maven is a software project management and comprehension tool. Based on the |
0 | 0 | package org.debian.maven; |
1 | ||
2 | /* | |
3 | * Copyright 2009 Torsten Werner. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
1 | 17 | |
2 | 18 | import java.io.FileInputStream; |
3 | 19 | import java.io.IOException; |
0 | 0 | package org.debian.maven.plugin; |
1 | ||
2 | /* | |
3 | * Copyright 2009 Torsten Werner. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
1 | 17 | |
2 | 18 | import java.io.File; |
3 | 19 |
0 | 0 | package org.debian.maven.plugin; |
1 | ||
2 | /* | |
3 | * Copyright 2009 Torsten Werner. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
1 | 17 | |
2 | 18 | import java.io.File; |
3 | 19 |
0 | 0 | package org.debian.maven.plugin; |
1 | ||
2 | /* | |
3 | * Copyright 2009 Torsten Werner. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
1 | 17 | |
2 | 18 | /** |
3 | 19 | * resolves compile dependencies |
0 | 0 | package org.debian.maven.plugin; |
1 | ||
2 | /* | |
3 | * Copyright 2009 Torsten Werner. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
1 | 17 | |
2 | 18 | import org.apache.maven.plugin.AbstractMojo; |
3 | 19 | import org.apache.maven.plugin.MojoExecutionException; |
0 | 0 | package org.debian.maven.plugin; |
1 | ||
2 | /* | |
3 | * Copyright 2009 Torsten Werner. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
1 | 17 | |
2 | 18 | /** |
3 | 19 | * resolves runtime dependencies |
0 | 0 | package org.debian.maven.plugin; |
1 | ||
2 | /* | |
3 | * Copyright 2009 Torsten Werner. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
1 | 17 | |
2 | 18 | /** |
3 | 19 | * resolves test dependencies |
0 | 0 | package org.debian.maven.plugin; |
1 | 1 | |
2 | 2 | import java.io.IOException; |
3 | ||
4 | /* | |
5 | * Copyright 2009 Torsten Werner, Ludovic Claude. | |
6 | * | |
7 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
8 | * you may not use this file except in compliance with the License. | |
9 | * You may obtain a copy of the License at | |
10 | * | |
11 | * http://www.apache.org/licenses/LICENSE-2.0 | |
12 | * | |
13 | * Unless required by applicable law or agreed to in writing, software | |
14 | * distributed under the License is distributed on an "AS IS" BASIS, | |
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
16 | * See the License for the specific language governing permissions and | |
17 | * limitations under the License. | |
18 | */ | |
3 | 19 | |
4 | 20 | /** |
5 | 21 | * Install the javadoc jar. |
0 | 0 | package org.debian.maven.plugin; |
1 | ||
2 | /* | |
3 | * Copyright 2009 Torsten Werner, Ludovic Claude. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
1 | 17 | |
2 | 18 | import java.io.File; |
3 | 19 | import java.io.FileReader; |
0 | 0 | package org.debian.maven.plugin; |
1 | ||
2 | /* | |
3 | * Copyright 2009 Torsten Werner, Ludovic Claude. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
1 | 17 | |
2 | 18 | import java.io.IOException; |
3 | 19 | import org.codehaus.plexus.util.FileUtils; |
14 | 14 | * See the License for the specific language governing permissions and |
15 | 15 | * limitations under the License. |
16 | 16 | */ |
17 | ||
17 | 18 | import org.apache.maven.plugin.AbstractMojo; |
18 | 19 | import org.apache.maven.plugin.MojoExecutionException; |
19 | 20 |
+149
-23
14 | 14 | * See the License for the specific language governing permissions and |
15 | 15 | * limitations under the License. |
16 | 16 | */ |
17 | ||
17 | 18 | import java.io.*; |
18 | 19 | import java.util.*; |
19 | 20 | import java.util.logging.Level; |
132 | 133 | private List toResolve = new ArrayList(); |
133 | 134 | private Set knownProjectDependencies = new TreeSet(); |
134 | 135 | private Set ignoredDependencies = new TreeSet(); |
136 | private Set notIgnoredDependencies = new TreeSet(); | |
135 | 137 | private Set compileDepends = new TreeSet(); |
136 | 138 | private Set testDepends = new TreeSet(); |
137 | 139 | private Set runtimeDepends = new TreeSet(); |
163 | 165 | cleanIgnoreRules.setDescription(readResource("maven.cleanIgnoreRules.description")); |
164 | 166 | cleanIgnoreRules.setWarnRulesFileNotFound(false); |
165 | 167 | cleanIgnoreRules.setVerbose(true); |
168 | cleanIgnoreRules.setDontDuplicate(pomTransformer.getIgnoreRules()); | |
166 | 169 | |
167 | 170 | Rule toDebianRule = new Rule("s/.*/debian/"); |
168 | 171 | toDebianRule.setDescription("Change the version to the symbolic 'debian' version"); |
192 | 195 | return sb.toString(); |
193 | 196 | } |
194 | 197 | |
198 | public boolean isRunTests() { | |
199 | return runTests; | |
200 | } | |
201 | ||
195 | 202 | public void setRunTests(boolean b) { |
196 | 203 | this.runTests = b; |
197 | 204 | } |
200 | 207 | this.offline = offline; |
201 | 208 | } |
202 | 209 | |
203 | private void setGenerateJavadoc(boolean b) { | |
210 | public boolean isGenerateJavadoc() { | |
211 | return generateJavadoc; | |
212 | } | |
213 | ||
214 | public void setGenerateJavadoc(boolean b) { | |
204 | 215 | this.generateJavadoc = b; |
205 | 216 | } |
206 | 217 | |
261 | 272 | } |
262 | 273 | |
263 | 274 | private boolean askIgnoreDependency(String sourcePomLoc, Dependency dependency, String message, boolean defaultToIgnore) { |
264 | if (!interactive) { | |
275 | if (!interactive || notIgnoredDependencies.contains(dependency)) { | |
265 | 276 | return false; |
266 | 277 | } |
267 | 278 | System.out.println(); |
274 | 285 | System.out.print("y/[n] > "); |
275 | 286 | } |
276 | 287 | String s = readLine().toLowerCase(); |
277 | if (defaultToIgnore) { | |
278 | return !s.startsWith("n"); | |
279 | } else { | |
280 | return s.startsWith("y"); | |
281 | } | |
288 | boolean ignore = defaultToIgnore ? !s.startsWith("n") : s.startsWith("y"); | |
289 | if (!ignore) { | |
290 | notIgnoredDependencies.add(dependency); | |
291 | } | |
292 | return ignore; | |
282 | 293 | } |
283 | 294 | |
284 | 295 | public boolean isInteractive() { |
331 | 342 | } |
332 | 343 | |
333 | 344 | public void saveMavenRules() { |
345 | // Don't save implicit rules | |
346 | pomTransformer.getRules().remove(DependencyRule.TO_DEBIAN_VERSION_RULE); | |
347 | pomTransformer.getRules().remove(DependencyRule.MAVEN_PLUGINS_KEEP_VERSION_RULE); | |
334 | 348 | pomTransformer.getRules().save(); |
335 | 349 | } |
336 | 350 | |
337 | 351 | public void saveMavenPublishedRules() { |
352 | // Don't save implicit rules | |
353 | pomTransformer.getPublishedRules().remove(DependencyRule.TO_DEBIAN_VERSION_RULE); | |
354 | pomTransformer.getPublishedRules().remove(DependencyRule.MAVEN_PLUGINS_KEEP_VERSION_RULE); | |
338 | 355 | pomTransformer.getPublishedRules().save(); |
339 | 356 | } |
340 | 357 | |
539 | 556 | pom.setParent(null); |
540 | 557 | } else if (pom.getParent() != null) { |
541 | 558 | boolean oldNoParent = getPOMOptions(projectPom).isNoParent(); |
542 | pom.setParent(resolveDependency(pom.getParent(), projectPom, true, false, false, true)); | |
559 | // Don't mark the parent dependency as 'build time' dependency because once installed, | |
560 | // the POM for this project will always need the parent POM to be available | |
561 | pom.setParent(resolveDependency(pom.getParent(), projectPom, false, false, false, true)); | |
543 | 562 | if (getPOMOptions(projectPom).isNoParent() != oldNoParent) { |
544 | 563 | resetPOM(projectPom); |
545 | 564 | pom = getPOM(projectPom); |
547 | 566 | } |
548 | 567 | |
549 | 568 | getRepository().registerPom(projectPom, pom); |
569 | // Also register automatically the test jar which may accompany the current jar and be | |
570 | // used in another module of the same project | |
571 | if ("jar".equals(pom.getThisPom().getType())) { | |
572 | POMInfo testPom = (POMInfo) pom.clone(); | |
573 | testPom.getThisPom().setType("test-jar"); | |
574 | getRepository().registerPom(projectPom, testPom); | |
575 | } | |
550 | 576 | |
551 | 577 | knownProjectDependencies.add(pom.getThisPom()); |
552 | 578 | |
589 | 615 | i.hasNext(); ) { |
590 | 616 | DependencyRule previousRule = (DependencyRule) i.next(); |
591 | 617 | if (!previousRule.equals(DependencyRule.TO_DEBIAN_VERSION_RULE) && |
592 | !previousRule.equals(DependencyRule.TO_DEBIAN_VERSION_RULE) && | |
618 | !previousRule.equals(DependencyRule.MAVEN_PLUGINS_KEEP_VERSION_RULE) && | |
593 | 619 | previousRule.matches(pom.getThisPom())) { |
594 | 620 | explicitlyMentionedInRules = true; |
595 | 621 | break; |
715 | 741 | noParent = options.isNoParent(); |
716 | 742 | hasPackageVersion = options.getHasPackageVersion(); |
717 | 743 | } |
744 | ||
718 | 745 | info = pomTransformer.transformPom(projectPom, tmpDest, noParent, hasPackageVersion, false, false, null, null, true); |
719 | 746 | pomInfoCache.put(projectPom.getAbsolutePath(), info); |
720 | 747 | return info; |
779 | 806 | String baseDirPath = baseDir.getAbsolutePath(); |
780 | 807 | sourcePomLoc = sourcePomLoc.substring(baseDirPath.length() + 1, sourcePomLoc.length()); |
781 | 808 | if (verbose) { |
782 | System.out.println("Resolving " + dependency); | |
783 | } | |
809 | String msg = "Resolving " + dependency; | |
810 | if (dependency.getScope() != null) { | |
811 | msg += " of scope " + dependency.getScope(); | |
812 | } | |
813 | System.out.println(msg + "..."); | |
814 | } | |
815 | ||
816 | // First let the packager mark as ignored those dependencies which should be ignored | |
784 | 817 | boolean ignoreDependency = false; |
785 | if ("maven-plugin".equals(dependency.getType()) && packageType.equals("ant")) { | |
786 | ignoreDependency = true; | |
787 | } else if (canIgnorePlugin(dependency)) { | |
818 | if (!ignoreDependency && canIgnorePlugin(dependency)) { | |
788 | 819 | ignoreDependency = askIgnoreDependency(sourcePomLoc, dependency, "This plugin is not useful for the build or its use is against Debian policies. Ignore this plugin?"); |
789 | } else if (canIgnoreExtension(dependency)) { | |
820 | } | |
821 | if (!ignoreDependency && canIgnoreExtension(dependency)) { | |
790 | 822 | ignoreDependency = askIgnoreDependency(sourcePomLoc, dependency, "This extension is not useful for the build or its use is against Debian policies. Ignore this extension?"); |
791 | } else if (canBeIgnoredPlugin(dependency)) { | |
823 | } | |
824 | if (!ignoreDependency && canBeIgnoredPlugin(dependency)) { | |
792 | 825 | ignoreDependency = askIgnoreDependency(sourcePomLoc, dependency, "This plugin may be ignored in some cases. Ignore this plugin?"); |
793 | } else if (!runTests) { | |
826 | } | |
827 | if (!ignoreDependency && !runTests) { | |
794 | 828 | if ("test".equals(dependency.getScope())) { |
795 | 829 | ignoreDependency = askIgnoreDependency(sourcePomLoc, dependency, "Tests are turned off. Ignore this test dependency?"); |
796 | 830 | } else if (isTestPlugin(dependency)) { |
797 | 831 | ignoreDependency = askIgnoreDependency(sourcePomLoc, dependency, "Tests are turned off. Ignore this test plugin?"); |
798 | 832 | } |
799 | } else if (!generateJavadoc && isDocumentationOrReportPlugin(dependency)) { | |
833 | } | |
834 | if (!ignoreDependency && !generateJavadoc && isDocumentationOrReportPlugin(dependency)) { | |
800 | 835 | ignoreDependency = askIgnoreDependency(sourcePomLoc, dependency, "Documentation is turned off. Ignore this documentation plugin?"); |
801 | 836 | } |
802 | 837 | |
804 | 839 | ignoredDependencies.add(dependency); |
805 | 840 | String ruleDef = dependency.getGroupId() + " " + dependency.getArtifactId() + " * *"; |
806 | 841 | pomTransformer.getIgnoreRules().add(new DependencyRule(ruleDef)); |
842 | if (verbose) { | |
843 | System.out.println("[ignored]"); | |
844 | } | |
845 | return null; | |
846 | } | |
847 | ||
848 | // Automatically skip some dependencies when ant packaging is used | |
849 | boolean skipDependency = false; | |
850 | String skipReason = ""; | |
851 | if (packageType.equals("ant")) { | |
852 | if ("maven-plugin".equals(dependency.getType())) { | |
853 | try { | |
854 | if (!getPOM(sourcePom).getThisPom().getType().equals("pom")) { | |
855 | skipDependency = true; | |
856 | skipReason = "Maven plugins are not used during a build with Ant"; | |
857 | } | |
858 | } catch (Exception e) { | |
859 | e.printStackTrace(); | |
860 | } | |
861 | } | |
862 | if (!runTests && "test".equals(dependency.getScope())) { | |
863 | skipDependency = true; | |
864 | skipReason = "Tests are not executed during the build"; | |
865 | } | |
866 | } | |
867 | if (skipDependency) { | |
868 | // Even if we skip the dependency, try to locate its associated maven rules, | |
869 | // as this may be useful later - but never fail if the dependency is not found. | |
870 | POMInfo pom = getRepository().searchMatchingPOM(dependency); | |
871 | if (pom != null) { | |
872 | String mavenRules = (String) pom.getProperties().get("debian.mavenRules"); | |
873 | if (mavenRules != null) { | |
874 | StringTokenizer st = new StringTokenizer(mavenRules, ","); | |
875 | while (st.hasMoreTokens()) { | |
876 | String ruleDef = st.nextToken().trim(); | |
877 | pomTransformer.getRules().add(new DependencyRule(ruleDef)); | |
878 | } | |
879 | } | |
880 | } | |
881 | if (verbose) { | |
882 | if (!skipReason.isEmpty()) { | |
883 | System.out.println("[skipped - " + skipReason + "]"); | |
884 | } else { | |
885 | System.out.println("[skipped]"); | |
886 | } | |
887 | } | |
807 | 888 | return null; |
808 | 889 | } |
809 | 890 | |
835 | 916 | |
836 | 917 | if (pom == null) { |
837 | 918 | if (management) { |
919 | if (verbose) { | |
920 | System.out.println("[skipped dependency or plugin management]"); | |
921 | } | |
838 | 922 | return null; |
923 | } else if ("maven-plugin".equals(dependency.getType()) && packageType.equals("ant")) { | |
924 | if (verbose) { | |
925 | System.out.println("[skipped - not used in Ant build]"); | |
926 | } | |
927 | return null; | |
839 | 928 | } else { |
840 | 929 | if (!ignoreDependency) { |
841 | 930 | if (resolvingParent) { |
843 | 932 | "The parent POM cannot be found in the Maven repository for Debian. Ignore it?"); |
844 | 933 | getPOMOptions(sourcePom).setNoParent(noParent); |
845 | 934 | if (noParent) { |
935 | if (verbose) { | |
936 | System.out.println("[no-parent]"); | |
937 | } | |
846 | 938 | return null; |
847 | 939 | } |
848 | 940 | } else if (isDocumentationOrReportPlugin(dependency)) { |
849 | 941 | ignoreDependency = askIgnoreDependency(sourcePomLoc, dependency, |
850 | 942 | "This documentation or report plugin cannot be found in the Maven repository for Debian. Ignore this plugin?"); |
851 | 943 | } else if ("maven-plugin".equals(dependency.getType())) { |
852 | issues.add(sourcePomLoc + ": Plugin is not packaged in the Maven repository for Debian: " + dependency.getGroupId() + ":" | |
853 | + dependency.getArtifactId() + ":" + dependency.getVersion()); | |
854 | 944 | ignoreDependency = askIgnoreDependency(sourcePomLoc, dependency, "This plugin cannot be found in the Debian Maven repository. Ignore this plugin?", false); |
945 | if (!ignoreDependency) { | |
946 | issues.add(sourcePomLoc + ": Plugin is not packaged in the Maven repository for Debian: " + dependency.getGroupId() + ":" | |
947 | + dependency.getArtifactId() + ":" + dependency.getVersion()); | |
948 | } | |
855 | 949 | } else { |
856 | issues.add(sourcePomLoc + ": Dependency is not packaged in the Maven repository for Debian: " + dependency.getGroupId() + ":" | |
857 | + dependency.getArtifactId() + ":" + dependency.getVersion()); | |
858 | 950 | ignoreDependency = askIgnoreDependency(sourcePomLoc, dependency, "This dependency cannot be found in the Debian Maven repository. Ignore this dependency?", false); |
951 | if (!ignoreDependency) { | |
952 | issues.add(sourcePomLoc + ": Dependency is not packaged in the Maven repository for Debian: " + dependency.getGroupId() + ":" | |
953 | + dependency.getArtifactId() + ":" + dependency.getVersion()); | |
954 | } | |
859 | 955 | } |
860 | 956 | } |
861 | 957 | if (ignoreDependency) { |
862 | 958 | ignoredDependencies.add(dependency); |
863 | 959 | String ruleDef = dependency.getGroupId() + " " + dependency.getArtifactId() + " * *"; |
864 | 960 | pomTransformer.getIgnoreRules().add(new DependencyRule(ruleDef)); |
961 | if (verbose) { | |
962 | System.out.println("[ignored]"); | |
963 | } | |
865 | 964 | return null; |
866 | 965 | } else { |
867 | 966 | String pkg = searchPkg(new File("/usr/share/maven-repo/" |
879 | 978 | return resolveDependency(dependency, sourcePom, buildTime, mavenExtension, management); |
880 | 979 | } |
881 | 980 | } |
981 | if (verbose) { | |
982 | System.out.println("[error]"); | |
983 | } | |
882 | 984 | throw new DependencyNotFoundException(dependency); |
883 | 985 | } |
884 | 986 | } |
945 | 1047 | String ruleDef = st.nextToken().trim(); |
946 | 1048 | pomTransformer.getRules().add(new DependencyRule(ruleDef)); |
947 | 1049 | } |
1050 | } | |
1051 | if (verbose) { | |
1052 | System.out.println("[ok]"); | |
948 | 1053 | } |
949 | 1054 | return pom.getThisPom(); |
950 | 1055 | } |
1113 | 1218 | System.out.println(" --generate-javadoc: generate Javadoc"); |
1114 | 1219 | System.out.println(" --non-interactive: non interactive session"); |
1115 | 1220 | System.out.println(" --offline: offline mode for Debian build compatibility"); |
1221 | System.out.println(" -m<repo root>--maven-repo=<repo root>: location of the Maven repository,"); | |
1222 | System.out.println(" used to force the versions of the Maven plugins used in the current"); | |
1223 | System.out.println(" POM file with the versions found in the repository"); | |
1116 | 1224 | return; |
1117 | 1225 | } |
1118 | 1226 | DependenciesSolver solver = new DependenciesSolver(); |
1125 | 1233 | boolean verbose = false; |
1126 | 1234 | String debianPackage = ""; |
1127 | 1235 | String packageType = "maven"; |
1236 | File mavenRepo = null; | |
1128 | 1237 | while (i < args.length && (args[i].trim().startsWith("-") || args[i].trim().isEmpty())) { |
1129 | 1238 | String arg = args[i].trim(); |
1130 | 1239 | if ("--verbose".equals(arg) || "-v".equals(arg)) { |
1143 | 1252 | solver.setInteractive(false); |
1144 | 1253 | } else if (arg.equals("--offline")) { |
1145 | 1254 | solver.setOffline(true); |
1255 | } else if (arg.startsWith("-m")) { | |
1256 | mavenRepo = new File(arg.substring(2)); | |
1257 | } else if (arg.startsWith("--maven-repo=")) { | |
1258 | mavenRepo = new File(arg.substring("--maven-repo=".length())); | |
1146 | 1259 | } |
1147 | 1260 | i = inc(i, args); |
1148 | 1261 | } |
1153 | 1266 | solver.setExploreProjects(true); |
1154 | 1267 | solver.setListOfPoms(poms); |
1155 | 1268 | |
1269 | if (mavenRepo != null) { | |
1270 | Repository repository = new Repository(mavenRepo); | |
1271 | solver.getPomTransformer().setRepository(repository); | |
1272 | solver.getPomTransformer().usePluginVersionsFromRepository(); | |
1273 | } | |
1274 | ||
1156 | 1275 | if (verbose) { |
1157 | System.out.println("Solving dependencies for package " + debianPackage); | |
1276 | String msg = "Solving dependencies for package " + debianPackage; | |
1277 | if (solver.isRunTests()) { | |
1278 | msg += " (tests are included)"; | |
1279 | } | |
1280 | if (solver.isGenerateJavadoc()) { | |
1281 | msg += " (documentation is included)"; | |
1282 | } | |
1283 | System.out.println(msg); | |
1158 | 1284 | solver.setVerbose(true); |
1159 | 1285 | } |
1160 | 1286 |
+200
-100
14 | 14 | * See the License for the specific language governing permissions and |
15 | 15 | * limitations under the License. |
16 | 16 | */ |
17 | ||
17 | 18 | import org.apache.maven.model.Developer; |
18 | 19 | import org.apache.maven.model.License; |
19 | 20 | import org.apache.maven.plugin.AbstractMojo; |
153 | 154 | context.put("packager", packager); |
154 | 155 | context.put("packagerEmail", email); |
155 | 156 | context.put("project", project); |
157 | context.put("collectedProjects", collectedProjects); | |
156 | 158 | context.put("runTests", Boolean.valueOf(runTests)); |
157 | 159 | context.put("generateJavadoc", Boolean.valueOf(generateJavadoc)); |
158 | 160 | |
165 | 167 | project.setUrl(readLine()); |
166 | 168 | } |
167 | 169 | |
168 | Set licenses = new TreeSet(); | |
169 | for (Iterator i = project.getLicenses().iterator(); i.hasNext(); ) { | |
170 | License license = (License) i.next(); | |
171 | String licenseName = ""; | |
172 | if (license.getName() != null) { | |
173 | licenseName = license.getName() + " "; | |
174 | } | |
175 | String licenseUrl = ""; | |
176 | if (license.getUrl() != null) { | |
177 | licenseUrl = license.getUrl().toLowerCase(); | |
178 | } | |
179 | boolean recognized = false; | |
180 | if (licenseName.indexOf("mit ") >= 0 || licenseUrl.indexOf("mit-license") >= 0) { | |
181 | licenses.add("MIT"); | |
182 | recognized = true; | |
183 | } else if (licenseName.indexOf("bsd ") >= 0 || licenseUrl.indexOf("bsd-license") >= 0) { | |
184 | licenses.add("BSD"); | |
185 | recognized = true; | |
186 | } else if (licenseName.indexOf("artistic ") >= 0 || licenseUrl.indexOf("artistic-license") >= 0) { | |
187 | licenses.add("Artistic"); | |
188 | recognized = true; | |
189 | } else if (licenseName.indexOf("apache ") >= 0 || licenseUrl.indexOf("apache") >= 0) { | |
190 | if (licenseName.indexOf("2.") >= 0 || licenseUrl.indexOf("2.") >= 0) { | |
191 | licenses.add("Apache-2.0"); | |
192 | recognized = true; | |
193 | } else if (licenseName.indexOf("1.0") >= 0 || licenseUrl.indexOf("1.0") >= 0) { | |
194 | licenses.add("Apache-1.0"); | |
195 | recognized = true; | |
196 | } else if (licenseName.indexOf("1.1") >= 0 || licenseUrl.indexOf("1.1") >= 0) { | |
197 | licenses.add("Apache-1.1"); | |
198 | recognized = true; | |
199 | } | |
200 | } else if (licenseName.indexOf("lgpl ") >= 0 || licenseUrl.indexOf("lgpl") >= 0) { | |
201 | if (licenseName.indexOf("2.1") >= 0 || licenseUrl.indexOf("2.1") >= 0) { | |
202 | licenses.add("LGPL-2.1"); | |
203 | recognized = true; | |
204 | } else if (licenseName.indexOf("2") >= 0 || licenseUrl.indexOf("2") >= 0) { | |
205 | licenses.add("LGPL-2"); | |
206 | recognized = true; | |
207 | } else if (licenseName.indexOf("3") >= 0 || licenseUrl.indexOf("3") >= 0) { | |
208 | licenses.add("LGPL-2"); | |
209 | recognized = true; | |
210 | } | |
211 | } else if (licenseName.indexOf("gpl ") >= 0 || licenseUrl.indexOf("gpl") >= 0) { | |
212 | if (licenseName.indexOf("2") >= 0 || licenseUrl.indexOf("2") >= 0) { | |
213 | licenses.add("GPL-2"); | |
214 | recognized = true; | |
215 | } else if (licenseName.indexOf("3") >= 0 || licenseUrl.indexOf("3") >= 0) { | |
216 | licenses.add("GPL-3"); | |
217 | recognized = true; | |
218 | } | |
219 | } | |
220 | if (!recognized) { | |
221 | System.out.println("License " + licenseName + licenseUrl + " was not recognized, please enter a license name preferably in one of:"); | |
222 | System.out.println("Apache Artistic BSD FreeBSD ISC CC-BY CC-BY-SA CC-BY-ND CC-BY-NC CC-BY-NC-SA CC-BY-NC-ND CC0 CDDL CPL Eiffel"); | |
223 | System.out.println("Expat GPL LGPL GFDL GFDL-NIV LPPL MPL Perl PSF QPL W3C-Software ZLIB Zope"); | |
224 | String s = readLine(); | |
225 | if (s.length() > 0) { | |
226 | licenses.add(s); | |
227 | } | |
228 | } | |
229 | } | |
230 | if (licenses.isEmpty()) { | |
231 | System.out.println("License was not found, please enter a license name preferably in one of:"); | |
232 | System.out.println("Apache Artistic BSD FreeBSD ISC CC-BY CC-BY-SA CC-BY-ND CC-BY-NC CC-BY-NC-SA CC-BY-NC-ND CC0 CDDL CPL Eiffel"); | |
233 | System.out.println("Expat GPL LGPL GFDL GFDL-NIV LPPL MPL Perl PSF QPL W3C-Software ZLIB Zope"); | |
234 | String s = readLine(); | |
235 | if (s.length() > 0) { | |
236 | licenses.add(s); | |
237 | } | |
238 | } | |
170 | Set licenses = discoverLicenses(); | |
239 | 171 | context.put("licenses", licenses); |
240 | 172 | |
241 | 173 | if (licenses.size() == 1) { |
277 | 209 | if (projectTeam == null || projectTeam.isEmpty()) { |
278 | 210 | projectTeam = project.getName() + " developers"; |
279 | 211 | } |
280 | context.put("copyrightOwner", copyrightOwner); | |
281 | 212 | context.put("projectTeam", projectTeam); |
282 | 213 | |
283 | 214 | String copyrightYear; |
382 | 313 | context.put("compileDependencies", depends); |
383 | 314 | context.put("runtimeDependencies", split(substvars.getProperty("maven.Depends"))); |
384 | 315 | context.put("optionalDependencies", split(substvars.getProperty("maven.OptionalDepends"))); |
316 | context.put("javadocDependencies", split(substvars.getProperty("maven.DocDepends"))); | |
317 | context.put("javadocOptionalDependencies", split(substvars.getProperty("maven.DocOptionalDepends"))); | |
385 | 318 | |
386 | 319 | if ("ant".equals(packageType)) { |
387 | 320 | Set buildJars = new TreeSet(); |
398 | 331 | |
399 | 332 | if ("ant".equals(packageType)) { |
400 | 333 | ListOfPOMs listOfPOMs = new ListOfPOMs(new File(outputDirectory, binPackageName + ".poms")); |
334 | setupArtifactLocation(listOfPOMs, project); | |
401 | 335 | for (Iterator i = collectedProjects.iterator(); i.hasNext();) { |
402 | 336 | MavenProject mavenProject = (MavenProject) i.next(); |
403 | String basedir = project.getBasedir().getAbsolutePath(); | |
404 | String dirRelPath = mavenProject.getBasedir().getAbsolutePath().substring(basedir.length() + 1); | |
405 | if (! "pom".equals(mavenProject.getPackaging())) { | |
406 | String pomFile = dirRelPath + "/pom.xml"; | |
407 | listOfPOMs.getOrCreatePOMOptions(pomFile).setJavaLib(true); | |
408 | String extension = mavenProject.getPackaging(); | |
409 | if (extension.equals("bundle")) { | |
410 | extension = "jar"; | |
411 | } | |
412 | if (extension.equals("webapp")) { | |
413 | extension = "war"; | |
414 | } | |
415 | if (mavenProject.getArtifact() != null && mavenProject.getArtifact().getFile() != null) { | |
416 | extension = mavenProject.getArtifact().getFile().toString(); | |
417 | extension = extension.substring(extension.lastIndexOf('.') + 1); | |
418 | } | |
419 | listOfPOMs.getOrCreatePOMOptions(pomFile).setArtifact(dirRelPath + "/" + mavenProject.getArtifactId() + "-*." | |
420 | + extension); | |
421 | } | |
337 | setupArtifactLocation(listOfPOMs, mavenProject); | |
422 | 338 | } |
423 | 339 | listOfPOMs.save(); |
424 | 340 | } |
464 | 380 | context.put("tagMarker", tagMarker); |
465 | 381 | context.put("suffixUrl", suffixUrl); |
466 | 382 | |
467 | FileWriter out = new FileWriter(new File(outputDirectory, "watch")); | |
468 | Velocity.mergeTemplate("watch.svn.vm", "UTF8", context, out); | |
469 | out.flush(); | |
470 | out.close(); | |
471 | ||
472 | out = new FileWriter(new File(outputDirectory, "orig-tar.sh")); | |
473 | Velocity.mergeTemplate("orig-tar.svn.vm", "UTF8", context, out); | |
474 | out.flush(); | |
475 | out.close(); | |
383 | generateFile(context, "watch.svn.vm", outputDirectory, "watch"); | |
384 | generateFile(context, "orig-tar.svn.vm", outputDirectory, "orig-tar.sh"); | |
476 | 385 | |
477 | 386 | makeExecutable("debian/orig-tar.sh"); |
478 | 387 | |
509 | 418 | } |
510 | 419 | |
511 | 420 | if ("ant".equals(packageType)) { |
421 | boolean containsJars = false; | |
422 | boolean containsPlugins = false; | |
423 | if (project.getPackaging().equals("pom") && project.getModules().size() > 0) { | |
424 | for (Iterator i = collectedProjects.iterator(); i.hasNext(); ) { | |
425 | MavenProject module = (MavenProject) i.next(); | |
426 | if (module.getPackaging().equals("maven-plugin")) { | |
427 | containsPlugins = true; | |
428 | } else if (!module.getPackaging().equals("pom")) { | |
429 | containsJars = true; | |
430 | } | |
431 | } | |
432 | generateFile(context, "build.xml.vm", outputDirectory, "build.xml"); | |
433 | } else if (!project.getPackaging().equals("pom")) { | |
434 | if (project.getPackaging().equals("maven-plugin")) { | |
435 | containsPlugins = true; | |
436 | } else if (!project.getPackaging().equals("pom")) { | |
437 | containsJars = true; | |
438 | } | |
439 | } | |
440 | context.put("containsJars", Boolean.valueOf(containsJars)); | |
441 | context.put("containsPlugins", Boolean.valueOf(containsPlugins)); | |
512 | 442 | generateFile(context, "build.properties.ant.vm", outputDirectory, "build.properties"); |
443 | generateFile(context, "build-classpath.vm", outputDirectory, "build-classpath"); | |
513 | 444 | } else { |
514 | 445 | generateFile(context, "maven.properties.vm", outputDirectory, "maven.properties"); |
515 | 446 | } |
520 | 451 | } catch (Exception ex) { |
521 | 452 | ex.printStackTrace(); |
522 | 453 | } |
454 | } | |
455 | ||
456 | private void setupArtifactLocation(ListOfPOMs listOfPOMs, MavenProject mavenProject) { | |
457 | String basedir = project.getBasedir().getAbsolutePath(); | |
458 | String dirRelPath = mavenProject.getBasedir().getAbsolutePath().substring(basedir.length() + 1); | |
459 | if (! "pom".equals(mavenProject.getPackaging())) { | |
460 | String pomFile = dirRelPath + "/pom.xml"; | |
461 | listOfPOMs.getOrCreatePOMOptions(pomFile).setJavaLib(true); | |
462 | String extension = mavenProject.getPackaging(); | |
463 | if (extension.equals("bundle")) { | |
464 | extension = "jar"; | |
465 | } | |
466 | if (extension.equals("webapp")) { | |
467 | extension = "war"; | |
468 | } | |
469 | if (mavenProject.getArtifact() != null && mavenProject.getArtifact().getFile() != null) { | |
470 | extension = mavenProject.getArtifact().getFile().toString(); | |
471 | extension = extension.substring(extension.lastIndexOf('.') + 1); | |
472 | } | |
473 | ListOfPOMs.POMOptions pomOptions = listOfPOMs.getOrCreatePOMOptions(pomFile); | |
474 | pomOptions.setArtifact(dirRelPath + "/target/" + mavenProject.getArtifactId() + "-*." | |
475 | + extension); | |
476 | if ("jar".equals(extension) && generateJavadoc && "ant".equals(packageType)) { | |
477 | String artifactId = mavenProject.getArtifact().getArtifactId(); | |
478 | String docPom = dirRelPath + "/target/" + artifactId + ".javadoc.pom"; | |
479 | listOfPOMs.getOrCreatePOMOptions(docPom).setIgnorePOM(true); | |
480 | listOfPOMs.getOrCreatePOMOptions(docPom).setArtifact(dirRelPath + "/target/" + artifactId + ".javadoc.jar"); | |
481 | listOfPOMs.getOrCreatePOMOptions(docPom).setClassifier("javadoc"); | |
482 | listOfPOMs.getOrCreatePOMOptions(docPom).setHasPackageVersion(pomOptions.getHasPackageVersion()); | |
483 | listOfPOMs.getOrCreatePOMOptions(docPom).setDestPackage(packageName + "-doc"); | |
484 | } | |
485 | pomOptions.setJavaLib(true); | |
486 | if (mavenProject.getArtifactId().matches(packageName + "\\d")) { | |
487 | pomOptions.setUsjName(packageName); | |
488 | } | |
489 | } | |
490 | } | |
491 | ||
492 | private Set discoverLicenses() { | |
493 | Set licenses = new TreeSet(); | |
494 | for (Iterator i = project.getLicenses().iterator(); i.hasNext(); ) { | |
495 | License license = (License) i.next(); | |
496 | String licenseName = ""; | |
497 | if (license.getName() != null) { | |
498 | licenseName = license.getName() + " "; | |
499 | } | |
500 | String licenseUrl = ""; | |
501 | if (license.getUrl() != null) { | |
502 | licenseUrl = license.getUrl(); | |
503 | } | |
504 | boolean recognized = recognizeLicense(licenses, licenseName, licenseUrl); | |
505 | if (!recognized) { | |
506 | System.out.println("License " + licenseName + licenseUrl + " was not recognized, please enter a license name preferably in one of:"); | |
507 | printAvailableLicenses(); | |
508 | System.out.print("> "); | |
509 | String s = readLine(); | |
510 | if (s.length() > 0) { | |
511 | licenses.add(s); | |
512 | } | |
513 | } | |
514 | } | |
515 | LicenseCheckResult licenseResult = new LicenseCheckResult(); | |
516 | DependenciesSolver.executeProcess(new String[]{"/bin/sh", "-c", "licensecheck `find . -type f`"}, | |
517 | licenseResult); | |
518 | for (Iterator i = licenseResult.getLicenses().iterator(); i.hasNext(); ) { | |
519 | String license = (String) i.next(); | |
520 | boolean recognized = recognizeLicense(licenses, license, ""); | |
521 | if (!recognized) { | |
522 | System.out.println("License " + license + " was not recognized, please enter a license name preferably in one of:"); | |
523 | printAvailableLicenses(); | |
524 | System.out.print("> "); | |
525 | String s = readLine(); | |
526 | if (s.length() > 0) { | |
527 | licenses.add(s); | |
528 | } | |
529 | } | |
530 | } | |
531 | ||
532 | if (licenses.isEmpty()) { | |
533 | System.out.println("License was not found, please enter a license name preferably in one of:"); | |
534 | printAvailableLicenses(); | |
535 | System.out.print("> "); | |
536 | String s = readLine(); | |
537 | if (s.length() > 0) { | |
538 | licenses.add(s); | |
539 | } | |
540 | } | |
541 | return licenses; | |
542 | } | |
543 | ||
544 | private void printAvailableLicenses() { | |
545 | System.out.println("Apache-2.0 Artistic BSD FreeBSD ISC CC-BY CC-BY-SA CC-BY-ND CC-BY-NC CC-BY-NC-SA"); | |
546 | System.out.println("CC-BY-NC-ND CC0 CDDL CPL Eiffel Expat GPL-2 GPL-3 LGPL-2 LGPL-2.1 LGPL-3"); | |
547 | System.out.println("GFDL-1.2 GFDL-1.3 GFDL-NIV LPPL MPL Perl PSF QPL W3C-Software ZLIB Zope"); | |
548 | } | |
549 | ||
550 | boolean recognizeLicense(Set licenses, String licenseName, String licenseUrl) { | |
551 | boolean recognized = false; | |
552 | licenseName = licenseName.toLowerCase(); | |
553 | licenseUrl = licenseUrl.toLowerCase(); | |
554 | if (licenseName.indexOf("mit ") >= 0 || licenseUrl.indexOf("mit-license") >= 0) { | |
555 | licenses.add("MIT"); | |
556 | recognized = true; | |
557 | } else if (licenseName.indexOf("bsd ") >= 0 || licenseUrl.indexOf("bsd-license") >= 0) { | |
558 | licenses.add("BSD"); | |
559 | recognized = true; | |
560 | } else if (licenseName.indexOf("artistic ") >= 0 || licenseUrl.indexOf("artistic-license") >= 0) { | |
561 | licenses.add("Artistic"); | |
562 | recognized = true; | |
563 | } else if (licenseName.indexOf("apache ") >= 0 || licenseUrl.indexOf("apache") >= 0) { | |
564 | if (licenseName.indexOf("2.") >= 0 || licenseUrl.indexOf("2.") >= 0) { | |
565 | licenses.add("Apache-2.0"); | |
566 | recognized = true; | |
567 | } else if (licenseName.indexOf("1.0") >= 0 || licenseUrl.indexOf("1.0") >= 0) { | |
568 | licenses.add("Apache-1.0"); | |
569 | recognized = true; | |
570 | } else if (licenseName.indexOf("1.1") >= 0 || licenseUrl.indexOf("1.1") >= 0) { | |
571 | licenses.add("Apache-1.1"); | |
572 | recognized = true; | |
573 | } | |
574 | } else if (licenseName.indexOf("lgpl ") >= 0 || licenseUrl.indexOf("lgpl") >= 0) { | |
575 | if (licenseName.indexOf("2.1") >= 0 || licenseUrl.indexOf("2.1") >= 0) { | |
576 | licenses.add("LGPL-2.1"); | |
577 | recognized = true; | |
578 | } else if (licenseName.indexOf("2") >= 0 || licenseUrl.indexOf("2") >= 0) { | |
579 | licenses.add("LGPL-2"); | |
580 | recognized = true; | |
581 | } else if (licenseName.indexOf("3") >= 0 || licenseUrl.indexOf("3") >= 0) { | |
582 | licenses.add("LGPL-2"); | |
583 | recognized = true; | |
584 | } | |
585 | } else if (licenseName.indexOf("gpl ") >= 0 || licenseUrl.indexOf("gpl") >= 0) { | |
586 | if (licenseName.indexOf("2") >= 0 || licenseUrl.indexOf("2") >= 0) { | |
587 | licenses.add("GPL-2"); | |
588 | recognized = true; | |
589 | } else if (licenseName.indexOf("3") >= 0 || licenseUrl.indexOf("3") >= 0) { | |
590 | licenses.add("GPL-3"); | |
591 | recognized = true; | |
592 | } | |
593 | } | |
594 | return recognized; | |
523 | 595 | } |
524 | 596 | |
525 | 597 | private void generateFile(VelocityContext context, String templateName, File destDir, String fileName) throws Exception { |
574 | 646 | DependenciesSolver.executeProcess(new String[]{"chmod", "+x", file}, new DependenciesSolver.NoOutputHandler()); |
575 | 647 | } |
576 | 648 | |
649 | static class LicenseCheckResult implements DependenciesSolver.OutputHandler { | |
650 | ||
651 | private Set licenses = new TreeSet(); | |
652 | private Set copyrightOwners = new TreeSet(); | |
653 | ||
654 | public void newLine(String line) { | |
655 | if (line.startsWith(".") && line.indexOf(":") > 0) { | |
656 | int col = line.lastIndexOf(":"); | |
657 | String license = line.substring(col + 1).trim(); | |
658 | if (license.indexOf("UNKNOWN") >= 0) { | |
659 | return; | |
660 | } | |
661 | if (license.indexOf("*") >= 0) { | |
662 | license = license.substring(license.lastIndexOf("*") + 1).trim(); | |
663 | } | |
664 | licenses.add(license); | |
665 | } | |
666 | } | |
667 | ||
668 | public Set getLicenses() { | |
669 | return licenses; | |
670 | } | |
671 | ||
672 | public Set getCopyrightOwners() { | |
673 | return copyrightOwners; | |
674 | } | |
675 | } | |
676 | ||
577 | 677 | interface DownloadType { |
578 | 678 | |
579 | 679 | int UNKNOWN = 0; |
0 | /usr/share/java/ant-nodeps.jar | |
1 | #foreach ($jar in $buildjars) | |
2 | /usr/share/java/${jar}.jar | |
3 | #end |
0 | 0 | build.directory=target |
1 | #if($generateJavadoc) | |
1 | 2 | javadoc.dir=target/apidocs |
3 | javadoc.generate=true | |
4 | #end | |
2 | 5 | #if(!$runTests) |
3 | 6 | maven.test.skip=true |
4 | 7 | #end |
0 | <?xml version="1.0"?> | |
1 | ||
2 | <project name="pkg-java" default="build-all" basedir=".."> | |
3 | ||
4 | <property file="debian/build.properties"/> | |
5 | <property name="maven.build" value="/usr/share/maven-ant-helper/maven-build.xml"/> | |
6 | <property file="/usr/share/maven-ant-helper/maven-defaults.properties"/> | |
7 | ||
8 | <macrodef name="clean-module"> | |
9 | <attribute name="dir"/> | |
10 | <sequential> | |
11 | <ant target="clean" antfile="${maven.build}" dir="@{dir}"> | |
12 | <property name="debian.dir" location="debian" /> | |
13 | <property name="project.dir" value="@{dir}" /> | |
14 | </ant> | |
15 | </sequential> | |
16 | </macrodef> | |
17 | ||
18 | #if ($containsJars) | |
19 | <macrodef name="package-module"> | |
20 | <attribute name="dir"/> | |
21 | <sequential> | |
22 | <ant target="package-and-local-install" antfile="${maven.build}" dir="@{dir}"> | |
23 | <property name="debian.dir" location="debian" /> | |
24 | <property name="project.dir" value="@{dir}" /> | |
25 | <property name="keep-cleaned-pom" value="true" /> | |
26 | </ant> | |
27 | </sequential> | |
28 | </macrodef> | |
29 | ||
30 | #end | |
31 | #if ($containsPlugins) | |
32 | <macrodef name="package-plugin-module"> | |
33 | <attribute name="dir"/> | |
34 | <sequential> | |
35 | <ant target="package-and-local-install" antfile="${maven.build}" dir="@{dir}"> | |
36 | <property name="debian.dir" location="debian" /> | |
37 | <property name="project.dir" value="@{dir}" /> | |
38 | <property name="maven.generate.target" value="plugin:descriptor" /> | |
39 | <property name="keep-cleaned-pom" value="true" /> | |
40 | <property name="use-local-repo" value="true" /> | |
41 | </ant> | |
42 | </sequential> | |
43 | </macrodef> | |
44 | ||
45 | #end | |
46 | <target name="clean"> | |
47 | <clean-module dir=""/> | |
48 | #foreach ($module in $collectedProjects) | |
49 | <clean-module dir="${module.artifactId}"/> | |
50 | #end | |
51 | </target> | |
52 | ||
53 | <target name="package"> | |
54 | <package-module dir=""/> | |
55 | #foreach ($module in $collectedProjects) | |
56 | #if ($module.packaging == "maven-plugin") | |
57 | <package-plugin-module dir="${module.artifactId}"/> | |
58 | #else | |
59 | <package-module dir="${module.artifactId}"/> | |
60 | #end | |
61 | #end | |
62 | </target> | |
63 | ||
64 | #if ($generateJavadoc) | |
65 | <target name="javadoc"> | |
66 | <javadoc destdir="${javadoc.dir}"> | |
67 | #foreach ($module in $collectedProjects) | |
68 | <packageset dir="${module.artifactId}/src/main/java/"/> | |
69 | #end | |
70 | </javadoc> | |
71 | </target> | |
72 | ||
73 | <target name="build-all" depends="package, javadoc" /> | |
74 | #else | |
75 | <target name="build-all" depends="package" /> | |
76 | #end | |
77 | ||
78 | </project>⏎ |
17 | 17 | Priority: optional |
18 | 18 | Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org> |
19 | 19 | Uploaders: ${packager} <${packagerEmail}> |
20 | Build-Depends: debhelper (>= 7), cdbs, default-jdk, ant-optional, maven-ant-helper (>> 6.7) | |
21 | Build-Depends-Indep: maven-repo-helper (>= 1.4), | |
22 | #printDependencies($compileDependencies)$space | |
20 | Build-Depends: debhelper (>= 7), default-jdk, maven-repo-helper (>= 1.4)#if ($project.packaging != "pom" || $project.modules.size() > 0), ant-optional, maven-ant-helper (>> 6.7)#end$space | |
21 | #if(!$compileDependencies.isEmpty()) | |
22 | Build-Depends-Indep:#printDependencies($compileDependencies)$space | |
23 | #end | |
23 | 24 | Standards-Version: 3.9.1 |
24 | 25 | Vcs-Svn: svn://svn.debian.org/svn/pkg-java/trunk/${package} |
25 | 26 | Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/trunk/${package} |
29 | 30 | Package: ${binPackage} |
30 | 31 | Architecture: all |
31 | 32 | ## libraries should not depend on runtime - default-jre-headless | java2-runtime-headless, |
32 | Depends: ${dollar}{misc:Depends}, | |
33 | #printDependencies($runtimeDependencies) | |
33 | Depends: ${dollar}{misc:Depends},#printDependencies($runtimeDependencies)$space | |
34 | 34 | #if(!$optionalDependencies.isEmpty()) |
35 | 35 | Recommends: #printDependencies($optionalDependencies) |
36 | #end | |
37 | #if ($generateJavadoc) | |
38 | Suggests: ${binPackage}-doc | |
36 | 39 | #end |
37 | 40 | Description: ${project.Name} |
38 | 41 | #if ($description.isEmpty()) TODO - fill the description |
50 | 53 | Package: ${binPackage}-doc |
51 | 54 | Architecture: all |
52 | 55 | Section: doc |
53 | Depends: ${dollar}{misc:Depends}, ${dollar}{maven:DocDepends} | |
54 | Recommends: ${dollar}{maven:DocOptionalDepends} | |
56 | Depends: ${dollar}{misc:Depends}, $printDependencies($javadocDependencies)$space | |
57 | #if(!$javadocOptionalDependencies.isEmpty()) | |
58 | Recommends: #printDependencies($javadocOptionalDependencies) | |
59 | #end | |
55 | 60 | Suggests: ${binPackage} |
56 | 61 | Description: Documentation for ${project.Name} |
57 | 62 | #if ($description.isEmpty()) TODO - fill the description |
18 | 18 | Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org> |
19 | 19 | Uploaders: ${packager} <${packagerEmail}> |
20 | 20 | Build-Depends: debhelper (>= 7), cdbs, default-jdk, maven-debian-helper (>= 1.3) |
21 | #if(!$compileDependencies.isEmpty()) | |
21 | 22 | Build-Depends-Indep:#printDependencies($compileDependencies)$space |
23 | #end | |
22 | 24 | Standards-Version: 3.9.1 |
23 | 25 | Vcs-Svn: svn://svn.debian.org/svn/pkg-java/trunk/${package} |
24 | 26 | Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/trunk/${package} |
30 | 32 | ## libraries should not depend on runtime - default-jre-headless | java2-runtime-headless, |
31 | 33 | Depends: ${dollar}{misc:Depends}, ${dollar}{maven:Depends} |
32 | 34 | Recommends: ${dollar}{maven:OptionalDepends} |
35 | #if ($generateJavadoc) | |
36 | Suggests: ${binPackage}-doc | |
37 | #end | |
33 | 38 | Description: ${project.Name} |
34 | 39 | #if ($description.isEmpty()) TODO - fill the description |
35 | 40 | #else |
1 | 1 | Format-Specification: http://dep.debian.net/deps/dep5/ |
2 | 2 | Name: ${project.Name} |
3 | 3 | #set ($maintainerHeader = "Maintainer: ") |
4 | #foreach ($developer in $project.Developers) | |
5 | ${maintainerHeader} ${developer.Name} #if (${developer.Email})<${developer.Email}> as developer | |
6 | #set ($maintainerHeader = " ") | |
7 | #else $space | |
4 | #macro(printRoles $roles $defaultRole) | |
5 | #if ($roles.isEmpty())${defaultRole} | |
6 | #else | |
7 | #foreach ($role in $roles) | |
8 | ${role}#if($velocityHasNext), #end | |
8 | 9 | #end |
9 | 10 | #end |
11 | #end | |
12 | #foreach ($developer in $project.Developers) | |
13 | ${maintainerHeader} ${developer.Name}#if (${developer.Email}) <${developer.Email}>#end as #printRoles($developer.Roles, "Developer")$space | |
14 | #set ($maintainerHeader = " ") | |
15 | #end | |
10 | 16 | #foreach ($contributor in $project.Contributors) |
11 | ${maintainerHeader} ${contributor.Name} #if (${contributor.Email})<${contributor.Email}> as contributor | |
12 | #set ($maintainerHeader = " ") | |
13 | #else $space | |
14 | #end | |
17 | ${maintainerHeader} ${contributor.Name}#if (${contributor.Email}) <${contributor.Email}>#end as #printRoles($developer.Roles, "Contributor")$space | |
18 | #set ($maintainerHeader = " ") | |
15 | 19 | #end |
16 | 20 | Source: ${project.Url} |
17 | 21 | |
18 | 22 | Files: * |
19 | 23 | Copyright: ${copyrightYear}, ${copyrightOwner} |
20 | 24 | License: #foreach($license in $licenses)${license}#if($velocityHasNext) or #end#end |
25 | ||
21 | 26 | |
22 | 27 | Files: debian/* |
23 | 28 | Copyright: ${currentYear}, ${packager} <${packagerEmail}> |
26 | 31 | |
27 | 32 | #foreach ($license in $licenses) |
28 | 33 | License: $license |
34 | #set ($knownLicenses = ["Apache-2.0", "BSD", "GFDL-1.2", "GPL-2", "LGPL-2.1", "Artistic", "GPL-3", "LGPL-2", "LGPL-3"]) | |
29 | 35 | #if ($knownLicenses.contains($license)) |
30 | 36 | On Debian GNU/Linux system you can find the complete text of the |
31 | 37 | $license license in '/usr/share/common-licenses/$license' |
32 | 38 | #else |
33 | TODO: include the full license text here | |
39 | TODO: include the full text of the license here | |
34 | 40 | #end |
35 | 41 | |
36 | 42 | #end |
0 | 0 | #!/usr/bin/make -f |
1 | 1 | |
2 | include /usr/share/cdbs/1/rules/debhelper.mk | |
3 | include /usr/share/cdbs/1/class/ant.mk | |
4 | #set ($space=' ') | |
5 | #macro(printJars $jars) | |
6 | #set ($lineLength=0) | |
7 | #foreach ($jar in $jars) | |
8 | #if($lineLength==0)${space}#end${jar}#if($velocityHasNext)${space}#end | |
9 | #set ($lineLength = $lineLength + $jar.length() + 2) | |
10 | #if ($lineLength > 70) | |
11 | ${space}\ | |
12 | #set ($lineLength=0) | |
2 | DEB_SOURCE_PACKAGE := $(shell dpkg-parsechangelog | grep '^Source:' | cut -f 2 -d ' ') | |
3 | DEB_UPSTREAM_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ' | cut -d: -f2- | sed 's/-[^-]*$$//') | |
4 | ||
5 | #if ($project.packaging != "pom" || $project.modules.size() > 0) | |
6 | export JAVA_HOME=/usr/lib/jvm/default-java | |
7 | export CLASSPATH=$(shell for jar in `cat debian/build-classpath`; do if [ -f "$$jar" ]; then echo -n "$${jar}:"; fi; done) | |
8 | #if ($project.packaging == "pom" && $project.modules.size() > 0) | |
9 | export ANT_ARGS=-Dbasedir=$(realpath .) -Dpackage=$(DEB_SOURCE_PACKAGE) -f debian/build.xml | |
10 | #else | |
11 | export ANT_ARGS=-Dbasedir=$(realpath .) -Dpackage=$(DEB_SOURCE_PACKAGE) -f /usr/share/maven-ant-helper/maven-build.xml | |
13 | 12 | #end |
14 | #end | |
15 | #end | |
16 | ||
17 | JAVA_HOME := /usr/lib/jvm/default-java | |
18 | DEB_JARS := ant-nodeps #if (!$buildJars.isEmpty()) #printJars($buildJars)#end $space | |
19 | DEB_ANT_BUILDFILE := /usr/share/maven-ant-helper/maven-build.xml | |
20 | DEB_ANT_ARGS := -Dbasedir=$(realpath .) -Dpackage=$(PACKAGE) | |
21 | 13 | #if ($generateJavadoc) |
22 | 14 | DEB_ANT_BUILD_TARGET := package javadoc |
23 | 15 | API_DOCS := target/docs/api |
24 | 16 | #end |
25 | 17 | |
26 | get-orig-source: | |
27 | uscan --download-version $(DEB_UPSTREAM_VERSION) --force-download --rename | |
28 | ||
29 | binary-post-install/$binPackage:: | |
30 | mh_install -p$binPackage | |
18 | #end | |
19 | %: | |
20 | #if ($project.packaging == "pom" && $project.modules.size() == 0) | |
21 | dh $@ --with maven_repo_helper | |
22 | #else | |
23 | dh $@ --buildsystem=ant --with maven_repo_helper | |
24 | #end | |
31 | 25 | |
32 | 26 | #if ($generateJavadoc) |
33 | 27 | binary-post-install/$binPackage-doc:: |
34 | 28 | dh_install -p$binPackage-doc $(API_DOCS) usr/share/doc/$binPackage |
35 | 29 | |
36 | 30 | #end |
37 | clean:: | |
38 | -mh_clean | |
39 | ||
31 | get-orig-source: | |
32 | uscan --download-version $(DEB_UPSTREAM_VERSION) --force-download --rename |
+25
-18
0 | package org.debian.maven.packager; | |
1 | ||
0 | 2 | /* |
1 | * To change this template, choose Tools | Templates | |
2 | * and open the template in the editor. | |
3 | * Copyright 2009 Ludovic Claude. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
3 | 16 | */ |
4 | ||
5 | package org.debian.maven.packager; | |
6 | 17 | |
7 | 18 | import java.io.File; |
8 | 19 | import java.io.FileReader; |
25 | 36 | import org.debian.maven.repo.ListOfPOMs; |
26 | 37 | import org.debian.maven.repo.Repository; |
27 | 38 | |
28 | /** | |
29 | * | |
30 | * @author ludo | |
31 | */ | |
32 | 39 | public class DependenciesSolverTest extends TestCase { |
33 | 40 | |
34 | 41 | private File testDir = new File("tmp"); |
179 | 186 | } |
180 | 187 | |
181 | 188 | public void testSolveOpenMRSApiDependencies() throws Exception { |
182 | useFile("openmrs/pom.xml", pomFile); | |
189 | useFile("openmrs/api/pom.xml", pomFile); | |
183 | 190 | DependenciesSolver solver = new DependenciesSolver(); |
184 | 191 | solver.setMavenRepo(getFileInClasspath("repository/root.dir").getParentFile()); |
185 | 192 | solver.setOutputDirectory(testDir); |
201 | 208 | assertTrue("Did not expect any issues", solver.getIssues().isEmpty()); |
202 | 209 | |
203 | 210 | solver.setBaseDir(testDir); |
204 | solver.setListOfPoms(new File(testDir, "openmrs.poms")); | |
205 | ||
206 | solver.saveListOfPoms(); | |
207 | solver.saveMavenRules(); | |
208 | solver.saveSubstvars(); | |
209 | ||
210 | assertFileEquals("openmrs.poms", "openmrs.poms"); | |
211 | assertFileEquals("openmrs.substvars", "openmrs.substvars"); | |
212 | assertFileEquals("openmrs.rules", "maven.rules"); | |
211 | solver.setListOfPoms(new File(testDir, "openmrs-api.poms")); | |
212 | ||
213 | solver.saveListOfPoms(); | |
214 | solver.saveMavenRules(); | |
215 | solver.saveSubstvars(); | |
216 | ||
217 | assertFileEquals("openmrs-api.poms", "openmrs-api.poms"); | |
218 | assertFileEquals("openmrs-api.substvars", "openmrs.substvars"); | |
219 | assertFileEquals("openmrs-api.rules", "maven.rules"); | |
213 | 220 | } |
214 | 221 | |
215 | 222 | protected void assertFileEquals(String resource, String fileName) throws Exception { |
+30
-0
0 | package org.debian.maven.packager; | |
1 | ||
2 | import junit.framework.TestCase; | |
3 | ||
4 | import java.util.HashSet; | |
5 | import java.util.Set; | |
6 | ||
7 | /** | |
8 | * Created by IntelliJ IDEA. | |
9 | * User: ludo | |
10 | * Date: Nov 18, 2010 | |
11 | * Time: 11:56:33 PM | |
12 | * To change this template use File | Settings | File Templates. | |
13 | */ | |
14 | public class GenerateDebianFilesMojoTest extends TestCase { | |
15 | ||
16 | public void testRecognizeLicense() throws Exception { | |
17 | GenerateDebianFilesMojo mojo = new GenerateDebianFilesMojo(); | |
18 | ||
19 | Set licenses = new HashSet(); | |
20 | assertTrue(mojo.recognizeLicense(licenses, "Apache (v2.0)", "")); | |
21 | assertEquals("Apache-2.0", licenses.iterator().next()); | |
22 | licenses.clear(); | |
23 | ||
24 | assertTrue(mojo.recognizeLicense(licenses, "", "http://www.apache.org/licenses/LICENSE-2.0")); | |
25 | assertEquals("Apache-2.0", licenses.iterator().next()); | |
26 | licenses.clear(); | |
27 | ||
28 | } | |
29 | } |
0 | 0 | #List of dependencies for libplexus-active-collections-java, generated for use by debian/control |
1 | 1 | #Wed Jun 24 22:57:35 BST 2009 |
2 | maven.CompileDepends=libplexus-maven-plugin-java (>\= 1.3), libsurefire-java | |
2 | maven.CompileDepends=libplexus-maven-plugin-java (>\= 1.3.8), libsurefire-java | |
3 | 3 | maven.Depends=libplexus-component-api-java, libplexus-containers-java |
4 | 4 | maven.OptionalDepends= |
5 | 5 | maven.TestDepends=junit (>\= 3.8.1) |
0 | #List of dependencies for openmrs, generated for use by debian/control | |
1 | #Sun Oct 24 23:51:45 CEST 2010 | |
2 | maven.CompileDepends=libmaven-javadoc-plugin-java | |
3 | maven.Depends=junit4 | |
4 | maven.OptionalDepends= | |
5 | maven.TestDepends=⏎ |
0 | 0 | #!/bin/sh |
1 | ||
2 | # Copyright 2009 Torsten Werner. | |
3 | # | |
4 | # Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | # you may not use this file except in compliance with the License. | |
6 | # You may obtain a copy of the License at | |
7 | # | |
8 | # http://www.apache.org/licenses/LICENSE-2.0 | |
9 | # | |
10 | # Unless required by applicable law or agreed to in writing, software | |
11 | # distributed under the License is distributed on an "AS IS" BASIS, | |
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | # See the License for the specific language governing permissions and | |
14 | # limitations under the License. | |
1 | 15 | |
2 | 16 | set -e |
3 | 17 |