Maven2 build: Embedded error (FAQ?)

View: New views
5 Messages — Rating Filter:   Alert me  

Maven2 build: Embedded error (FAQ?)

by Nick Fedchik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello, Jetspeed users!
I'm new in Jetspeed2, just try to build and deploy Jetspeed-2 to my Tomcat 5.5
installation using Maven-2.
Tomcat 5.5: /opt/tomcat
My Jetspeed: /opt/jetspeed-maven
Maven version: 2.0.9
Java version: 1.6.0_03
OS name: "linux" version: "2.6.22-15-server" arch: "i386" Family: "unix"

I change my settings.xml for Maven 2 and add records that require for
Jetspeed.
As wrote on
http://portals.apache.org/jetspeed-2/maven-2-custom.html
I do
$ cd /opt/jetspeed-maven
$ mvn archetype:create -DarchetypeGroupId=org.apache.portals.jetspeed-2 \
-DarchetypeArtifactId=portal-archetype -DarchetypeVersion=2.1.3 \
-DgroupId=myportalgroup -DartifactId=myportal -Dversion=1.0
...
[INFO] OldArchetype created in dir: /opt/jetspeed-maven/myportal
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
...
Next, as explained on
http://portals.apache.org/tutorials/jetspeed-2/build-commands.html
I run
$ cd myportal
$ mvn
...
embedded-database-hsql:
   [delete] Deleting directory /opt/tomcat/webapps/myportal
Downloading: myportalgroup/myportal-portal/1.0/myportal-portal-1.0.pom
Downloading: myportalgroup/myportal-portal/1.0/myportal-portal-1.0.war
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing ant tasks
Embedded error: The following error occurred while executing this line:
/opt/jetspeed-maven/myportal/app-servers/build.xml:90: The following error
occurred while executing this line:
/opt/jetspeed-maven/myportal/app-servers/build.xml:146: The following error
occurred while executing this line:
/opt/jetspeed-maven/myportal/app-servers/tomcat-build.xml:102:
java.lang.ClassCastException:
org.apache.maven.usability.MojoExecutionExceptionDiagnoser cannot be cast to
org.apache.maven.usability.diagnostics.ErrorDiagnoser
...

If i execute
$ mvn -P tomcat
the errors are same
...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing ant tasks

Embedded error: The following error occurred while executing this line:
/opt/jetspeed-maven/myportal/etc/build.xml:300: The following error occurred
while executing this line:
/opt/jetspeed-maven/myportal/etc/build.xml:305: The following error occurred
while executing this line:
/opt/jetspeed-maven/myportal/etc/build.xml:505: java.lang.ClassCastException:
org.apache.maven.usability.MojoExecutionExceptionDiagnoser cannot be cast to
org.apache.maven.usability.diagnostics.ErrorDiagnose

What do I do incorrectly?
Is it a well-known bug? or my configuration problem?



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@...
For additional commands, e-mail: jetspeed-user-help@...


Re: Maven2 build: Embedded error (FAQ?)

by Niels van Kampenhout :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Nick Fedchik wrote:
> What do I do incorrectly?
> Is it a well-known bug? or my configuration problem?

This looks like a Maven error obfuscating the real problem. Check that
you have a 'settings.xml' in your '/home/<username>/.m2' directory, and
that it contains all the required settings for Jetspeed 2. There is a
'jetspeed-2-resources.zip' [1] that comes with the Maven 2 tutorial you
are following. It contains some sample 'settings.xml' files in the
'maven' subdirectory that are nice and clean, and easier to understand
than the 'official' sample [2].

Hope this helps,

Niels

[1] http://portals.apache.org/tutorials/resources/jetspeed-2-resources.zip
[2]
http://svn.apache.org/repos/asf/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3/settings.xml.sample



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@...
For additional commands, e-mail: jetspeed-user-help@...


Re: Maven2 build: Permissions (FAQ?)

by Nick Fedchik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you, Niels.
Your settings.xml more clean for newbies and for first experiments with
Jetspeed2.

I guess than the problem source is a file permissions.
My tomcat run as 'nobody' user in 'devel' group.
And first time I build J2 as 'nobody' user using 'sudo'.
Dont know how to solve the problem still  using 'sudo'.
Then I build it as my real user ('nick' f.e.), successfully.
Next problem is a permissions.
Users 'nobody' and 'nick' are members of 'devel' group.
/opt/tomcat has the 'devel' Group ID.
I run 'mvn -P tomcat' as user 'nick', but I change group ID
of ~/jetspeed/myportal dir to 'devel'
As result, permissions of portal war is:
-rw-r--r--  1 nick    devel 15869714 2008-10-02 13:35 myportal.war
and same for deployed files
so I got a problems when portal app (tomcat as 'nobody:devel') write to
/opt/tomcat/webapps/myportal/logs
which is 'drwxr-xr-x 9 fnm devel'

Now I'll try to play with 'umask'.
Is it any other solutions?
(Of course I see one - same user id for tomcat and developers)

В сообщении от Wednesday 01 October 2008 20:58:17 Niels van Kampenhout
написал(а):

> Nick Fedchik wrote:
> > What do I do incorrectly?
> > Is it a well-known bug? or my configuration problem?
>
> This looks like a Maven error obfuscating the real problem. Check that
> you have a 'settings.xml' in your '/home/<username>/.m2' directory, and
> that it contains all the required settings for Jetspeed 2. There is a
> 'jetspeed-2-resources.zip' [1] that comes with the Maven 2 tutorial you
> are following. It contains some sample 'settings.xml' files in the
> 'maven' subdirectory that are nice and clean, and easier to understand
> than the 'official' sample [2].



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@...
For additional commands, e-mail: jetspeed-user-help@...


Re: Maven2 build: Permissions (FAQ?)

by Niels van Kampenhout :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Nick Fedchik wrote:

> I guess than the problem source is a file permissions.
> My tomcat run as 'nobody' user in 'devel' group.
> And first time I build J2 as 'nobody' user using 'sudo'.
> Dont know how to solve the problem still  using 'sudo'.
> Then I build it as my real user ('nick' f.e.), successfully.
> Next problem is a permissions.
> Users 'nobody' and 'nick' are members of 'devel' group.
> /opt/tomcat has the 'devel' Group ID.
> I run 'mvn -P tomcat' as user 'nick', but I change group ID
> of ~/jetspeed/myportal dir to 'devel'
> As result, permissions of portal war is:
> -rw-r--r--  1 nick    devel 15869714 2008-10-02 13:35 myportal.war
> and same for deployed files
> so I got a problems when portal app (tomcat as 'nobody:devel') write to
> /opt/tomcat/webapps/myportal/logs
> which is 'drwxr-xr-x 9 fnm devel'
>
> Now I'll try to play with 'umask'.
> Is it any other solutions?
> (Of course I see one - same user id for tomcat and developers)

I recommend using a clean Tomcat installation that you have full control
over. I usually have a Tomcat for every portal project, e.g.

/home/niels/dev/myproject/portal -> the jetspeed portal
/home/niels/dev/myproject/tomcat -> dedicated tomcat installation

It is just a matter of downloading and unzipping tomcat 5.5 and you are
good to go. You can have as many tomcats as you like, as long as you
don't run them at the same time at the same port...

Don't forget to adapt you settings.xml for your new tomcat location.

HTH,

Niels



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@...
For additional commands, e-mail: jetspeed-user-help@...


Jetspeed, Tomcat and Unix Group Permissions

by Nick Fedchik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I recommend using a clean Tomcat installation that you have full control
> over. I usually have a Tomcat for every portal project, e.g.
Yep, I use clean Tomcat installation
/opt/tomcat is a symlink to /opt/apache-tomcat-5.5.27

> /home/niels/dev/myproject/portal -> the jetspeed portal
> /home/niels/dev/myproject/tomcat -> dedicated tomcat installation
> It is just a matter of downloading and unzipping tomcat 5.5 and you are
> good to go. You can have as many tomcats as you like, as long as you
> don't run them at the same time at the same port...
Sure!
The only one difference is that I use different users for tomcat (nobody)
and for code builders (own uid), but they all in same group (devel).
And in my case, another one developer can build and deploy  J2 code to the
same tomcat (f.e. to fix a bug or to add new feature/component).
It's also need to change gid for /opt/tomcat (chmod -R g+w *)

> Don't forget to adapt you settings.xml for your new tomcat location.
Thanks, I'll keep in mind

BTW I build Jetspeed successfully using umask to set write permissions for a
group.

My build script:

echo CLEAN THE SOURCE
umask ug+rw
mvn -e clean >deploy-clean.log
echo BEGIN TEST
mvn -e -P test >deploy-test.log
echo BEGIN TOMCAT DEPLOY
mvn -e -P tomcat,full >deploy-tomcat.log
echo COMPLETE

HTH.
Now I try to setup Continuous integration tool.

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@...
For additional commands, e-mail: jetspeed-user-help@...

LightInTheBox - Buy quality products at wholesale price!