dev@glassfish.java.net

RE: Having trouble building Glassfish 3.1.2 from source

From: Bergquist, Brett <BBergquist_at_canoga.com>
Date: Mon, 13 Aug 2012 04:15:34 -0700

Thanks, I would not have figured that out from the documentation myself. It appeared to me those instructions are for "if" Unable to build because maven.glassfish.org is offline, not general purpose instructions to be followed at all times right now.

I appreciate the help.

Brett
________________________________________
From: Romain Grecourt [romain.grecourt_at_oracle.com]
Sent: Monday, August 13, 2012 5:27 AM
To: dev_at_glassfish.java.net
Subject: Re: Having trouble building Glassfish 3.1.2 from source

On 8/13/12 11:10 AM, Romain Grecourt wrote:
Hi,

Please refer to the following documentation: https://wikis.oracle.com/display/GlassFish/FullBuildInstructions#FullBuildInstructions-Unabletobuildbecausemaven.glassfish.orgisoffline
You have to create a profile in your pom.xml in order to configure a repository for eclipselink.
My mistake, not in your pom.xml, but in your settings.xml

Thanks,
Romain

On 8/12/12 2:19 AM, Bergquist, Brett wrote:
I am trying to build Glassfish 3.1.2 and am having a problem. I have Maven 2.2.1 installed:

MacbookPro ~/Development/glassfish/3.1.2 $ mvn --version
Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
Java version: 1.6.0_33
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.8" arch: "x86_64" Family: "mac"
MacbookPro ~/Development/glassfish/3.1.2 $
MacbookPro ~/Development/glassfish/3.1.2 $


Here is my settings.xml:

  <mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url<http://my.repository.com/repo/path%3c/url>>
    </mirror>
     -->
    <mirror>
      <id>maven-central</id>
      <url>http://repo1.maven.org/maven2/</url<http://repo1.maven.org/maven2/%3c/url>>
      <mirrorOf>*,!eclipselink.repository</mirrorOf>
    </mirror>
  </mirrors>

Here is the last of the output when running "mvn install"

[INFO] ------------------------------------------------------------------------
[INFO] Building Deployment Object Library
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2//org/eclipse/persistence/javax.persistence/2.0.4.v201112200901/javax.persistence-2.0.4.v201112200901.pom<http://repo1.maven.org/maven2/org/eclipse/persistence/javax.persistence/2.0.4.v201112200901/javax.persistence-2.0.4.v201112200901.pom>
[INFO] Unable to find resource 'org.eclipse.persistence:javax.persistence:pom:2.0.4.v201112200901' in repository glassfish-repo-archive (http://maven.glassfish.org/content/groups/glassfish)
Downloading: http://repo1.maven.org/maven2//org/eclipse/persistence/javax.persistence/2.0.4.v201112200901/javax.persistence-2.0.4.v201112200901.pom<http://repo1.maven.org/maven2/org/eclipse/persistence/javax.persistence/2.0.4.v201112200901/javax.persistence-2.0.4.v201112200901.pom>
[INFO] Unable to find resource 'org.eclipse.persistence:javax.persistence:pom:2.0.4.v201112200901' in repository central (http://repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2//org/eclipse/persistence/javax.persistence/2.0.4.v201112200901/javax.persistence-2.0.4.v201112200901.jar<http://repo1.maven.org/maven2/org/eclipse/persistence/javax.persistence/2.0.4.v201112200901/javax.persistence-2.0.4.v201112200901.jar>
[INFO] Unable to find resource 'org.eclipse.persistence:javax.persistence:jar:2.0.4.v201112200901' in repository glassfish-repo-archive (http://maven.glassfish.org/content/groups/glassfish)
Downloading: http://repo1.maven.org/maven2//org/eclipse/persistence/javax.persistence/2.0.4.v201112200901/javax.persistence-2.0.4.v201112200901.jar<http://repo1.maven.org/maven2/org/eclipse/persistence/javax.persistence/2.0.4.v201112200901/javax.persistence-2.0.4.v201112200901.jar>
[INFO] Unable to find resource 'org.eclipse.persistence:javax.persistence:jar:2.0.4.v201112200901' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) org.eclipse.persistence:javax.persistence:jar:2.0.4.v201112200901

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.eclipse.persistence -DartifactId=javax.persistence -Dversion=2.0.4.v201112200901 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.eclipse.persistence -DartifactId=javax.persistence -Dversion=2.0.4.v201112200901 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
            1) org.glassfish.main.deployment:dol:hk2-jar:3.1.2
            2) org.eclipse.persistence:javax.persistence:jar:2.0.4.v201112200901

----------
1 required artifact is missing.

for artifact:
  org.glassfish.main.deployment:dol:hk2-jar:3.1.2

from the specified remote repositories:
  maven-central (http://repo1.maven.org/maven2/)



[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50 seconds
[INFO] Finished at: Sat Aug 11 20:13:13 EDT 2012
[INFO] Final Memory: 143M/269M
[INFO] ------------------------------------------------------------------------
MacbookPro ~/Development/glassfish/3.1.2 $

Any help will be greatly appreciated. I also tried with Glassfish 3.1.1 and ran into similar problems so I figured I would go with the latest release and try again.