Why does maven install fail during javadoc generation? - maven-1

When running 'maven install', I get the following..
[INFO] [javadoc:javadoc {execution:
default}] [INFO]
------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO]
------------------------------------------------------------------------ [INFO] An error has occurred in
JavaDocs report generation:Exit code:
1 - java.lang.NullPointerException
at com.sun.tools.doclets.formats.html.PackageUseWriter.generatePackageUse(PackageUseWriter.java:180)
at com.sun.tools.doclets.formats.html.PackageUseWriter.generatePackageList(PackageUseWriter.java:124)
at com.sun.tools.doclets.formats.html.PackageUseWriter.generatePackageUse(PackageUseWriter.java:110)
at com.sun.tools.doclets.formats.html.PackageUseWriter.generatePackageUseFile(PackageUseWriter.java:99)
at com.sun.tools.doclets.formats.html.PackageUseWriter.generate(PackageUseWriter.java:78)
at com.sun.tools.doclets.formats.html.ClassUseWriter.generate(ClassUseWriter.java:116)
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateOtherFiles(HtmlDoclet.java:92)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:122)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
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 com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:143)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:41)
at com.sun.tools.javadoc.Main.main(Main.java:31)
Command line was: /home/fsl/jdk1.6.0_12/jre/../bin/javadoc #options #packages #argfile
What am I doing wrong?

Also, if you have:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (default-cli) on project coolproject-api: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - javadoc: warning - No source files for package org.coolproject.api
[ERROR] javadoc: warning - No source files for package org.coolproject.api
[ERROR] javadoc: warning - No source files for package org.coolproject.api.listeners
[ERROR] javadoc: error - No public or protected classes found to document.
Java compiler understands sources directories with package-style names like:
coolproject-api/java/org.coolproject.api/
and there are no problems with it, but maven-javadoc-plugin doesn't. So try to change your "physical" packages layout to:
coolproject-api/java/org/coolproject/api/

To drop the -use option in maven-javadoc-plugin, use the following configuration:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<use>false</use>
<links>
<link>http://java.sun.com/javase/6/docs/api/</link>
</links>
</configuration>
</plugin>

There is an unfixed bug that seems to be your problem. From the bug description the known workarounds are either to drop the -use option or use JDK 1.4.2. You're using Java 6 so this may be the case.
The line the NullPointerException is occuring at is:
printHyperLink("", pkg.name(), Util.getPackageName(pkg), true);
So perhaps the problem is occurring because of a typo in your package.html file?

From that bug report, this will occur when one has classes in the default package and -use is on. So one solution is to move the classes in the default package into a named package.
Annoying that this bug hasn't been fixed in the javadoc tool distributed with some of the distributions, such as MacOS X Lion.
The bug appears to have been fixed in the openjdk 6, at least from inspection of the source code. Download of that source available at: http://download.java.net/openjdk/jdk6/

Look at your environment variables and delete the CLASSPATH variable or add your package path.
javadoc uses the classpath to determine the packages. If the path is not in your variable it will fail.

Related

apr-util configuration problem on AIX 52 and AIX 53 OS

I am trying to build apr-util subversion dependency library on AIX. Configure errors out saying "configure: error: C compiler cannot create executables. See `config.log' for more details."
I am not sure what am i missing in configuration flags that the config.log ends up saying
configure:3064: checking for C compiler default output file name
configure:3086: /usr/bin/xlc -L/u/developers/devsys/Subversion/build/AIX35/lib: conftest.c /u/developers/devsys/Subversion/build/AIX35/lib: >&5
/usr/bin/xlc: 1501-228 input file /u/developers/devsys/Subversion/build/AIX35/lib: not found
The configure statement is like this:
./configure --build=powerpc-ibm-aix5.3.0.0 --host=powerpc-ibm-aix5.3.0.0
--target=powerpc-ibm-aix5.3.0.0 --prefix=/u/developers/devsys/Subversion/build/AIX35
--exec-prefix=/u/developers/devsys/Subversion/build/AIX35
--with-apr=/u/developers/devsys/Subversion/build/AIX35 --with-berkeley-db
--with-sqlite3=/u/developers/devsys/Subversion/build/AIX35
--with-expat=/u/developers/devsys/Subversion/build/AIX35
One more thing observed in config.log is before this error there is another error which says
configure:3015: /usr/bin/xlc --version >&5
/usr/bin/xlc: 1501-216 command option --version is not recognized - passed to ld
Any help would be really appreciated.
The configure script is expected to encounter a lot of errors (because it's testing the system tools), so errors previous to the fatal one are probably not a problem.

Unable to deploy using SVN as Maven repo

I'm trying to use Subversion as Maven repo utilizing Maven wagon. If I declare snapshot location using http as protocol I get 409 error back from server when trying to deploy (mvn clean deploy)
<snapshotRepository>
<uniqueVersion>false</uniqueVersion>
<id>engtools_snapshots</id>
<name>EngTools Maven Repository</name>
<url>http://continuum.td.com/svn_repos/maven/snapshots</url>
</snapshotRepository>
When I change protocol to scm:svn:http things are getting even more weird - I get several errors seemingly related to realm
<snapshotRepository>
<uniqueVersion>false</uniqueVersion>
<id>engtools_snapshots</id>
<name>EngTools Maven Repository</name>
<url>scm:svn:http://continuum.td.com/svn_repos/maven/snapshots</url>
</snapshotRepository>
SCM configuration
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-scm</artifactId>
<version>1.0-beta-6</version>
</extension>
<extension>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-manager-plexus</artifactId>
<version>1.3-SNAPSHOT</version>
</extension>
<extension>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-svnexe</artifactId>
<version>1.3-SNAPSHOT</version>
</extension>
</extensions>
Partial stacktrace resulting from (mvn deploy)
[INFO] [deploy:deploy {execution: default-deploy}]
[INFO] Retrieving previous build number from engtools_snapshots
[FATAL ERROR] org.apache.maven.plugin.deploy.DeployMojo#execute() caused a
linkage error (java.lang.AbstractMethodError) and may be out-of-date. Check
the realms:
[FATAL ERROR] Plugin realm =
app0.child-container[org.apache.maven.plugins:maven-deploy-plugin:2.4]
urls[0] = file:/C:/Documents and Settings/boo/.m2/repository/org/apache/
maven/plugins/maven-deploy-plugin/2.4/maven-deploy-plugin-2.4.jar
urls[1] = file:/C:/Documents and Settings/boo/.m2/repository/org/codehaus/
plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[FATAL ERROR] Container realm = plexus.core
urls[0] = file:/C:/java/apache-maven-2.2.0/bin/../lib/maven-2.2.0-uber.jar
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] org.apache.maven.scm.command.checkout.AbstractCheckOutCommand.
executeCheckOutCommand(Lorg/apache/maven/scm/provider/ScmProviderRepository;
Lorg/apache/maven/scm/ScmFileSet;Lorg/apache/maven/scm/ScmVersion;)
Lorg/apache/maven/scm/command/checkout/CheckOutScmResult;
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.AbstractMethodError: org.apache.maven.scm.command.checkout.AbstractCheckOutCommand.
executeCheckOutCommand(Lorg/apache/maven/scm/provider/ScmProviderRepository;
Lorg/apache/maven/scm/ScmFileSet;Lorg/apache/maven/scm/ScmVersion;)Lorg/apache/maven/scm/command/checkout/CheckOutScmResult;
at org.apache.maven.scm.command.checkout.AbstractCheckOutCommand.executeCommand(
AbstractCheckOutCommand.java:49)
at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:58)
If you look at wagon-scm's POM you'll see it has dependencies on the 1.0 versions of the maven-scm-provider-* artifacts. In your extensions section you've referenced the 1.3-SNAPSHOT versions.
From version 1.2 onwards, the AbstractCheckOutCommand's executeCheckOutCommand() method is no longer abstract, instead it delegates to another abstract method with an additional recursive parameter. Because of this change you get the linkage error.
The simplest way to remedy this is to change the versions of the maven-scm-provider-* extensions to be consistent with those required by wagon-scm, i.e. change the 1.3-SNAPSHOT versions for 1.0 or 1.1 versions.
It's worth pointing out I think that using an SCM system to host your Maven repository is not really a good idea, particularly for SNAPSHOT artifacts. Instead I'd recommend using a repository manager, they provide lots of useful features on top of hosting the artifacts.

Hudson Job not running

please help I am stucked. I can compile my project nicely with maven 3.1.0
mvn deploy -Pbuild-int
==> Build success
but if I try to setup a simple Hudson Job to do the same, I am failing all the time an I don`t know why. The error message is unfortunately for a beginner like me not helpful.
I am using a local VirtualSVNServer 2.6.0, a local Hudson Server 3.0.1 and JDK 1.7.0
SVN link and authentication works fine, tested it via providing URL to second browser window and provided details.
Any help is appreciated. Thanks in advance.
ERROR LOG of the Job
Gestartet durch Benutzer anonymous
Updating https://localhost/svn/e2etrace/branches/RB-1.2.0 revision: 19.07.2013 19:56:50 depth:infinity ignoreExternals: false
At revision 37
no change for https://localhost/svn/e2etrace/branches/RB-1.2.0 since the previous build
[INFO] Using Maven 3 installation: Maven 3.1.0
[INFO] Checking Maven 3 installation environment
[workspace] $ D:\maven\bin\mvn.bat --help
[INFO] Checking Maven 3 installation version
[INFO] Detected Maven 3 installation version: 3.1.0
[workspace] $ D:\maven\bin\mvn.bat deploy -Pbuilt-int -V -B -Dmaven.ext.class.path=C:\Users\Jonas\.hudson\maven\slavebundle\resources;C:\Users\Jonas\.hudson\maven\slavebundle\lib\maven3-eventspy-3.0.jar;C:\Users\Jonas\.hudson\war\webapp\WEB-INF\lib\hudson-remoting-3.0.0.jar -Dhudson.eventspy.port=54334 -f pom.xml
[DEBUG] Waiting for connection on port: 54334
Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-28 04:15:32+0200)
Maven home: D:\maven
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_25\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 8", version: "6.2", arch: "amd64", family: "windows"
[WARNING] Error injecting: org.hudsonci.maven.eventspy_30.DelegatingEventSpy
java.lang.NoClassDefFoundError: org/sonatype/guice/bean/reflect/ClassSpace
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483)
at java.lang.Class.getDeclaredConstructors(Class.java:1891)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:653)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:863)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:790)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:278)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:210)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:986)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1019)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:982)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1032)
at org.eclipse.sisu.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:44)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:55)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:116)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:47)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1054)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:997)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1054)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:993)
at org.eclipse.sisu.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at org.eclipse.sisu.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:52)
at org.eclipse.sisu.locators.EntryListAdapter$ValueIterator.next(EntryListAdapter.java:111)
at java.util.AbstractCollection.toArray(AbstractCollection.java:141)
at java.util.ArrayList.<init>(ArrayList.java:151)
at org.apache.maven.eventspy.internal.EventSpyDispatcher.setEventSpies(EventSpyDispatcher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.sisu.reflect.BeanPropertySetter.set(BeanPropertySetter.java:76)
at org.eclipse.sisu.plexus.binders.ProvidedPropertyBinding.injectProperty(ProvidedPropertyBinding.java:48)
at org.eclipse.sisu.inject.BeanInjector.injectMembers(BeanInjector.java:52)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:128)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:118)
at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:92)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at org.eclipse.sisu.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:134)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1054)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:997)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1047)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:993)
at org.eclipse.sisu.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at org.eclipse.sisu.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:52)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:259)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:251)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
at org.apache.maven.cli.MavenCli.container(MavenCli.java:420)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:208)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
Caused by: java.lang.ClassNotFoundException: org.sonatype.guice.bean.reflect.ClassSpace
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 78 more
[ERROR] Error executing Maven.
[ERROR] com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting: public void org.apache.maven.eventspy.internal.EventSpyDispatcher.setEventSpies(java.util.List)
at ClassRealm[maven.ext, parent: ClassRealm[plexus.core, parent: null]]
while locating org.apache.maven.eventspy.internal.EventSpyDispatcher
1 error
role: org.apache.maven.eventspy.internal.EventSpyDispatcher
roleHint:
[ERROR] Caused by: Guice provision errors:
1) Error injecting: public void org.apache.maven.eventspy.internal.EventSpyDispatcher.setEventSpies(java.util.List)
at ClassRealm[maven.ext, parent: ClassRealm[plexus.core, parent: null]]
while locating org.apache.maven.eventspy.internal.EventSpyDispatcher
1 error
[ERROR] Caused by: org/sonatype/guice/bean/reflect/ClassSpace
[ERROR] Caused by: org.sonatype.guice.bean.reflect.ClassSpace
[ERROR] Process did not initiate connection and appears to have died; exit code: 1
[ERROR] Failure: hudson.AbortException: Process did not initiate connection and appears to have died; exit code: 1
ERROR: Process did not initiate connection and appears to have died; exit code: 1
Finished: FAILURE
Maven Home variable was wrong. Sometimes thinks are so obvious. Be aware use / instead \ and I left out disk. Now it works.
I used the bundled (in the plugin it seems) maven 3 installation in favor to a manual installed one.
So I don't need to add a maven installation in the hudson configuration.

issue running mvn eclipse:eclipse on platform tag 4.0.3

I have checked out the platform 4.0.3 tag, and have hit an issue with the SecVerifier when running mvn eclipse:eclipse.
I've cleaned the maven cache for SecVerifier:
rm -rf %USERPROFILE%\.m2\repository\org\wso2\carbon\SecVerifier
rm -rf %USERPROFILE%\.m2\repository\org\wso2\carbon\integration
Then tried mvn eclipse:clean eclipse:eclipse:
C:\wso2\src\wso2carbon_platform_tags_403>mvn eclipse:clean eclipse:eclipse
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.wso2.carbon:SecVerifier:4.0.0 (C:\wso2\src\wso2carbon_platform_tags_403\products\integration\security-verifier\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find org.wso2.carbon:integration:pom:4.0.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM # line 22, column 13 -> [Help 2]
I found this JIRA: link, and applied the fix. Similar error:
[ERROR] The project org.wso2.carbon:SecVerifier:4.0.0 ... has 1 error
...
[ERROR] Non-resolvable parent POM: Could not find artifact
org.wso2.carbon:integration:pom:4.0.0 in central (http://repo.maven.apache.org/maven2) and
'parent.relativePath' points at wrong local POM # line 22, column 13 -> [Help 2]
Any ideas?
According to the error log maven cannot find the parent pom.xml file since it is unavailable on the given location. You can check your checkout code and figure out the actual location and set the relative path correctly.
This need to be work correctly but due to some changes done by users sometimes builds can be break.
Hope this might help you.
Thanks.

maven archetype j2ee-simple generates a failing project

I created a j2ee-simple project using the maven template with following command-line
mvn archetype:create -DgroupId=com.hardik -DartifactId=ActionBazaar -DarchetypeArtifactId=maven-archetype-j2ee-simple
When I try to run the install goal within the created project folder I get an
error about not existent model file in the site module. The error is described bellow.
When I remove the site module from the root pom.xml it works. Is there any proper way to correct this problem ?
What if I want to keep the site module in order to make website for my project ?
Here the error:
$ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: unknown
Reason: Could not find the model file '/home/hardik/projects/ActionBazaar/site'. for project unknown
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Could not find the model file '/home/hardik/projects/ActionBazaar/site'. for project unknown
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:432)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:300)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
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.project.ProjectBuildingException: Could not find the model file '/home/hardik/projects/ActionBazaar/site'. for project unknown
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1585)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:506)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:632)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:515)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:588)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:419)
... 11 more
Caused by: java.io.FileNotFoundException: /home/hardik/projects/ActionBazaar/site (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at hidden.org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:124)
at hidden.org.codehaus.plexus.util.xml.XmlStreamReader.<init>(XmlStreamReader.java:67)
at hidden.org.codehaus.plexus.util.ReaderFactory.newXmlReader(ReaderFactory.java:113)
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1580)
... 17 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sat Jul 04 07:59:37 CEST 2009
[INFO] Final Memory: 1M/4M
[INFO] ----
Try updating your maven to begin with. Trying to run this myself, I get the following error:
[WARNING] This goal is deprecated. Please use mvn archetype:generate instead
Aside from that, the archetype doesn't seem to even create a site module - if you ls, you'll notice there is, in-fact, no 'site' directory i.e. no module - that's why you're getting the error, and that's why removing the site fixes the problem.
You can of course still make a dedicated site module - just create the directory 'site', and put a minimalist pom in there, which will let the build pass.
And, as I thought, here is the associated archetype bug for this issue: MARCHETYPES-15 . I suggest you vote for it, and 'watch' for when it will be fixed.
But like I said, simply adding the 'site' dir with a minimal pom will fix your problem. But you'll have to find a 'site' template as well. I suggest reading this excellent book from Sonatype (the creators of Maven.)
In every module or project in the workspace make sure the and the element in the pom.xml contain the same entries. In this example below it is ad-common. With this it should work.
<artifactId>ad-common</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>ad-common</name>

Resources