Opened 11 years ago

Closed 5 years ago

#41876 closed defect (fixed)

maven-ant-tasks: Error: JAVA_HOME is not defined correctly.

Reported by: ritchiecai@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: easye, root42, chrstphrchvz (Christopher Chavez)
Port: maven-ant-tasks

Description

Just upgraded to Mavericks, maven-ant-tasks failed while upgrading macport. here is the error:

:debug:build Executing org.macports.build (maven-ant-tasks)
:debug:build Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_maven-ant-tasks/maven-ant-tasks/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.9' HOME='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_maven-ant-tasks/maven-ant-tasks/work/home'
:debug:build Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_maven-ant-tasks/maven-ant-tasks/work/maven-ant-tasks-2.1.3" && mvn package'
:debug:build Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_maven-ant-tasks/maven-ant-tasks/work/maven-ant-tasks-2.1.3" && mvn package
:info:build Error: JAVA_HOME is not defined correctly.
:info:build   We cannot execute /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin/java
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_maven-ant-tasks/maven-ant-tasks/work/maven-ant-tasks-2.1.3" && mvn package
:info:build Exit code: 1

I tried to clean and rebuild, it gives the same error. JAVE_HOME is defined:

echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk/Contents/Home

/usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk/Contents/Home

No idea how macport get /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home as JAVA_HOME, I never defined it anywhere.

Also:

mvn -version

Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500)
Java version: 1.7.0_45
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x" version: "10.9.1" arch: "x86_64" Family: "mac"

Change History (16)

comment:1 Changed 11 years ago by ritchiecai@…

Created a symbolic link to the actual JAVA_HOME, that stopped complaining about incorrect JAVA_HOME path, but it gives a new error:

:debug:build Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_maven-ant-tasks/maven-ant-tasks/work/maven-ant-tasks-2.1.3" && mvn package
:info:build [INFO] Scanning for projects...
:info:build Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-parent/19/maven-parent-19.pom
:info:build [WARNING] Unable to get resource 'org.apache.maven:maven-parent:pom:19' from repository central (http://repo1.maven.org/maven2): Specified destination directory cannot be created: /opt/local/var/macports/home/.m2/repository/org/apache/maven/maven-parent/19
:info:build [INFO] ------------------------------------------------------------------------
:info:build [ERROR] FATAL ERROR
:info:build [INFO] ------------------------------------------------------------------------
:info:build [INFO] Error building POM (may not be this project's POM).
:info:build
:info:build
:info:build Project ID: org.apache.maven:maven-ant-tasks:jar:2.1.3
:info:build
:info:build Reason: Cannot find parent: org.apache.maven:maven-parent for project: org.apache.maven:maven-ant-tasks:jar:2.1.3 for project org.apache.maven:maven-ant-tasks:jar:2.1.3
:info:build
:info:build
:info:build [INFO] ------------------------------------------------------------------------
:info:build [INFO] Trace
:info:build org.apache.maven.reactor.MavenExecutionException: Cannot find parent: org.apache.maven:maven-parent for project: org.apache.maven:maven-ant-tasks:jar:2.1.3 for project org.apache.maven:maven-ant-tasks:jar:2.1.3
:info:build     at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)
:info:build     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:272)
:info:build     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
:info:build     at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
:info:build     at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
:info:build     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
:info:build     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
:info:build     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
:info:build     at java.lang.reflect.Method.invoke(Method.java:606)
:info:build     at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
:info:build     at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
:info:build     at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
:info:build     at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
:info:build Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: org.apache.maven:maven-parent for project: org.apache.maven:maven-ant-tasks:jar:2.1.3 for project org.apache.maven:maven-ant-tasks:jar:2.1.3
:info:build     at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1396)
:info:build     at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
:info:build     at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:508)
:info:build     at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
:info:build     at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:604)
:info:build     at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:487)
:info:build     at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
:info:build     ... 12 more
:info:build Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.apache.maven:maven-parent' not found in repository: Unable to download the artifact from any repository
:info:build
:info:build   org.apache.maven:maven-parent:pom:19
:info:build
:info:build from the specified remote repositories:
:info:build   central (http://repo1.maven.org/maven2)
:info:build
:info:build  for project org.apache.maven:maven-parent
:info:build     at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:605)
:info:build     at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1392)
:info:build     ... 18 more
:info:build Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository
:info:build
:info:build   org.apache.maven:maven-parent:pom:19
:info:build
:info:build from the specified remote repositories:
:info:build   central (http://repo1.maven.org/maven2)
:info:build
:info:build
:info:build     at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)
:info:build     at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
:info:build     at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
:info:build     ... 19 more
:info:build Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
:info:build     at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:404)
:info:build     at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
:info:build     ... 21 more
:info:build [INFO] ------------------------------------------------------------------------
:info:build [INFO] Total time: < 1 second
:info:build [INFO] Finished at: Sat Dec 21 20:57:11 CST 2013
:info:build [INFO] Final Memory: 5M/123M
:info:build [INFO] ------------------------------------------------------------------------
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_maven-ant-tasks/maven-ant-tasks/work/maven-ant-tasks-2.1.3" && mvn package
:info:build Exit code: 1

comment:2 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: maven-ant-tasks JAVA_HOME removed
Owner: changed from macports-tickets@… to ieure@…

comment:3 Changed 11 years ago by ritchiecai@…

Correction: It's for version 2.2.1 not 2.1.3

comment:4 Changed 11 years ago by larryv (Lawrence Velázquez)

Version: 2.1.32.2.1

comment:5 Changed 11 years ago by conradwt (Conrad Taylor)

Is there a patch which corrects this issue today because I'm seeing the same issue when I attempt to install the Leiningen port?

comment:6 in reply to:  5 Changed 11 years ago by ritchiecai@…

No, not that I know of. But if you want to install leiningen, just use the leiningen script , instead of using macport. Replying to conradwt@…:

Is there a patch which corrects this issue today because I'm seeing the same issue when I attempt to install the Leiningen port?

comment:7 Changed 11 years ago by aloklal99@…

2.2.1_3 is the version of maven2. The version of devel/maven-ant-tasks itself is 2.1.3

comment:8 Changed 10 years ago by chunfengd@…

I solved this after installing Apple's java: http://support.apple.com/kb/DL1572

comment:9 Changed 10 years ago by aoeumacports@…

Bump. Installing Apple's Java (1.6 rather than 1.8) is not a very nice fix. Is this port not being maintained? (sorry to be curt.)

comment:10 Changed 10 years ago by mf2k (Frank Schima)

Apparently not. See #47616.

comment:11 Changed 10 years ago by IvoClarysse (Ivo Clarysse)

Adding 'PortGroup java 1.0' to the maven-ant-tasks Portfile fixes the JAVA_HOME issue at hand (also with Java 1.8).

But then the build still fails later on with 'Specified destination directory cannot be created: /opt/local/var/macports/home/.m2/repository/org/apache/maven/maven-parent/19'

comment:12 Changed 9 years ago by easye

Cc: easieste@… added

Cc Me!

comment:13 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from ieure@… to macports-tickets@…

comment:14 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: arne.schmitz@… added
Summary: maven-ant-tasks cannot find JAVA_HOME correctlymaven-ant-tasks: Error: JAVA_HOME is not defined correctly.

Has duplicate #48851.

comment:15 Changed 5 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:16 Changed 5 years ago by chrstphrchvz (Christopher Chavez)

Resolution: fixed
Status: newclosed

In 493ec90efd3be0db81ca988968486eecb5b58fdd/macports-ports (master):

maven-ant-tasks: delete port

Upstream project is no longer maintained. Port has build failures,
and depends on maven2 which is EOL. No dependents.

Closes: #41876
Closes: #50181

Note: See TracTickets for help on using tickets.