maven: finally working
maven-generate-javax-inject-named.patch
21 | 21 | +## This script must be run in the source directory (usually src/main/java). | |
22 | 22 | + | |
23 | 23 | +for file in `(cd $1; find -name '*.java')`; do | |
24 | - | + annot=`grep "@Named" $1/$file` | |
24 | + | + annot=`grep "^@Named" $1/$file` | |
25 | 25 | + if [ "$annot" != "" ]; then | |
26 | 26 | + echo $file | sed -e 's|^\./||' -e 's|\.java||' -e 's|/|.|g' | |
27 | 27 | + fi |
more/packages/java.scm
3894 | 3894 | (sha256 | |
3895 | 3895 | (base32 | |
3896 | 3896 | "1wlpn3cfy3d4inxy6g7wxcsa8p7sshn6aldk9y4ia3lb879rd97r")))) | |
3897 | + | (build-system ant-build-system) | |
3897 | 3898 | (arguments | |
3898 | 3899 | `(#:build-target "compile" | |
3899 | 3900 | #:test-target "test" | |
… | |||
3918 | 3919 | (propagated-inputs | |
3919 | 3920 | `(("java-commons-logging" ,java-commons-logging-minimal) | |
3920 | 3921 | ("java-commons-codec" ,java-commons-codec))) | |
3921 | - | (build-system ant-build-system) | |
3922 | 3922 | (home-page "https://hc.apache.org") | |
3923 | 3923 | (synopsis "") | |
3924 | 3924 | (description "") | |
3925 | 3925 | (license license:asl2.0))) | |
3926 | 3926 | ||
3927 | + | (define-public java-httpcomponents-core | |
3928 | + | (package | |
3929 | + | (name "java-httpcomponents-core") | |
3930 | + | (version "4.4.7") | |
3931 | + | (source (origin | |
3932 | + | (method url-fetch) | |
3933 | + | (uri (string-append "mirror://apache/httpcomponents/httpcore/" | |
3934 | + | "source/httpcomponents-core-" version | |
3935 | + | "-src.tar.gz")) | |
3936 | + | (sha256 | |
3937 | + | (base32 | |
3938 | + | "18isvannj51a3lz71qn8wmj9x9l0ryw6x5sc56pp12nxnpnf175a")))) | |
3939 | + | (build-system ant-build-system) | |
3940 | + | (arguments | |
3941 | + | `(#:jar-name "httpcomponents-core.jar" | |
3942 | + | #:source-dir "httpcore/src/main" | |
3943 | + | #:test-dir "httpcore/src/test")) | |
3944 | + | (native-inputs | |
3945 | + | `(("junit" ,java-junit) | |
3946 | + | ("logging" ,java-commons-logging-minimal) | |
3947 | + | ("lang3" ,java-commons-lang3) | |
3948 | + | ("mockito" ,java-mockito-1))) | |
3949 | + | (home-page "https://hc.apache.org/") | |
3950 | + | (synopsis "") | |
3951 | + | (description "") | |
3952 | + | (license license:asl2.0))) | |
3953 | + | ||
3954 | + | (define-public java-httpcomponents-client | |
3955 | + | (package | |
3956 | + | (name "java-httpcomponents-client") | |
3957 | + | (version "4.5.3") | |
3958 | + | (source (origin | |
3959 | + | (method url-fetch) | |
3960 | + | (uri (string-append "mirror://apache/httpcomponents/httpclient/" | |
3961 | + | "source/httpcomponents-client-" version | |
3962 | + | "-src.tar.gz")) | |
3963 | + | (sha256 | |
3964 | + | (base32 | |
3965 | + | "1428399s7qy3cim5wc6f3ks4gl9nf9vkjpfmnlap3jflif7g2pj1")))) | |
3966 | + | (build-system ant-build-system) | |
3967 | + | (arguments | |
3968 | + | `(#:jar-name "httpcomponents-client.jar" | |
3969 | + | #:source-dir "httpclient/src/main" | |
3970 | + | #:test-dir "httpclient/src/test")) | |
3971 | + | (inputs | |
3972 | + | `(("core" ,java-httpcomponents-core) | |
3973 | + | ("codec" ,java-commons-codec) | |
3974 | + | ("logging" ,java-commons-logging-minimal))) | |
3975 | + | (native-inputs | |
3976 | + | `(("junit" ,java-junit) | |
3977 | + | ("mockito" ,java-mockito-1) | |
3978 | + | ("hamcrest" ,java-hamcrest-core))) | |
3979 | + | (home-page "https://hc.apache.org/") | |
3980 | + | (synopsis "") | |
3981 | + | (description "") | |
3982 | + | (license license:asl2.0))) | |
3983 | + | ||
3984 | + | (define-public java-gson | |
3985 | + | (package | |
3986 | + | (name "java-gson") | |
3987 | + | (version "2.8.2") | |
3988 | + | (source (origin | |
3989 | + | (method url-fetch) | |
3990 | + | (uri (string-append "https://github.com/google/gson/archive/" | |
3991 | + | "gson-parent-" version ".tar.gz")) | |
3992 | + | (sha256 | |
3993 | + | (base32 | |
3994 | + | "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9")))) | |
3995 | + | (build-system ant-build-system) | |
3996 | + | (arguments | |
3997 | + | `(#:jar-name "gson.jar" | |
3998 | + | #:source-dir "gson/src/main/java" | |
3999 | + | #:test-dir "gson/src/test")) | |
4000 | + | (native-inputs | |
4001 | + | `(("junit" ,java-junit))) | |
4002 | + | (home-page "") | |
4003 | + | (synopsis "") | |
4004 | + | (description "") | |
4005 | + | (license license:asl2.0))) | |
4006 | + | ||
4007 | + | (define-public java-jsoup | |
4008 | + | (package | |
4009 | + | (name "java-jsoup") | |
4010 | + | (version "1.10.3") | |
4011 | + | (source (origin | |
4012 | + | (method url-fetch) | |
4013 | + | (uri (string-append "https://github.com/jhy/jsoup/archive/jsoup-" | |
4014 | + | version ".tar.gz")) | |
4015 | + | (sha256 | |
4016 | + | (base32 | |
4017 | + | "0xbzw7rjv7s4nz1xk9b2cnin6zkpaldmc3svk71waa7hhjgp0a20")))) | |
4018 | + | (build-system ant-build-system) | |
4019 | + | (arguments | |
4020 | + | `(#:jar-name "jsoup.jar" | |
4021 | + | #:source-dir "src/main/java")) | |
4022 | + | (native-inputs | |
4023 | + | `(("junit" ,java-junit))) | |
4024 | + | (home-page "https://jsoup.org") | |
4025 | + | (synopsis "HTML Parser") | |
4026 | + | (description "jsoup is a Java library for working with real-world HTML. It | |
4027 | + | provides a very convenient API for extracting and manipulating data, using the | |
4028 | + | best of DOM, CSS, and jquery-like methods.") | |
4029 | + | (license license:expat))) | |
4030 | + | ||
3927 | 4031 | (define-public java-commons-pool | |
3928 | 4032 | (package | |
3929 | 4033 | (name "java-commons-pool") | |
… | |||
8407 | 8511 | (name "maven-core-boot") | |
8408 | 8512 | (arguments | |
8409 | 8513 | `(#:jar-name "maven-core.jar" | |
8410 | - | #:source-dir "maven-core/src/main/java" | |
8514 | + | #:source-dir "src/main/java" | |
8411 | 8515 | #:jdk ,icedtea-8 | |
8412 | - | #:test-dir "maven-core/src/test" | |
8413 | 8516 | ;; Tests fail with | |
8414 | 8517 | ;; org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException | |
8415 | 8518 | ;; role: org.apache.maven.repository.RepositorySystem | |
8416 | 8519 | ;; It seems they need maven-compat, which requires maven-core | |
8417 | 8520 | #:tests? #f | |
8521 | + | ;#:fake-maven? #t | |
8522 | + | ;#:version ,(package-version maven) | |
8523 | + | ;#:pom-file "pom.xml" | |
8524 | + | ;#:group-id "org.apache.maven" | |
8525 | + | ;#:artifact-id "maven-core" | |
8418 | 8526 | #:phases | |
8419 | 8527 | (modify-phases %standard-phases | |
8528 | + | (add-before 'configure 'chdir | |
8529 | + | (lambda _ | |
8530 | + | ;; Required for generating components.xml in maven-core | |
8531 | + | (chdir "maven-core"))) | |
8420 | 8532 | (add-before 'build 'copy-resources | |
8421 | 8533 | (lambda _ | |
8422 | 8534 | (mkdir-p "build/classes/") | |
8423 | - | (copy-recursively "maven-core/src/main/resources" "build/classes"))) | |
8535 | + | (copy-recursively "src/main/resources" "build/classes"))) | |
8424 | 8536 | (add-before 'build 'generate-sisu-named | |
8425 | 8537 | (lambda _ | |
8426 | 8538 | (mkdir-p "build/classes/META-INF/sisu") | |
8427 | - | (chmod "sisu.sh" #o755) | |
8428 | - | (zero? (system* "./sisu.sh" "maven-core/src/main/java" | |
8539 | + | (chmod "../sisu.sh" #o755) | |
8540 | + | (zero? (system* "../sisu.sh" "src/main/java" | |
8429 | 8541 | "build/classes/META-INF/sisu/javax.inject.Named")))) | |
8430 | 8542 | (add-before 'build 'generate-models | |
8431 | 8543 | (lambda* (#:key inputs #:allow-other-keys) | |
8432 | 8544 | (define (modello-single-mode file version mode) | |
8433 | 8545 | (zero? (system* "java" | |
8434 | 8546 | "org.codehaus.modello.ModelloCli" | |
8435 | - | file mode "maven-core/src/main/java" version | |
8547 | + | file mode "src/main/java" version | |
8436 | 8548 | "false" "true"))) | |
8437 | - | (let ((file "maven-core/src/main/mdo/toolchains.mdo")) | |
8549 | + | (let ((file "src/main/mdo/toolchains.mdo")) | |
8438 | 8550 | (and | |
8439 | 8551 | (modello-single-mode file "1.1.0" "java") | |
8440 | 8552 | (modello-single-mode file "1.1.0" "xpp3-reader") | |
… | |||
8491 | 8603 | (delete-file "build/classes/META-INF/plexus/components.xml") | |
8492 | 8604 | (and (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes") | |
8493 | 8605 | "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli" | |
8494 | - | "--source" "maven-core/src/main/java" | |
8495 | - | "--output" "build/classes/META-INF/plexus/components.xml" | |
8606 | + | "--source" "build/classes/META-INF/plexus" | |
8607 | + | "--output" "build/classes/META-INF/plexus/components.t.xml" | |
8496 | 8608 | ;; I don't know what these two options do, but if | |
8497 | 8609 | ;; not present, it ends with a NullPointerException. | |
8498 | 8610 | "--classes" "build/classes" | |
8499 | - | "--descriptors" "build/classes/META-INF")) | |
8500 | - | ;; Maven requires role-hint to be "maven", but plexus-sec-dispatcher | |
8501 | - | ;; provides role-hint default. | |
8502 | - | (substitute* "build/classes/META-INF/plexus/components.xml" | |
8503 | - | (("</components>") | |
8504 | - | (string-append | |
8505 | - | " <component>\n" | |
8506 | - | " <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n" | |
8507 | - | " <role-hint>maven</role-hint>\n" | |
8508 | - | " <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n" | |
8509 | - | " <description>Maven Security dispatcher</description>\n" | |
8510 | - | " <requirements>\n" | |
8511 | - | " <requirement>\n" | |
8512 | - | " <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n" | |
8513 | - | " <field-name>_cipher</field-name>\n" | |
8514 | - | " </requirement>\n" | |
8515 | - | " <requirement>\n" | |
8516 | - | " <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n" | |
8517 | - | " <field-name>_decryptors</field-name>\n" | |
8518 | - | " </requirement>\n" | |
8519 | - | " </requirements>\n" | |
8520 | - | " <configuration>\n" | |
8521 | - | " <_configuration-file>~/.m2/settings-security.xml</_configuration-file>\n" | |
8522 | - | " </configuration>\n" | |
8523 | - | " </component>\n" | |
8524 | - | "</components>"))) | |
8525 | - | #t))) | |
8526 | - | (add-after 'generate-metadata 'fix-metadata | |
8527 | - | (lambda _ | |
8528 | - | (substitute* "build/classes/META-INF/plexus/components.xml" | |
8529 | - | (("<field-name>") "<role-hint /><field-name>")) | |
8530 | - | #t)) | |
8531 | - | (add-after 'fix-metadata 'rebuild | |
8611 | + | "--descriptors" "build/classes")) | |
8612 | + | ;; Now we merge all other components from hand-written xml | |
8613 | + | ;; FIXME: This should be taken care of by plexus-component-metadata directly | |
8614 | + | (zero? (system* "sh" "-c" | |
8615 | + | (string-append "(cat build/classes/META-INF/plexus/components.t.xml |" | |
8616 | + | "sed -e 's|</component-set>||' -e 's|</components>||' ; " | |
8617 | + | "cat src/main/resources/META-INF/plexus/artifact-handlers.xml |" | |
8618 | + | " sed -e 's|<?xml.*||' -e 's|<component-set>||' -e 's|<components>||'" | |
8619 | + | " -e 's|</component-set>||' -e 's|</components>||'; " | |
8620 | + | "cat src/main/resources/META-INF/plexus/components.xml |" | |
8621 | + | " sed -e 's|<?xml.*||' -e 's|<component-set>||' -e 's|<components>||'" | |
8622 | + | " -e 's|</component-set>||' -e 's|</components>||'; " | |
8623 | + | "cat src/main/resources/META-INF/plexus/default-bindings.xml |" | |
8624 | + | " sed -e 's|<?xml.*||' -e 's|<component-set>||' -e 's|<components>||' )>" | |
8625 | + | "build/classes/META-INF/plexus/components.xml")))))) | |
8626 | + | ;(substitute* "build/classes/META-INF/plexus/components.xml" | |
8627 | + | ; (("</components>") | |
8628 | + | ; (string-append | |
8629 | + | ; " <component>\n" | |
8630 | + | ; " <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n" | |
8631 | + | ; " <role-hint>maven</role-hint>\n" | |
8632 | + | ; " <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n" | |
8633 | + | ; " <description>Maven Security dispatcher</description>\n" | |
8634 | + | ; " <requirements>\n" | |
8635 | + | ; " <requirement>\n" | |
8636 | + | ; " <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n" | |
8637 | + | ; " <field-name>_cipher</field-name>\n" | |
8638 | + | ; " </requirement>\n" | |
8639 | + | ; " <requirement>\n" | |
8640 | + | ; " <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n" | |
8641 | + | ; " <field-name>_decryptors</field-name>\n" | |
8642 | + | ; " </requirement>\n" | |
8643 | + | ; " </requirements>\n" | |
8644 | + | ; " <configuration>\n" | |
8645 | + | ; " <_configuration-file>~/.m2/settings-security.xml</_configuration-file>\n" | |
8646 | + | ; " </configuration>\n" | |
8647 | + | ; " </component>\n" | |
8648 | + | ; "</components>"))) | |
8649 | + | ;#t))) | |
8650 | + | ;(add-after 'generate-metadata 'fix-metadata | |
8651 | + | ; (lambda _ | |
8652 | + | ; (substitute* "build/classes/META-INF/plexus/components.xml" | |
8653 | + | ; (("<field-name>") "<role-hint /><field-name>")) | |
8654 | + | ; #t)) | |
8655 | + | (add-after 'generate-metadata 'rebuild | |
8532 | 8656 | (lambda _ | |
8533 | 8657 | (zero? (system* "ant" "jar")))))))) | |
8534 | 8658 | (native-inputs | |
… | |||
8641 | 8765 | ("xbean" ,java-geronimo-xbean-reflect) | |
8642 | 8766 | ,@(package-native-inputs maven-wagon-provider-api))))) | |
8643 | 8767 | ||
8768 | + | (define-public maven-wagon-http-shared | |
8769 | + | (package | |
8770 | + | (inherit maven-wagon-provider-api) | |
8771 | + | (name "maven-wagon-http-shared") | |
8772 | + | (arguments | |
8773 | + | `(#:jar-name "maven-wagon-http-shared.jar" | |
8774 | + | #:source-dir "wagon-providers/wagon-http-shared/src/main/java" | |
8775 | + | #:test-dir "wagon-providers/wagon-http-shared/src/test" | |
8776 | + | #:jdk ,icedtea-8 | |
8777 | + | #:phases | |
8778 | + | (modify-phases %standard-phases | |
8779 | + | ;(add-before 'check 'fix-paths | |
8780 | + | ; (lambda _ | |
8781 | + | ; (substitute* "wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/file/FileWagonTest.java" | |
8782 | + | ; (("target") "build")))) | |
8783 | + | (add-after 'build 'generate-metadata | |
8784 | + | (lambda _ | |
8785 | + | (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes") | |
8786 | + | "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli" | |
8787 | + | "--source" "wagon-providers/wagon-http-shared/src/main/java" | |
8788 | + | "--output" "build/classes/META-INF/plexus/components.xml" | |
8789 | + | ;; I don't know what these two options do, but if | |
8790 | + | ;; not present, it ends with a NullPointerException. | |
8791 | + | "--classes" "build/classes" | |
8792 | + | "--descriptors" "build/classes/META-INF")))) | |
8793 | + | (add-after 'generate-metadata 'rebuild | |
8794 | + | (lambda _ | |
8795 | + | (zero? (system* "ant" "jar"))))))) | |
8796 | + | (inputs | |
8797 | + | `(("utils" ,java-plexus-utils) | |
8798 | + | ("httpclient" ,java-httpcomponents-client) | |
8799 | + | ("httpcore" ,java-httpcomponents-core) | |
8800 | + | ("io" ,java-commons-io) | |
8801 | + | ("provider-api" ,maven-wagon-provider-api))) | |
8802 | + | (native-inputs | |
8803 | + | `(("provider-test" ,maven-wagon-provider-test) | |
8804 | + | ("metadata" ,java-plexus-component-metadata) | |
8805 | + | ("annotations" ,java-plexus-component-annotations) | |
8806 | + | ("container" ,java-eclipse-sisu-plexus) | |
8807 | + | ("sisu-inject" ,java-eclipse-sisu-inject) | |
8808 | + | ("classworlds" ,java-plexus-classworlds) | |
8809 | + | ("guava" ,java-guava) | |
8810 | + | ("guice" ,java-guice) | |
8811 | + | ("inject" ,java-javax-inject) | |
8812 | + | ("cglib" ,java-cglib) | |
8813 | + | ("slf4j" ,java-slf4j-api) | |
8814 | + | ("utils" ,java-plexus-utils) | |
8815 | + | ("cli" ,java-plexus-cli) | |
8816 | + | ("plugin-api" ,maven-plugin-api) | |
8817 | + | ("plugin-annotations" ,maven-plugin-annotations) | |
8818 | + | ("core" ,maven-core) | |
8819 | + | ("model" ,maven-model) | |
8820 | + | ("cli" ,java-commons-cli) | |
8821 | + | ("qdox" ,java-qdox) | |
8822 | + | ("jdom2" ,java-jdom2) | |
8823 | + | ("asm" ,java-asm) | |
8824 | + | ("xbean" ,java-geronimo-xbean-reflect) | |
8825 | + | ,@(package-native-inputs maven-wagon-provider-api))))) | |
8826 | + | ||
8827 | + | (define-public maven-wagon-http | |
8828 | + | (package | |
8829 | + | (inherit maven-wagon-provider-api) | |
8830 | + | (name "maven-wagon-http") | |
8831 | + | (arguments | |
8832 | + | `(#:jar-name "maven-wagon-http.jar" | |
8833 | + | #:source-dir "wagon-providers/wagon-http/src/main/java" | |
8834 | + | #:test-dir "wagon-providers/wagon-http/src/test" | |
8835 | + | #:jdk ,icedtea-8 | |
8836 | + | #:phases | |
8837 | + | (modify-phases %standard-phases | |
8838 | + | ;(add-before 'check 'fix-paths | |
8839 | + | ; (lambda _ | |
8840 | + | ; (substitute* "wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/file/FileWagonTest.java" | |
8841 | + | ; (("target") "build")))) | |
8842 | + | (add-after 'build 'generate-metadata | |
8843 | + | (lambda _ | |
8844 | + | (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes") | |
8845 | + | "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli" | |
8846 | + | "--source" "wagon-providers/wagon-http/src/main/java" | |
8847 | + | "--output" "build/classes/META-INF/plexus/components.xml" | |
8848 | + | ;; I don't know what these two options do, but if | |
8849 | + | ;; not present, it ends with a NullPointerException. | |
8850 | + | "--classes" "build/classes" | |
8851 | + | "--descriptors" "build/classes/META-INF")))) | |
8852 | + | (add-after 'generate-metadata 'rebuild | |
8853 | + | (lambda _ | |
8854 | + | (zero? (system* "ant" "jar"))))))) | |
8855 | + | (inputs | |
8856 | + | `(("utils" ,java-plexus-utils) | |
8857 | + | ("httpclient" ,java-httpcomponents-client) | |
8858 | + | ("httpcore" ,java-httpcomponents-core) | |
8859 | + | ("provider-api" ,maven-wagon-provider-api))) | |
8860 | + | (native-inputs | |
8861 | + | `(("provider-test" ,maven-wagon-provider-test) | |
8862 | + | ("metadata" ,java-plexus-component-metadata) | |
8863 | + | ("annotations" ,java-plexus-component-annotations) | |
8864 | + | ("container" ,java-eclipse-sisu-plexus) | |
8865 | + | ("sisu-inject" ,java-eclipse-sisu-inject) | |
8866 | + | ("classworlds" ,java-plexus-classworlds) | |
8867 | + | ("guava" ,java-guava) | |
8868 | + | ("guice" ,java-guice) | |
8869 | + | ("inject" ,java-javax-inject) | |
8870 | + | ("cglib" ,java-cglib) | |
8871 | + | ("slf4j" ,java-slf4j-api) | |
8872 | + | ("utils" ,java-plexus-utils) | |
8873 | + | ("cli" ,java-plexus-cli) | |
8874 | + | ("plugin-api" ,maven-plugin-api) | |
8875 | + | ("plugin-annotations" ,maven-plugin-annotations) | |
8876 | + | ("core" ,maven-core) | |
8877 | + | ("model" ,maven-model) | |
8878 | + | ("cli" ,java-commons-cli) | |
8879 | + | ("qdox" ,java-qdox) | |
8880 | + | ("jdom2" ,java-jdom2) | |
8881 | + | ("asm" ,java-asm) | |
8882 | + | ("xbean" ,java-geronimo-xbean-reflect) | |
8883 | + | ,@(package-native-inputs maven-wagon-provider-api))))) | |
8884 | + | ||
8644 | 8885 | (define-public maven-embedder | |
8645 | 8886 | (package | |
8646 | 8887 | (inherit maven) |