You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by zeeman <ha...@fastmail.us> on 2012/07/02 17:20:24 UTC
Tomee Maven plugin
Hi,
It's a great way to setup new instances of Tomee as it supports <lib> and
understand maven coordinates.
Can it be made to support a Hibernate profile? So that proper Hibernate jars
are added, OpenJPA jars removed. For this list you can find it here
http://openejb.apache.org/tomee-and-hibernate.html
If that's not possible, can it be modified to support removal of jars from
Tomee/lib folder? So I can list jars to be removed from the link above.
Thanks!
--
View this message in context: http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Tomee Maven plugin
Posted by Romain Manni-Bucau <rm...@gmail.com>.
done
https://issues.apache.org/jira/browse/TOMEE-265
- Romain
2012/7/2 Romain Manni-Bucau <rm...@gmail.com>
> thought of it several weeks ago but was waiting for the suggestion,
>
> i'll have a look this evening i guess
>
> - Romain
>
>
>
> 2012/7/2 zeeman <ha...@fastmail.us>
>
>> Hi,
>>
>> It's a great way to setup new instances of Tomee as it supports <lib> and
>> understand maven coordinates.
>>
>> Can it be made to support a Hibernate profile? So that proper Hibernate
>> jars
>> are added, OpenJPA jars removed. For this list you can find it here
>> http://openejb.apache.org/tomee-and-hibernate.html
>>
>> If that's not possible, can it be modified to support removal of jars from
>> Tomee/lib folder? So I can list jars to be removed from the link above.
>>
>> Thanks!
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>
Re: Tomee Maven plugin
Posted by Romain Manni-Bucau <rm...@gmail.com>.
to do it simply provide a custom server.xml defining your Context from
target and keep skipcurrentproject.
- Romain
2012/7/5 zeeman <ha...@fastmail.us>
> Thanks man. Using snapshot url you provided worked.
>
> For skipCurrentProject, I set it to true. If I don't package the war I
> expect Tomee to load the project from code built under target. But that's
> not happening. I looked at source code of maven tomee, it copies the war if
> skipCurrentProject is false.
>
> Is that how it's supposed to work? I did not see any code that loads the
> code from under target into tomee.
>
> In summary, I expect Tomee maven plugin to work like Jetty one. I change
> some code, start the server from plugin my changes would be picked up, I
> don't have to package a war or do anything.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4656030.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Tomee Maven plugin
Posted by zeeman <ha...@fastmail.us>.
Thanks man. Using snapshot url you provided worked.
For skipCurrentProject, I set it to true. If I don't package the war I
expect Tomee to load the project from code built under target. But that's
not happening. I looked at source code of maven tomee, it copies the war if
skipCurrentProject is false.
Is that how it's supposed to work? I did not see any code that loads the
code from under target into tomee.
In summary, I expect Tomee maven plugin to work like Jetty one. I change
some code, start the server from plugin my changes would be picked up, I
don't have to package a war or do anything.
--
View this message in context: http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4656030.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Tomee Maven plugin
Posted by Romain Manni-Bucau <rm...@gmail.com>.
here the right repo:
https://repository.apache.org/content/groups/snapshots/
- Romain
2012/7/4 zeeman <ha...@fastmail.us>
> There is some config issues either in plugin POM or my POM. I tried the
> same
> setup on a different machine got the same thing. So please read this
> carefully. I removed maven repo to start from scratch.
>
> I use this repo https://repository.apache.org for plugins and dependencies
> in my POM.
>
> I use this for plugin declaration:
>
> <groupId>org.apache.openejb.maven</groupId>
> <artifactId>tomee-maven-plugin</artifactId>
> <version>1.0.0-SNAPSHOT</version>
>
> I package the war, I run mvn tomee:run I get the below:
>
> [WARNING] The POM for
> org.apache.openejb.maven:tomee-maven-plugin:jar:1.0.0-SNAPSHOT is missing,
> no dependency information available
> [WARNING] Failed to retrieve plugin descriptor for
> org.apache.openejb.maven:tomee-maven-plugin:1.0.0-SNAPSHOT: Plugin
> org.apache.openej
> b.maven:tomee-maven-plugin:1.0.0-SNAPSHOT or one of its dependencies could
> not be resolved: Failed to read artifact descriptor for org.
> apache.openejb.maven:tomee-maven-plugin:jar:1.0.0-SNAPSHOT
>
> [ERROR] No plugin found for prefix 'tomee' in the current project and in
> the
> plugin groups [org.apache.maven.plugins, org.codehaus.mojo
> ] available from the repositories [local (C:\Users\zeeman\.m2\repository),
> apache-maven-snapshots (https://repository.apache.org), c
> entral (http://repo.maven.apache.org/maven2)] -> [Help 1]
>
> Things would work on your machine because you have the plugin installed
> locally. If you remove your maven repo, I bet you'll get the above error.
> Any ideas?
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4656027.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Tomee Maven plugin
Posted by zeeman <ha...@fastmail.us>.
There is some config issues either in plugin POM or my POM. I tried the same
setup on a different machine got the same thing. So please read this
carefully. I removed maven repo to start from scratch.
I use this repo https://repository.apache.org for plugins and dependencies
in my POM.
I use this for plugin declaration:
<groupId>org.apache.openejb.maven</groupId>
<artifactId>tomee-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
I package the war, I run mvn tomee:run I get the below:
[WARNING] The POM for
org.apache.openejb.maven:tomee-maven-plugin:jar:1.0.0-SNAPSHOT is missing,
no dependency information available
[WARNING] Failed to retrieve plugin descriptor for
org.apache.openejb.maven:tomee-maven-plugin:1.0.0-SNAPSHOT: Plugin
org.apache.openej
b.maven:tomee-maven-plugin:1.0.0-SNAPSHOT or one of its dependencies could
not be resolved: Failed to read artifact descriptor for org.
apache.openejb.maven:tomee-maven-plugin:jar:1.0.0-SNAPSHOT
[ERROR] No plugin found for prefix 'tomee' in the current project and in the
plugin groups [org.apache.maven.plugins, org.codehaus.mojo
] available from the repositories [local (C:\Users\zeeman\.m2\repository),
apache-maven-snapshots (https://repository.apache.org), c
entral (http://repo.maven.apache.org/maven2)] -> [Help 1]
Things would work on your machine because you have the plugin installed
locally. If you remove your maven repo, I bet you'll get the above error.
Any ideas?
--
View this message in context: http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4656027.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Tomee Maven plugin
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Just tried your conf and got:
┌( rmannibucau@box )─( 1.6.0_33 -:- 3.0.4)
└( /tmp/simple-singleton)·> mvn tomee:build -o
[INFO] Scanning for projects...
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building OpenEJB :: Examples :: Simple Singleton 1.1-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- tomee-maven-plugin:1.0.0-SNAPSHOT:build (default-cli) @
simple-singleton ---
[INFO] TomEE was unzipped in '/tmp/simple-singleton/target/apache-tomee'
[INFO] Copied 'org.hibernate:hibernate-entitymanager:4.1.4.Final' in
'/tmp/simple-singleton/target/apache-tomee/lib/hibernate-entitymanager-4.1.4.Final.jar
[INFO] Copied 'org.hibernate:hibernate-core:4.1.4.Final' in
'/tmp/simple-singleton/target/apache-tomee/lib/hibernate-core-4.1.4.Final.jar
[INFO] Deleted
/tmp/simple-singleton/target/apache-tomee/lib/openjpa-2.2.0.jar
[INFO] Deleted /tmp/simple-singleton/target/apache-tomee/lib/asm-3.2.jar
[INFO] Deleted
/tmp/simple-singleton/target/apache-tomee/lib/bval-jsr303-0.4.jar
[INFO] Deleted
/tmp/simple-singleton/target/apache-tomee/lib/bval-core-0.4.jar
[INFO] Deleted /tmp/simple-singleton/target/apache-tomee/lib/serp-1.13.1.jar
[INFO] Deleted
/tmp/simple-singleton/target/apache-tomee/lib/commons-lang-2.6.jar
[INFO] Removed not mandatory default webapps
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 12.979s
[INFO] Finished at: Wed Jul 04 09:21:48 CEST 2012
[INFO] Final Memory: 6M/15M
[INFO]
------------------------------------------------------------------------
┌( rmannibucau @ box )─( 1.6.0_33 -:- 3.0.4)
└( /tmp/simple-singleton)·> ls target/apache-tomee/lib/
catalina-ant.jar gson-2.1.jar
openejb-core-4.1.0-SNAPSHOT.jar openwebbeans-spi-1.1.4.jar
tomee-catalina-1.1.0-SNAPSHOT.jar
catalina-ha.jar hibernate-core-4.1.4.Final.jar
openejb-ejbd-4.1.0-SNAPSHOT.jar openwebbeans-web-1.1.4.jar
tomee-common-1.1.0-SNAPSHOT.jar
catalina.jar
hibernate-entitymanager-4.1.4.Final.jar openejb-hsql-4.1.0-SNAPSHOT.jar
quartz-2.1.3.jar tomee-loader-1.1.0-SNAPSHOT.jar
catalina-tribes.jar howl-1.0.1-1.jar
openejb-http-4.1.0-SNAPSHOT.jar scannotation-1.0.2.jar
tomee-mojarra-1.1.0-SNAPSHOT.jar
commons-beanutils-core-1.8.3.jar hsqldb-2.2.8.jar
openejb-javaagent.jar servlet-api.jar
tomee-myfaces-1.1.0-SNAPSHOT.jar
commons-cli-1.2.jar jansi-1.8.jar
openejb-jee-4.1.0-SNAPSHOT.jar slf4j-api-1.6.4.jar
tomee-webapp-1.1.0-SNAPSHOT.jar
commons-codec-1.4.jar jasper-el.jar
openejb-jpa-integration-4.1.0-SNAPSHOT.jar slf4j-jdk14-1.6.4.jar
wsdl4j-1.6.2.jar
commons-collections-3.2.1.jar jasper.jar
openejb-jsf-4.1.0-SNAPSHOT.jar swizzle-stream-1.6.1.jar
xbean-asm-shaded-3.11.jar
commons-dbcp-1.4.jar javaee-api-6.0-4-tomcat.jar
openejb-jstl-1.2.jar tomcat-api.jar
xbean-bundleutils-3.11.jar
commons-digester-1.8.jar javassist-3.15.0-GA.jar
openejb-loader-4.1.0-SNAPSHOT.jar tomcat-coyote.jar
xbean-finder-shaded-3.11.jar
commons-lang3-3.1.jar jsp-api.jar
openejb-openwebbeans-jsf-1.1.4.jar tomcat-dbcp.jar
xbean-naming-3.11.jar
commons-logging-1.1.1.jar
mbean-annotation-api-4.1.0-SNAPSHOT.jar openejb-server-4.1.0-SNAPSHOT.jar
tomcat-i18n-es.jar xbean-reflect-3.11.jar
commons-pool-1.5.7.jar myfaces-api-2.1.8.jar
openwebbeans-ee-1.1.4.jar tomcat-i18n-fr.jar
ecj-3.7.2.jar myfaces-impl-2.1.8.jar
openwebbeans-ee-common-1.1.4.jar tomcat-i18n-ja.jar
geronimo-javamail_1.4_mail-1.8.2.jar openejb-api-4.1.0-SNAPSHOT.jar
openwebbeans-ejb-1.1.4.jar tomcat-jdbc.jar
geronimo-transaction-3.1.1.jar openejb-client-4.1.0-SNAPSHOT.jar
openwebbeans-impl-1.1.4.jar tomcat-util.jar
- Romain
2012/7/4 zeeman <ha...@fastmail.us>
> I could not debug, I imported the tomee maven plugin project into Eclipse.
> But it had errors. I never worked with Maven plugins.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4655999.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Tomee Maven plugin
Posted by zeeman <ha...@fastmail.us>.
I could not debug, I imported the tomee maven plugin project into Eclipse.
But it had errors. I never worked with Maven plugins.
--
View this message in context: http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4655999.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Tomee Maven plugin
Posted by Romain Manni-Bucau <rm...@gmail.com>.
i'd say a typo
can you debug in AbstractTomEEMojo line 320?
- Romain
2012/7/4 zeeman <ha...@fastmail.us>
> So why do I get error I posted before?
>
> I don't have the project war packaged, I set skipCurrentProject to true. Am
> I missing something? I posted my Tomee maven plugin settings. Thanks!
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4655996.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Tomee Maven plugin
Posted by zeeman <ha...@fastmail.us>.
So why do I get error I posted before?
I don't have the project war packaged, I set skipCurrentProject to true. Am
I missing something? I posted my Tomee maven plugin settings. Thanks!
--
View this message in context: http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4655996.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Tomee Maven plugin
Posted by Romain Manni-Bucau <rm...@gmail.com>.
about the version it is the tomee version we dont have a maven jira for the
moment
however remove works i tested it and you can check it here
http://svn.apache.org/repos/asf/openejb/trunk/openejb/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java
- Romain
2012/7/4 zeeman <ha...@fastmail.us>
> The confusing part was that you set fix version in jira to 1.1.0. But the
> fix
> is on 1.0.0-SNAPSHOT. Anyway, I got the plugin to run but I get this error:
>
> [ERROR] Failed to execute goal
> org.apache.openejb.maven:tomee-maven-plugin:1.0.0-SNAPSHOT:configtest
> (default-cli) on project mytest: Execution default-cli of goal
> org.apache.openejb.maven:tomee-maven-plugin:1.0.0-SNAPSHOT:configtest
> failed: format for librairies sh
> ould be <groupId>:<artifactId>:<version>[:<type>[:<classifier>]] -> [Help
> 1]
>
> I got latest source for plugin, it looks like you're validating libs even
> if
> they're to be removed.
>
> Here is what I used:
>
> <plugin>
> <groupId>org.apache.openejb.maven</groupId>
> <artifactId>tomee-maven-plugin</artifactId>
> <version>1.0.0-SNAPSHOT</version>
> <configuration>
>
> <tomeeVersion>1.1.0-SNAPSHOT</tomeeVersion>
> <libs>
>
> <lib>org.hibernate:hibernate-entitymanager:${hibernate.core.version}</lib>
>
> <lib>org.hibernate:hibernate-core:${hibernate.core.version}</lib>
> <lib>remove:openjpa</lib>
> <lib>remove:asm</lib>
> <lib>remove:bval</lib>
> <lib>remove:serp</lib>
>
> <lib>remove:commons-lang-2.6.jar</lib>
> </libs>
>
> -PS end tags are omitted.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4655994.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Tomee Maven plugin
Posted by zeeman <ha...@fastmail.us>.
The confusing part was that you set fix version in jira to 1.1.0. But the fix
is on 1.0.0-SNAPSHOT. Anyway, I got the plugin to run but I get this error:
[ERROR] Failed to execute goal
org.apache.openejb.maven:tomee-maven-plugin:1.0.0-SNAPSHOT:configtest
(default-cli) on project mytest: Execution default-cli of goal
org.apache.openejb.maven:tomee-maven-plugin:1.0.0-SNAPSHOT:configtest
failed: format for librairies sh
ould be <groupId>:<artifactId>:<version>[:<type>[:<classifier>]] -> [Help 1]
I got latest source for plugin, it looks like you're validating libs even if
they're to be removed.
Here is what I used:
<plugin>
<groupId>org.apache.openejb.maven</groupId>
<artifactId>tomee-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<configuration>
<tomeeVersion>1.1.0-SNAPSHOT</tomeeVersion>
<libs>
<lib>org.hibernate:hibernate-entitymanager:${hibernate.core.version}</lib>
<lib>org.hibernate:hibernate-core:${hibernate.core.version}</lib>
<lib>remove:openjpa</lib>
<lib>remove:asm</lib>
<lib>remove:bval</lib>
<lib>remove:serp</lib>
<lib>remove:commons-lang-2.6.jar</lib>
</libs>
-PS end tags are omitted.
--
View this message in context: http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4655994.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Tomee Maven plugin
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hmm,
Normally of of it is working on trunk.
For remove it is a new lib format.
Normally (well that's sure) the war is not mandatory, there is the tag
skipCurrentProject (a boolean).
- Romain
Le 3 juil. 2012 05:35, "zeeman" <ha...@fastmail.us> a écrit :
> Romain,
>
> I tried Tomee maven plugin with version 1.1.0-SNAPSHOT. Maven could not
> find
> it. I also tried 1.1.0. Neither worked.
>
> I have added under libs tag, is this right?
> <lib>remove:openjpa</lib>
>
> Your jira task comment was not detailed enough to know exactly where to add
> the remove tag :)
>
> Finally, did you get to push the change to get Tomee to not require the war
> be packaged? So it can be run from the project's folder where pom.xml
> resides. Thanks!
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4655985.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Tomee Maven plugin
Posted by zeeman <ha...@fastmail.us>.
Romain,
I tried Tomee maven plugin with version 1.1.0-SNAPSHOT. Maven could not find
it. I also tried 1.1.0. Neither worked.
I have added under libs tag, is this right?
<lib>remove:openjpa</lib>
Your jira task comment was not detailed enough to know exactly where to add
the remove tag :)
Finally, did you get to push the change to get Tomee to not require the war
be packaged? So it can be run from the project's folder where pom.xml
resides. Thanks!
--
View this message in context: http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4655985.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Tomee Maven plugin
Posted by zeeman <ha...@fastmail.us>.
Thanks Romain. I have a new developer's machine to be set up. So if you have
the changes I can test them.
--
View this message in context: http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953p4655984.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Tomee Maven plugin
Posted by Romain Manni-Bucau <rm...@gmail.com>.
thought of it several weeks ago but was waiting for the suggestion,
i'll have a look this evening i guess
- Romain
2012/7/2 zeeman <ha...@fastmail.us>
> Hi,
>
> It's a great way to setup new instances of Tomee as it supports <lib> and
> understand maven coordinates.
>
> Can it be made to support a Hibernate profile? So that proper Hibernate
> jars
> are added, OpenJPA jars removed. For this list you can find it here
> http://openejb.apache.org/tomee-and-hibernate.html
>
> If that's not possible, can it be modified to support removal of jars from
> Tomee/lib folder? So I can list jars to be removed from the link above.
>
> Thanks!
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Tomee-Maven-plugin-tp4655953.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>