Plugin execution not covered by lifecycle configuration

1,518 views
Skip to first unread message

Kurniawan Atharwa

unread,
Sep 19, 2012, 5:56:41 AM9/19/12
to activejd...@googlegroups.com
Hi all

I configure my pom.xml as follows:

<modelVersion>4.0.0</modelVersion>
<groupId>ngammu</groupId>
<artifactId>ngammu</artifactId>
<version>0.0.1</version>

<build>
<plugins>
<plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <fork>true</fork>
                    <meminitial>128m</meminitial>
                    <maxmem>512m</maxmem>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.javalite</groupId>
                <artifactId>activejdbc-instrumentation</artifactId>
                <version>1.4.3</version>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>instrument</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
</plugins>
</build>
<dependencies>
<dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.20</version>
</dependency>
<dependency>
<groupId>org.javalite</groupId>
<artifactId>activejdbc</artifactId>
<version>1.4.3</version>
<exclusions>
<exclusion>
<groupId>opensymphony</groupId>
<artifactId>oscache</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.4</version>
</dependency>
</dependencies>
</project>

but eclipse shows error Plugin execution not covered by lifecycle configuration: : org.javalite:activejdbc-instrumentation:1.4.3:instrument (execution: default, 
 phase: process-classes).

Anyone know how to fix this?

Thank you.

Josh Kamau

unread,
Sep 19, 2012, 6:05:23 AM9/19/12
to activejd...@googlegroups.com
I have the same problem in Eclipse ... .but works perfectly on Netbeans and intelliJ

Havent known how to resolve it though... 

Josh.

igor

unread,
Sep 19, 2012, 11:07:10 AM9/19/12
to activejd...@googlegroups.com
This is no a problem with ActiveJDBC, rather with the M2E plugin. Quick googling revealed this URL:
Read two top answers, and you will see that this plugin for whatever reason is not finding goal "process-classes" interesting. In other words, M2E plugin adds additional logic to Maven!
Anyway, I personally use IntelliJ, and never encountered this problem, but the solution can be found on that page 

thanks
Igor

Robert

unread,
Sep 19, 2012, 4:25:53 PM9/19/12
to activejd...@googlegroups.com
I had a similar problem with Eclipse and M2E.  I resolved it by inserting the following into the pom.xml file:

              <pluginManagement>
                        <plugins>
                                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                                <plugin>
                                        <groupId>org.eclipse.m2e</groupId>
                                        <artifactId>lifecycle-mapping</artifactId>
                                        <version>1.0.0</version>
                                        <configuration>
                                                <lifecycleMappingMetadata>
                                                        <pluginExecutions>
                                                                <pluginExecution>
                                                                        <pluginExecutionFilter>
                                                                                <groupId>org.javalite</groupId>
                                                                                <artifactId>
                                                                                        activejdbc-instrumentation
                                                                                </artifactId>
                                                                                <versionRange>
                                                                                        [1.4.3,)
                                                                                </versionRange>
                                                                                <goals>
                                                                                        <goal>instrument</goal>
                                                                                </goals>
                                                                        </pluginExecutionFilter>
                                                                        <action>
                                                                                <ignore></ignore>
                                                                        </action>
                                                                </pluginExecution>
                                                        </pluginExecutions>
                                                </lifecycleMappingMetadata>
                                        </configuration>
                                </plugin>
                        </plugins>
                </pluginManagement>

Once that's in place running mvn process-classes from the command line works

Kurniawan Atharwa

unread,
Sep 19, 2012, 9:40:35 PM9/19/12
to activejd...@googlegroups.com
Thank you robert. It works like a charm.

deny...@gmail.com

unread,
Feb 2, 2014, 9:46:41 AM2/2/14
to activejd...@googlegroups.com
It didnt work for me... I still get the following errors:

Failure to find org.apache.maven.plugins:activejdbc-instrumentation:pom:1.4.9 in file:/Users/UserName/.m2/repository/ was cached in the local repository, resolution will not be reattempted until the update interval of repository has elapsed or updates are forced

And later on, when I start using the application:

org.javalite.activejdbc.DBException: failed to determine Model class name, are you sure models have been instrumented?

I am using Eclipse Juno with m2e extensions (Buildhelper Connector and WTP) and JBoss AS 7. This is the current POM, the text in red is the one thar raises the error:

">
...
	<properties>
		<version.javaee.web>2.0.0.Final</version.javaee.web>
		<version.mysql>5.1.24</version.mysql>
		<version.shiro>1.2.2</version.shiro>
		<version.activejdbc>1.4.9</version.activejdbc>
	</properties>
	<build>
		<plugins>
			<plugin>
				<groupid>org.javalite</groupid>
				<artifactId>activejdbc-instrumentation</artifactId>
				<version>${version.activejdbc}</version>
				<executions>
					<execution>
						<id>instrument</id>
						<phase>process-classes</phase>
						<goals>
							<goal>instrument</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.javalite
										</groupId>
										<artifactId>
											activejdbc-instrumentation
										</artifactId>
										<versionRange>
											[${version.activejdbc},)
										</versionRange>
										<goals>
											<goal>instrument</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<execute />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<dependencies>
		<dependency>
			<groupId>org.jboss.spec.javax.faces</groupId>
			<artifactId>jboss-jsf-api_2.0_spec</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>${version.mysql}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.shiro</groupId>
			<artifactId>shiro-core</artifactId>
			<version>${version.shiro}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.shiro</groupId>
			<artifactId>shiro-web</artifactId>
			<version>${version.shiro}</version>
		</dependency>
		<dependency>
			<groupId>org.javalite</groupId>
			<artifactId>activejdbc</artifactId>
			<version>${version.activejdbc}</version>
		</dependency>
	</dependencies>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.jboss.spec</groupId>
				<artifactId>jboss-javaee-web-6.0</artifactId>
				<version>${version.javaee.web}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>
</project>

Do you guys have any idea on how to solve this? I am almost giving up on ActiveJDBC...

Igor Polevoy

unread,
Feb 2, 2014, 5:39:34 PM2/2/14
to activejd...@googlegroups.com
There is no issue with ActiveJDBC, please  see if this page helps you:

Thanks

deny...@gmail.com

unread,
Feb 2, 2014, 10:20:37 PM2/2/14
to activejd...@googlegroups.com
Thanks Igor. I did everything on the page and managed to do the instrumentation. Now I get the following error:

org.javalite.activejdbc.InitException: you are trying to work with models, but no models are found. Maybe you have no models in project, or you did not instrument the models. It is expected that you have a file activejdbc_models.properties on classpath

The instrumentation results was:

**************************** START INSTRUMENTATION ****************************

Directory: /Users/UserName/Documents/Workspace/edipo/target/classes

Found model: br.com.project.ada.model.entity.Usuario

Detected method: getMetaModel, skipping delegate.

Detected method: getAttributes, skipping delegate.

Detected method: fromMap, skipping delegate.

Detected method: hydrate, skipping delegate.

Detected method: setId, skipping delegate.

Detected method: setDate, skipping delegate.

Detected method: getDate, skipping delegate.

Detected method: setTS, skipping delegate.

Detected method: set, skipping delegate.

Detected method: set, skipping delegate.

Detected method: isFrozen, skipping delegate.

Detected method: attributes, skipping delegate.

Detected method: associations, skipping delegate.

Detected method: isNew, skipping delegate.

Detected method: frozen, skipping delegate.

Detected method: delete, skipping delegate.

Detected method: delete, skipping delegate.

Detected method: deleteCascade, skipping delegate.

Detected method: deleteCascadeExcept, skipping delegate.

Detected method: deleteCascadeShallow, skipping delegate.

Detected method: delete, skipping delegate.

Detected method: exists, skipping delegate.

Detected method: exists, skipping delegate.

Detected method: deleteAll, skipping delegate.

Detected method: update, skipping delegate.

Detected method: updateAll, skipping delegate.

Detected method: toMap, skipping delegate.

Detected method: toString, skipping delegate.

Detected method: toXml, skipping delegate.

Detected method: beforeClosingTag, skipping delegate.

Detected method: toJson, skipping delegate.

Detected method: toJsonP, skipping delegate.

Detected method: beforeClosingBrace, skipping delegate.

Detected method: parent, skipping delegate.

Detected method: setCachedParent, skipping delegate.

Detected method: setParents, skipping delegate.

Detected method: setParent, skipping delegate.

Detected method: copyTo, skipping delegate.

Detected method: copyFrom, skipping delegate.

Detected method: getMetaModelLocal, skipping delegate.

Detected method: setMetamodelLocal, skipping delegate.

Detected method: refresh, skipping delegate.

Detected method: get, skipping delegate.

Detected method: getString, skipping delegate.

Detected method: getBytes, skipping delegate.

Detected method: getBigDecimal, skipping delegate.

Detected method: getInteger, skipping delegate.

Detected method: getLong, skipping delegate.

Detected method: getFloat, skipping delegate.

Detected method: getTimestamp, skipping delegate.

Detected method: getDouble, skipping delegate.

Detected method: getBoolean, skipping delegate.

Detected method: setString, skipping delegate.

Detected method: setBigDecimal, skipping delegate.

Detected method: setInteger, skipping delegate.

Detected method: setLong, skipping delegate.

Detected method: setFloat, skipping delegate.

Detected method: setTimestamp, skipping delegate.

Detected method: setDouble, skipping delegate.

Detected method: setBoolean, skipping delegate.

Detected method: getAll, skipping delegate.

Detected method: get, skipping delegate.

Detected method: get, skipping delegate.

Detected method: validateNumericalityOf, skipping delegate.

Detected method: addValidator, skipping delegate.

Detected method: addError, skipping delegate.

Detected method: removeValidator, skipping delegate.

Detected method: getValidators, skipping delegate.

Detected method: validateRegexpOf, skipping delegate.

Detected method: validateEmailOf, skipping delegate.

Detected method: validateRange, skipping delegate.

Detected method: validatePresenceOf, skipping delegate.

Detected method: validateWith, skipping delegate.

Detected method: convertDate, skipping delegate.

Detected method: convertTimestamp, skipping delegate.

Detected method: belongsTo, skipping delegate.

Detected method: addCallbacks, skipping delegate.

Detected method: isValid, skipping delegate.

Detected method: validate, skipping delegate.

Detected method: hasErrors, skipping delegate.

Detected method: addValidator, skipping delegate.

Detected method: errors, skipping delegate.

Detected method: errors, skipping delegate.

Detected method: create, skipping delegate.

Detected method: set, skipping delegate.

Detected method: createIt, skipping delegate.

Detected method: findById, skipping delegate.

Detected method: where, skipping delegate.

Detected method: find, skipping delegate.

Detected method: findFirst, skipping delegate.

Detected method: first, skipping delegate.

Detected method: find, skipping delegate.

Detected method: findWith, skipping delegate.

Detected method: findBySQL, skipping delegate.

Detected method: findAll, skipping delegate.

Detected method: add, skipping delegate.

Detected method: remove, skipping delegate.

Detected method: saveIt, skipping delegate.

Detected method: reset, skipping delegate.

Detected method: thaw, skipping delegate.

Detected method: defrost, skipping delegate.

Detected method: save, skipping delegate.

Detected method: count, skipping delegate.

Detected method: count, skipping delegate.

Detected method: insert, skipping delegate.

Detected method: instance, skipping delegate.

Detected method: getDaClass, skipping delegate.

Detected method: getClassName, skipping delegate.

Detected method: getTableName, skipping delegate.

Detected method: getId, skipping delegate.

Detected method: getIdName, skipping delegate.

Detected method: setChildren, skipping delegate.

Detected method: toInsert, skipping delegate.

Detected method: toInsert, skipping delegate.

Detected method: toInsert, skipping delegate.

Detected method: purgeCache, skipping delegate.

Detected method: getLongId, skipping delegate.

Detected method: purgeEdges, skipping delegate.

Detected method: writeExternal, skipping delegate.

Detected method: readExternal, skipping delegate.

Instrumented class: br.com.project.ada.model.entity.Usuario in directory: /Users/UserName/Documents/Workspace/edipo/target/classes/

**************************** END INSTRUMENTATION ****************************

**************************** START INSTRUMENTATION ****************************

Directory: /Users/Denys/Documents/Workspace/edipo/target/test-classes

**************************** END INSTRUMENTATION ****************************

The activejdbc_models.properties is on the class path and has the following text:

 br.com.project.ada.model.entity.Usuario:default

This class exists in the classpath, The connection seems to be ok, because I changed some settings and the error message changed to something like database not found, and there is a table named Usuario in the database. The class code:

package br.com.project.ada.model.entity;

import org.javalite.activejdbc.Model;

public class Usuario extends Model {}

It seems to be ok, I really cannot get what is going on...

I tried to connect using JNDI and driver connection and got the same results.

//Base.open("java:jboss/datasources/project");

Base.open("com.mysql.jdbc.Driver", "jdbc:mysql://localhost:3306/project", "user", "psswrd");

Igor Polevoy

unread,
Feb 3, 2014, 12:58:09 AM2/3/14
to activejd...@googlegroups.com
there must be a problem with your classpath. Please see this code:

As you can see, if it does not find a file or file is empty, then you will get this message, no magic. Can you load this file the same way before you execute a model, to at least see if file is on classpath? 

tx
igor

deny...@gmail.com

unread,
Feb 3, 2014, 8:32:23 PM2/3/14
to activejd...@googlegroups.com
Hi Igor,

I checked the war file on JBoss and the activejdbc_models.properties wasnt there! It is being generated in the workspace during the build but is not being published!

I moved the file manually and got another error, but I guess its related to the naming convention (the class name is Usuario and table name is the same, I guess activejdbc tries to map as usuarios).

Do you know how to make the publishing of the properties file automatic?

Thanks already!

deny...@gmail.com

unread,
Feb 3, 2014, 9:01:52 PM2/3/14
to activejd...@googlegroups.com
I created an empty activejdbc_models.properties file in the classpath root of the project and it worked.


I guess once it was mapped, it was included in the war publishing after the instrumentation step.

It is not pretty, but it is working so far.

Thanks Igor.

Igor Polevoy

unread,
Feb 3, 2014, 11:57:54 PM2/3/14
to activejd...@googlegroups.com
if you are building with Maven, this would not be necessary. 
Something is up with the way you package things. We never move anything manually like this. 
Please, see Kitchensink for a standard Mavenm example of building a war file: 

tx

Igor Polevoy

unread,
Feb 3, 2014, 11:59:55 PM2/3/14
to activejd...@googlegroups.com
I would advise against this approach. This file gets regenerated each time you build the project and run instrumentation. 
Usually people do not even know this file is there. You need to find out why your build process is not including this file, rather than including it with sources. 

tx


On Monday, February 3, 2014 8:01:52 PM UTC-6, deny...@gmail.com wrote:

deny...@gmail.com

unread,
Feb 8, 2014, 8:07:45 AM2/8/14
to activejd...@googlegroups.com
Hi Igor,

I went through the whole process again and, after a lot of attempts, I changed the configuration in the instrumentation builder to refresh resources recursively upon completion and it started working. Its on Proj Properties >> Builders >> Edit (on instrumentation builder) >> Refresh tab.

It seems to be working now. I will start mapping the other entities and if it goes well I will let you know.

Thanks for the patience.
Reply all
Reply to author
Forward
0 new messages