dev@glassfish.java.net

RE: building Glassfish 3.1.2 from source using maven

From: peter belbin <pbelbin_at_gmail.com>
Date: Mon, 19 Mar 2012 09:15:08 -0500

Did that,

 

Got the exact same error.

 

Then, thought I'd try a fresh checkout of the source tree, and ran the last
mvn variant again, and, what do you know, it now builds.

 

So: what's the lesson learned from this?

 

a) It would be very helpful to have a full settings.xml published or
downloadable, rather than fragments here and there.

b) Very clear instructions on which mvn version goes with which. You
have a breakout by version as to how to do the checkout. I suggest you
indicate right there, alongside each checkout, which version of maven is to
be used.

c) There are dependencies that I had to hunt around to find. Perhaps
that was a manifestation of the mvn config issues, but, finding a suitable
activation.jar was a hassle. Perhaps you should consider providing a zip
package of dependencies with each version so that these can be taken care of
quickly and with less frustration.

 

Thank you for all the help.

 

It is very much appreciated!

 

All the best,

 

Peter.

 

 

 

 

 

 

 

 

From: Jane Young [mailto:jane.young_at_oracle.com]
Sent: Monday, March 19, 2012 7:10 AM
To: peter belbin
Cc: dev_at_glassfish.java.net; 'Romain Grecourt'
Subject: Re: building Glassfish 3.1.2 from source using maven

 

Hi Peter,

Can you also try with -cpu option to update the plugin dependencies?
The command is "mvn -U -cpu clean install".

Thanks,
Jane


On 3/18/12 11:00 PM, peter belbin wrote:

For grins, I also tried enabling the -e option as suggested, and got this:

 

[ERROR] BUILD ERROR

[INFO]
------------------------------------------------------------------------

[INFO] Failed to configure plugin parameters for:
org.apache.maven.plugins:maven-jar-plugin:2.2

 

 

 

Cause: Cannot find setter nor field in
org.apache.maven.archiver.ManifestConfiguration for 'classpathLayoutType'

[INFO]
------------------------------------------------------------------------

[INFO] Trace

org.apache.maven.lifecycle.LifecycleExecutionException: Error configuring:
org.apache.maven.plugins:maven-jar-plugin. Reason: Unable to parse the
created DOM for plugin configuration

                at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife
cycleExecutor.java:723)

                at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:556)

                at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec
ycleExecutor.java:535)

                at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail
ures(DefaultLifecycleExecutor.java:387)

                at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa
ultLifecycleExecutor.java:348)

                at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle
Executor.java:180)

                at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)

                at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)

                at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)

                at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)

                at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

                at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)

                at
org.codehaus.classworlds.Launcher.launch(Launcher.java:255)

                at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

                at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Caused by: org.apache.maven.plugin.PluginConfigurationException: Error
configuring: org.apache.maven.plugins:maven-jar-plugin. Reason: Unable to
parse the created DOM for plugin configuration

                at
org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPlu
ginManager.java:1363)

                at
org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPlugin
Manager.java:724)

                at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage
r.java:468)

                at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife
cycleExecutor.java:694)

                ... 17 more

Caused by:
org.codehaus.plexus.component.configurator.ComponentConfigurationException:
Cannot find setter nor field in
org.apache.maven.archiver.ManifestConfiguration for 'classpathLayoutType'

                at
org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.<
init>(ComponentValueSetter.java:68)

                at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFi
eldsConverter.processConfiguration(ObjectWithFieldsConverter.java:134)

                at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFi
eldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:90)

                at
org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.c
onfigure(ComponentValueSetter.java:207)

                at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFi
eldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)

                at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFi
eldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:90)

                at
org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.c
onfigure(ComponentValueSetter.java:247)

                at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFi
eldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)

                at
org.codehaus.plexus.component.configurator.BasicComponentConfigurator.config
ureComponent(BasicComponentConfigurator.java:56)

                at
org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPlu
ginManager.java:1357)

                ... 20 more

[INFO]
------------------------------------------------------------------------

[INFO] Total time: 3 minutes 58 seconds

[INFO] Finished at: Mon Mar 19 00:59:14 CDT 2012

[INFO] Final Memory: 246M/494M

[INFO]
------------------------------------------------------------------------

root_at_sol11:/opt/gf312src/3.1.2# <mailto:root_at_sol11:/opt/gf312src/3.1.2>

 

 

 

 

From: Jane Young [mailto:jane.young_at_oracle.com]
Sent: Monday, March 19, 2012 12:46 AM
To: peter belbin
Cc: dev_at_glassfish.java.net; 'Romain Grecourt'
Subject: Re: building Glassfish 3.1.2 from source using maven

 

Hi Peter,

Can you try adding MAVEN_OPTS="-Xmx512m -Xms256m -XX:MaxPermSize=512m" and
rebuild with the command "mvn -U clean install"?

Thanks,
Jane


On 3/18/12 10:39 PM, peter belbin wrote:

Ok, that seems to have improved things a bit. Thank you!

 

But, now, I'm getting, on mvn clean install, the following:

 

[INFO] Building in /opt/gf312src/3.1.2/persistence/cmp/support-ejb

[INFO]
------------------------------------------------------------------------

[INFO] [antlr:generate {execution: default}]

[INFO] Using Antlr grammar:
/opt/gf312src/3.1.2/persistence/cmp/support-ejb/src/main/antlr/EJBQL.g

ANTLR Parser Generator Version 2.7.6 (2005-12-22) 1989-2005

 

[INFO] Using Antlr grammar:
/opt/gf312src/3.1.2/persistence/cmp/support-ejb/src/main/antlr/JDOQLCodeGene
ration.g

ANTLR Parser Generator Version 2.7.6 (2005-12-22) 1989-2005

 

[INFO]
------------------------------------------------------------------------

[ERROR] BUILD ERROR

[INFO]
------------------------------------------------------------------------

[INFO] error perforing antlt.Tool#main

 

Embedded error: PermGen space

[INFO]
------------------------------------------------------------------------

[INFO] For more information, run Maven with the -e switch

[INFO]
------------------------------------------------------------------------

[INFO] Total time: 3 minutes 38 seconds

[INFO] Finished at: Mon Mar 19 00:28:31 CDT 2012

[INFO] Final Memory: 211M/742M

[INFO]
------------------------------------------------------------------------

root_at_sol11:/opt/gf312src/3.1.2# <mailto:root_at_sol11:/opt/gf312src/3.1.2>

 

 

immediately after this, I tried just: mvn install

 

and got this:

 

[INFO] Building Embedded GlassFish Shell

[INFO] task-segment: [install]

[INFO]
------------------------------------------------------------------------

[INFO] [enforcer:enforce {execution: enforce-maven}]

[INFO] [enforcer:enforce {execution: enforce-versions}]

[INFO] [osgiversion:compute-osgi-version {execution: compute-osgi-version}]

[INFO] [gf:echo {execution: echo}]

[INFO]
------------------------------------------------------------------------

[INFO] Building in
/opt/gf312src/3.1.2/extras/embedded/shell/glassfish-embedded-shell

[INFO]
------------------------------------------------------------------------

[INFO] [dependency:build-classpath {execution: generate-classpath-file}]

[INFO] Skipped writing classpath file
'/opt/gf312src/3.1.2/extras/embedded/shell/glassfish-embedded-shell/target/t
mp/classpath.txt'. No changes found.

[INFO] [resources:resources {execution: default-resources}]

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory
/opt/gf312src/3.1.2/extras/embedded/shell/glassfish-embedded-shell/src/main/
resources

[INFO] [compiler:compile {execution: default-compile}]

[INFO] No sources to compile

[INFO] [bundle:manifest {execution: bundle-manifest}]

[WARNING] Ignoring project type jar - supportedProjectTypes = [hk2-jar,
bundle]

[INFO] [resources:testResources {execution: default-testResources}]

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory
/opt/gf312src/3.1.2/extras/embedded/shell/glassfish-embedded-shell/src/test/
resources

[INFO] [compiler:testCompile {execution: default-testCompile}]

[INFO] No sources to compile

[INFO] [surefire:test {execution: default-test}]

[INFO] No tests to run.

[INFO]
------------------------------------------------------------------------

[ERROR] BUILD ERROR

[INFO]
------------------------------------------------------------------------

[INFO] Failed to configure plugin parameters for:
org.apache.maven.plugins:maven-jar-plugin:2.2

 

 

 

Cause: Cannot find setter nor field in
org.apache.maven.archiver.ManifestConfiguration for 'classpathLayoutType'

[INFO]
------------------------------------------------------------------------

[INFO] For more information, run Maven with the -e switch

[INFO]
------------------------------------------------------------------------

[INFO] Total time: 2 minutes 10 seconds

[INFO] Finished at: Mon Mar 19 00:36:58 CDT 2012

[INFO] Final Memory: 178M/742M

[INFO]
------------------------------------------------------------------------

 

 

 

The above is with:

 

MAVEN_OPTS='-Xmx2048m -Xms768m'

 

Please advise.

 

Regards,

Peter.

 

 

 

 

From: Jane Young [mailto:jane.young_at_oracle.com]
Sent: Sunday, March 18, 2012 8:50 PM
To: dev_at_glassfish.java.net
Cc: peter belbin; 'Romain Grecourt'
Subject: Re: building Glassfish 3.1.2 from source using maven

 

Can you change the mirror element to:






<mirror>

    <id>maven-central</id>

    <url>http://repo1.maven.org/maven2/</url>

    <mirrorOf>*,!eclipselink.repository,!netbeans.repository</mirrorOf>

</mirror>


Thanks,
Jane


On 3/18/12 6:26 PM, peter belbin wrote:

I believe I already have that in my setting.xml, which I include here:

 

<settings xmlns= <http://maven.apache.org/SETTINGS/1.1.0>
"http://maven.apache.org/SETTINGS/1.1.0"

  xmlns:xsi= <http://www.w3.org/2001/XMLSchema-instance>
"http://www.w3.org/2001/XMLSchema-instance"

  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0

                      http://maven.apache.org/xsd/settings-1.1.0.xsd">

  <localRepository/>

  <interactiveMode/>

  <usePluginRegistry/>

  <offline/>

  <pluginGroups/>

  <servers/>

<mirrors>

        <mirror>

                <id>maven-central</id>

                <url>http://repo1.maven.org/maven2/</url>

                <mirrorOf>*,!eclipselink.repository</mirrorOf>

        </mirror>

</mirrors>

  <proxies/>

  <profiles>

<profile>

<id>gf-repo</id>

    <repositories>

        <repository>

                <id>maven2-repository.dev.java.net</id>

                <name>Java.net Repository for Maven</name>

                <url>http://download.java.net/maven/2/</url>

                <layout>default</layout>

 
<releases><enabled>true</enabled><updatePolicy>always</updatePolicy></releas
es>

 
<snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snaps
hots>

        </repository>

        <repository>

            <id>eclipselink.repository</id>

            <name>EclipseLink Repo</name>

            <releases>

                <enabled>true</enabled>

<updatePolicy>always</updatePolicy>

            </releases>

            <snapshots>

                <enabled>false</enabled>

            </snapshots>

 
<url>http://download.eclipse.org/rt/eclipselink/maven.repo/</url>

            <layout>default</layout>

        </repository>

        <repository>

            <id>netbeans.repository</id>

            <name>Maven Repo containing NetBeans artifacts</name>

            <releases>

                <enabled>true</enabled>

<updatePolicy>always</updatePolicy>

            </releases>

            <snapshots>

                <enabled>false</enabled>

            </snapshots>

            <url>http://dev.nightlabs.org/maven-repository/repo/</url>

            <layout>default</layout>

        </repository>

    </repositories>

</profile>

  </profiles>

  <activeProfiles>

<activeProfile>gf-repo</activeProfile>

</activeProfiles>

 

 

 

 

From: Jane Young [mailto:jane.young_at_oracle.com]
Sent: Sunday, March 18, 2012 7:38 PM
To: dev_at_glassfish.java.net
Cc: peter belbin; 'Romain Grecourt'
Subject: Re: building Glassfish 3.1.2 from source using maven

 

Looks like it's not finding the netbeans artifacts.
Did you add the following repo in the profile:






 <repository>

            <id>netbeans.repository</id>

            <name>Maven Repo containing NetBeans artifacts</name>

            <releases>

                <enabled>true</enabled>

            </releases>

            <snapshots>

                <enabled>false</enabled>

            </snapshots>

            <url>http://dev.nightlabs.org/maven-repository/repo/
<http://dev.nightlabs.org/maven-repository/repo/%3c/url> </url>

            <layout>default</layout>

        </repository>


Please see:
https://wikis.oracle.com/display/GlassFish/FullBuildInstructions#FullBuildIn
structions-Unabletobuildbecausemaven.glassfish.orgisoffline

Thanks,
Jane


On 3/17/12 4:24 PM, peter belbin wrote:

Ok, so I'm still not there yet, building glassfish 3.1.2.

 

I am using JDK 6u30 with Maven 2.2.1.

 

Please help!

 

Here is what Maven is saying:

 

 

[ERROR] BUILD ERROR

[INFO]
------------------------------------------------------------------------

[INFO] Failed to resolve artifact.

 

Missing:

----------

1) org.netbeans.api:org-netbeans-modules-schema2beans:jar:RELEASE55

 

  Try downloading the file manually from the project website.

 

  Then, install it using the command:

      mvn install:install-file -DgroupId=org.netbeans.api
-DartifactId=org-netbeans-modules-schema2beans -Dversion=RELEASE55
-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.netbeans.api
-DartifactId=org-netbeans-modules-schema2beans -Dversion=RELEASE55
-Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

 

  Path to dependency:

                1)
org.glassfish.main.external:schema2beans-repackaged:jar:3.1.2

                2)
org.netbeans.api:org-netbeans-modules-schema2beans:jar:RELEASE55

 

----------

1 required artifact is missing.

 

for artifact:

  org.glassfish.main.external:schema2beans-repackaged:jar:3.1.2

 

from the specified remote repositories:

  maven-central (http://repo1.maven.org/maven2/),

  eclipselink.repository
(http://download.eclipse.org/rt/eclipselink/maven.repo/)