From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRy8m-0006Xc-K3 for guix-patches@gnu.org; Sun, 10 Jun 2018 07:04:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRy8l-0002aZ-C9 for guix-patches@gnu.org; Sun, 10 Jun 2018 07:04:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:33963) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRy8l-0002a9-4f for guix-patches@gnu.org; Sun, 10 Jun 2018 07:04:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fRy8k-0005FY-M4 for guix-patches@gnu.org; Sun, 10 Jun 2018 07:04:06 -0400 Subject: [bug#31774] [PATCH 12/22] gnu: Add maven-core. Resent-Message-ID: From: Julien Lepiller Date: Sun, 10 Jun 2018 13:03:09 +0200 Message-Id: <20180610110319.24043-12-julien@lepiller.eu> In-Reply-To: <20180610110319.24043-1-julien@lepiller.eu> References: <20180610130104.2b154715@lepiller.eu> <20180610110319.24043-1-julien@lepiller.eu> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 31774@debbugs.gnu.org * gnu/packages/maven.scm (maven-core): New variable. --- gnu/packages/maven.scm | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm index dff5bd3e4..2fb98295e 100644 --- a/gnu/packages/maven.scm +++ b/gnu/packages/maven.scm @@ -752,3 +752,64 @@ so really just plain objects."))) ("java-junit" ,java-junit) ("java-mockito-1" ,java-mockito-1) ("java-commons-jxpath" ,java-commons-jxpath))))) + +(define-public maven-core + (package + (inherit maven-core-bootstrap) + (arguments + (substitute-keyword-arguments (package-arguments maven-core-bootstrap) + ((#:phases phases) + `(modify-phases ,phases + (add-before 'build 'modify-metainf + (lambda _ + (substitute* "build.xml" + (("message=\"\"") "message=\"Implementation-Version: 3.5.3\n\"")) + #t)) + (add-before 'build 'add-maven-files + (lambda _ + (mkdir-p "build/classes/META-INF/maven/org.apache.maven/maven-core") + (copy-file "pom.xml" + "build/classes/META-INF/maven/org.apache.maven/maven-core/pom.xml") + (with-output-to-file "build/classes/META-INF/maven/org.apache.maven/maven-core/pom.properties" + (lambda _ + (format #t "version=~a~% +groupId=org.apache.maven~% +artifactId=maven-core" ,(package-version maven-core-bootstrap)))) + #t)) + (add-after 'build 'generate-metadata + (lambda _ + (delete-file "build/classes/META-INF/plexus/components.xml") + (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes") + "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli" + "--source" "build/classes/META-INF/plexus" + "--output" "build/classes/META-INF/plexus/components.t.xml" + "--classes" "build/classes" + "--descriptors" "build/classes") + ;; Now we merge all other components from hand-written xml + ;; FIXME: This should be taken care of by plexus-component-metadata directly + (invoke "sh" "-c" + (string-append + "(cat build/classes/META-INF/plexus/components.t.xml |" + "sed -e 's|||' -e 's|||' ; " + "cat src/main/resources/META-INF/plexus/artifact-handlers.xml |" + " sed -e 's|||' -e 's|||'" + " -e 's|||' -e 's|||'; " + "cat src/main/resources/META-INF/plexus/components.xml |" + " sed -e 's|||' -e 's|||'" + " -e 's|||' -e 's|||'; " + "cat src/main/resources/META-INF/plexus/default-bindings.xml |" + " sed -e 's|||' -e 's|||' )>" + "build/classes/META-INF/plexus/components.xml")) + #t)) + (add-after 'generate-metadata 'rebuild + (lambda _ + (invoke "ant" "jar") + #t)))))) + (native-inputs + `(("java-plexus-component-metadata" ,java-plexus-component-metadata) + ("java-commons-cli" ,java-commons-cli) + ("java-plexus-cli" ,java-plexus-cli) + ("java-jdom2" ,java-jdom2) + ("java-qdox" ,java-qdox) + ("maven-core-boot" ,maven-core-bootstrap) + ,@(package-native-inputs maven-core-bootstrap))))) -- 2.17.1