Jump to content
Changes to the Jaspersoft community edition download ×

building js from sources - maven problem


ktrinad

Recommended Posts

By: tortois - tortois

building js from sources - maven problem

2006-05-16 00:25

Hi,

After getting JS svn source codes and installing maven2 (and setting other stuff) I tried to build JS projects.

As described at some point I run mvn install.

some elements/artifacts/plugins were downloaded but then I got following messages:

 

Downloading: http://snapshots.maven.codehaus.org/maven2/org/apache/maven/doxia/doxia/1.0-alpha-8/doxia-1.0-alpha-8.pom

[iNFO] ------------------------------------------------------------------------

[ERROR] BUILD ERROR

[iNFO] ------------------------------------------------------------------------

[iNFO] Error building POM (may not be this project's POM).

 

 

Project ID: null:doxia-site-renderer:jar:1.0-alpha-8

 

Reason: Cannot find parent: org.apache.maven.doxia:doxia for project: null:doxia-site-renderer:jar:1.0-alpha-8

 

I'm new to maven and it seems it's maven related problem but still...

maybe someone could give me some advice how to overcome this problem.

Any hints?

thanks

 

 

By: W. Stewart - wstewart

RE: building js from sources - maven problem

2006-06-16 16:13

I'm also having problems building from sources,

and am also new to Maven2. Not the same error as above. Does not appear to be related to a

hardware problem at codehaus.org. Here's the

error:

 

[iNFO] ------------------------------------------------------------------------

[ERROR] BUILD ERROR

[iNFO] ------------------------------------------------------------------------

[iNFO] Failed to resolve artifact.

 

Missing:

----------

1) xdoclet-plugins:xdoclet-plugin-hibernate:jar:1.0.4-SNAPSHOT

 

Try downloading the file manually from the project website.

 

Then, install it using the command:

mvn install:install-file -DgroupId=xdoclet-plugins -DartifactId=xdoclet-plugin-hibernate

-Dversion=1.0.4-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

 

Path to dependency:

1) xdoclet:maven2-xdoclet2-plugin:maven-plugin:2.0.5-20060117.143439-6

2) xdoclet-plugins:xdoclet-plugin-hibernate:jar:1.0.4-SNAPSHOT

 

----------

1 required artifact is missing.

 

for artifact:

xdoclet:maven2-xdoclet2-plugin:maven-plugin:2.0.5-20060117.143439-6

 

from the specified remote repositories:

Maven Snapshots (http://snapshots.maven.codehaus.org/maven2/),

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

codehaus-plugins (http://dist.codehaus.org/),

codehaus-legacy (http://dist.codehaus.org/),

dist.codehaus.org (http://dist.codehaus.org),

apache (http://cvs.apache.org/repository/)

 

 

 

By: Sherman Wood - sgwood

RE: building js from sources - maven problem

2006-06-17 06:49

 

This will happen now and again due to the public repositories being overloaded. Have you tried 2 or 3 times?

 

One thing to try is deleting your ~/.m2/repository/xdoclet and xdoclet-plugins directories and letting Maven2 refresh them.

 

 

 

Sherman

JasperSoft

 

 

By: W. Stewart - wstewart

RE: building js from sources - maven problem

2006-06-18 20:01

Yes, I tried more than 2 or 3 times, many more.

I have been unable to find that package even

searching manually. Has anyone at JasperSoft

tried building recently with a clean maven

repository?

 

My first impressions of maven are not positive.

I have an SCM background and the build tool is

critical to configuration management. However,

builds w/ maven appear to be non-deterministic.

The first time I built JasperServer, the build

failed with a message about freechart. I reran

it and it downloaded a *bunch* more stuff from

the internet, then failed in a different spot.

It finally seems to have converged on this

error, even after trying the "legacy" fix

posted in the mailing list.

 

I have tried w/ clean repository several times.

I was going to download & install it into the

repository manually but couldn't find that

1.0.4 SNAPSHOT jar version anywhere.

 

Perhaps that package will show up on a web site

soon and my build will start magically working?

 

 

 

By: Sherman Wood - sgwood

RE: building js from sources - maven problem

2006-05-16 06:26

 

Maven relies on public repositories (web sites) for JARs etc. There is a hardware problem with the Codehaus repository which makes it inaccessible. Here are some workarounds to add into your Maven ~/.m2/settings.xml.

<settings>

...

<mirrors>

<mirror>

<id>ApacheSVN</id>

<url>http://svn.apache.org/maven-snapshot-repository</url>

<mirrorOf>snapshots</mirrorOf>

</mirror>

</mirrors>

...

<repositories>

...

<repository>

<id>ApacheSVN-central</id>

<url>http://svn.apache.org/maven-snapshot-repository</url>

<snapshots>

<enabled>true</enabled>

</snapshots>

<releases>

<enabled>true</enabled>

</releases>

</repository>

 

 

There are some Codehaus plugins, dependency-maven and tomcat-maven, that will not work. I'll get those into jasperserver-repo, too.

 

I have just noticed that the Spring 2.0-M3 JARs we were accessing on IBiblio have changed. We probably need to add them into the jasperserver-repo in our SourceForge SVN in order to complete the build, or upgrade to Spring 2.0 M4. We will check that out.

 

 

Sherman

JasperSoft

 

 

By: Antoine Rey - elryk

RE: building js from sources - maven problem

2006-06-19 00:45

Hi,

I've got the same problem to download in the maven 2 repository the xdoclet-plugins:xdoclet-plugin-hibernate:jar:1.0.4-SNAPSHOT file.

I try to remove the <plugin> tag that contains the maven2-xdoclet2-plugin artifactId in the the jasperserver-api-implmetadatapom.xml. Compilation is successfull but tests failed due to some hibernate configuration files that are missing. This xdoclet plugin seems to be mandatory.

May the JasperServer team put this file in jasperserver repository ?

Thank you,

Elryk

 

 

By: Sherman Wood - sgwood

RE: building js from sources - maven problem

2006-06-19 06:52

 

We are working every day with the build. These issues come up from time to time, but usually they are intermittent.

 

Putting public artifacts like the xdoclet plugin into our repository runs counter to what Maven does.

 

I don't know why you are having such problems at this time, when it is working for others.

 

 

 

Sherman

JasperSoft

 

 

By: W. Stewart - wstewart

RE: building js from sources - maven problem

2006-06-19 08:29

Found this very recent posting by Konstantin Pribluda

at http://comments.gmane.org/gmane.comp.java.xdoclet-plugins/1726:

 

> Im working on fresh deployments right now,

> and this is combined with fixing of maven-2 build

>

> I think fresh deployment of generama is necessary,

> but there is no m2 pom for now ( and I'm working on it

> at the moment )

>

> You mut be able to chekcout generama / xdoclet and

> recompile them locally though...

 

So the answer to the above problem appears to be: go find this

plugin and build it from sources. Guess that's just "what Maven

does", and we certainly don't want to run counter to that! :-)

 

 

By: W. Stewart - wstewart

RE: building js from sources - maven problem

2006-06-19 08:11

> when it is working for others.

 

Are you sure it is "working for others"?

 

Could someone who has built JasperServer

"out of the box" and per the instructions in

the "JasperServer-Source-Code-Build-Guide.pdf"

** on a clean Maven2 repository ** please post

to this thread.

 

(Of course those instructions should probably

read:

 

"To do a complete build, you will do the

following steps:

 

cd jasperserver/trunk

mvn install

 

Repeat the above command as many times as

necessary until the build completes successfully.

You may need to do this over a period of several

days since the suggested configuration of Maven2

is susceptible to the state of various servers

and code distributions out on the Net.")

 

Also, no one has yet said where I can download

this dependency manually, as suggested by the

Maven2 error message:

 

 

Try downloading the file manually from the project website.

 

Then, install it using the command:

mvn install:install-file -DgroupId=xdoclet-plugins -DartifactId=xdoclet-plugin-hibernate

-Dversion=1.0.4-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

 

 

 

 

 

 

By: Daryl - daryld

RE: building js from sources - maven problem

2006-06-19 11:53

I managed to build JasperServer. I ran into the same problems with xdoclet-plugin-hibernate. I too couldn't find the version 1.0.4-SNAPSHOT (this was a couple of weeks ago. What I did to work around the problem was download a 1.0.3 version of the jar then I used instructions mvn gives to install it manually. I used '-Dverion=1.0.4-SNAPSHOT' for 1.0.3 file. I don't know what problems this may cause but it seems to have worked for me.

 

I also had problems with the tests the mvn runs. I ended up using -Dmaven.test.skip=true

 

 

 

By: W. Stewart - wstewart

RE: building js from sources - maven problem

2006-06-19 12:25

So I take it that you're not one of the "others"

that it is "working for" ;-)

 

 

By: Sherman Wood - sgwood

RE: building js from sources - maven problem

2006-06-20 06:03

 

It is not a Maven best practice, but I just committed some additional artifacts to Subversion that should help with the build. Update your settings.xml with this:

 

<pluginRepository>

<id>jasperServerForSFPlugins</id>

<name>Base repository for Jasper Server</name>

<url><your local file system>/JasperServer-SF-Repo-trunk</url>

<snapshots>

<enabled>true</enabled>

</snapshots>

<releases>

<enabled>true</enabled>

</releases>

</pluginRepository>

 

It is also useful to add mirrors for some of the repositories in your settings.xml, like:

 

<mirrors>

<mirror>

<id>ApacheSVN</id>

<url>http://svn.apache.org/maven-snapshot-repository</url>

<mirrorOf>snapshots</mirrorOf>

</mirror>

<mirror>

<id>ApacheSVN-legacy</id>

<url>http://svn.apache.org/maven-snapshot-repository</url>

<mirrorOf>legacy</mirrorOf>

</mirror>

<mirror>

<id>ggi-project.org</id>

<url>http://ftp.ggi-project.org/pub/packages/maven2</url>

<mirrorOf>central</mirrorOf>

</mirror>

</mirrors>

 

 

We have found Maven really helps us break up the various components so that we can reuse them in different contexts. If you want to avoid the downsides of using the public maven repositories, you can create your own internal repositories.

 

 

 

Sherman

JasperSoft

 

 

By: W. Stewart - wstewart

RE: building js from sources - maven problem

2006-06-20 08:34

Thanks, Sherman. I'll give it a try.

 

I'm sure Maven2 is a wonderful tool, once you get used to it.

 

However, they don't create a good first impression for newcomers.

For example, all I wanted to do was build JasperServer from

sources to do some debugging. There was no ant build.xml file,

so I had to learn a little about this new (to me) tool called

Maven2. I followed the intructions in your build document.

 

Maven started downloading many megabytes from the Internet, then

the build failed. Things went by on the screen so fast, that I

decided to run it again. It downloaded many more megabytes and

failed with a different message. Hmmm ...

 

Another couple of runs and it finally stabilized with the error

message above - after downloading about 16 megabytes total! OK.

Suddenly, I was forced into learning a whole lot more about Maven

than I wanted to. Where did it put all this stuff it needed to

download? In C:Documents and Settingswstewart.m2. But my $HOME

was set to C:/wstewart. (I'm running under CygWin.) The Maven

documentation says it uses the environment variable $HOME to find

your settings.xml. That's not true. They use the Java system

property 'user.home'. Under CygWin the two don't necessarily

agree - you can reset $HOME in your bash start-up (rc) file.

 

So I tried the Eclipse maven plugin. 0.0.9 wouldn't work at all

for me. I backed up to 0.0.5 and got some other error about

Duplicate projecct ID's (an earlier bug - pre-Maven-2.0.3).

 

After going back to command-line 'mvn', and trying to follow

their suggestion to download and install the dependency manually,

I couldn't find that .jar anywhere. Meanwhile, I'm being told on

the "Help" forum that this build works for everyone else.

 

My point? If other people have experiences like mine, it might

be a barrier to wider acceptance of Maven2 and reflect poorly on

projects that use it. Personally, I think projects would be

wise to furnish back-up ant build scripts until Maven2 proves

itself to be more predictable and reliable.

 

 

 

By: Sherman Wood - sgwood

RE: building js from sources - maven problem

2006-06-21 06:26

 

Believe me, I understand your pain!

 

Maven avoids the Ant script from hell. I have worked with other large projects where maintaining the Ant script(s) was taking a huge amount of effort and was very bug prone. We ourselves and I expect the JI community will be extending and customizing the platform for their own needs, while retaining the need to test etc. I am seeing already that this is happening, and I think Maven will help us all.

 

Maven2 is a relatively recent upgrade to the original Maven and the documentation is not good. It is the future of Maven, so I made a decision that we should use it rather than the original Maven. I expect the documentation and the range of plugins available for Maven2 to expand and be more stable over time, and we will add details to the JI web site to cover problems that people have with building JI.

 

I think the problems with downloading the public artifacts are caused by popularity. As the use of Maven goes up, more folks are downloading and this is sending large amounts of traffic to the public sites that are providing this for free, so they run out of bandwidth. Also there are some single points of failure for particular components. This thread started when the codehaus went down, and folks could not get the required artifacts to build JI. Teodor and I had discussed having our own public Maven repository, not just for JI, but JasperReports as well, but we did not complete the task. We will get back to this in the next couple of weeks.

 

 

 

Sherman

JasperSoft

 

 

By: W. Stewart - wstewart

RE: building js from sources - maven problem

2006-06-21 08:27

Thanks for your thoughtful reply, Sherman.

 

I think the *concepts* behind Maven2 are very

strong. But in practice the tool can be quite

a suprise to the uninitiated, i.e., those who

are used to "good ol' ant" or make: Needing

to run multiple "mvn install" commands before

you can be sure that a build error is really

a build error. Needing to be connected to

the internet to do a build, even after checking

out your project's code and installing Maven2.

 

For example, my Maven2 repository now holds

95 megabytes of "stuff" and the only thing

I've used maven to build is JasperServer.

So imagine my suprise today when I tried to

do a "mvn clean" on JasperServer when my

laptop wasn't connected to the net. No go.

Maven promptly told me I was missing the

"maven-clean-plugin". I sure hope that

someday maven will stop needing to download

stuff in order to just work :-)

 

 

 

By: Sherman Wood - sgwood

RE: building js from sources - maven problem

2006-06-21 15:07

 

"mvn -o clean install" will run Maven in offline mode. It will use only artifacts in your local repository.

 

Your problem with the clean plugin not being there offline when you needed it can't be fixed easily.

 

 

Sherman

JasperSoft

 

 

By: W. Stewart - wstewart

RE: building js from sources - maven problem

2006-06-21 19:01

 

Yes, I'm starting to catch on to the way Maven2 does things. I

guess the trick is knowing when your local repository is complete

enough to be able to use the "-o" option for all the required

build operations on a project.

 

BTW, the problem I was having getting the Maven2 Integration with

Eclipse working (0.0.9) was also caused by my $HOME environment

variable (= C:/wstewart) being different than the default value

of the Java system property 'user.home'

(= C:Documents and Settingswstewart) because of using CygWin

on Windows XP. Best practice for Unix is to try to keep spaces

out of directory and file names, so it may not be that unusual

for CygWin users to rename their $HOME directory to be more

"Unix-ish" (no spaces, shorter, all lower case). The solution

was to set -Duser.home=$HOME in the 'mvn' shell script and

-Duser.home=C:wstewart in eclipse.ini. I can now build

JasperReports from sources using Maven2 both inside Eclipse

(for debugging) or outside Eclipse using command-line 'mvn' in

CygWin bash.

 

Some people commented that they were having problems running the

tests. This is because 'mvn install' drops and rebuilds the

metadata database (apparently regardless of the setting of

"metadata.database.generate" in settings.xml), leaving the

database empty of any metadata. My work-around was to let

Hibernate drop and create the schema with the "mvn install" that

fails the tests, then load the 'jasperserver' (metadata) database

with the sample metadata, after applying the following two

patches:

 

bash-3.00$ diff -u scripts/jasperserverCreateDefaultSecurity.sql{.orig,}

--- scripts/jasperserverCreateDefaultSecurity.sql.orig 2006-04-23 05:42:32.000000000 -0700

+++ scripts/jasperserverCreateDefaultSecurity.sql 2006-06-05 12:11:30.940952000 -0700

@@ -11,7 +11,7 @@

select u.id, r.id from User u, Role r where u.username = 'anonymousUser' and r.roleName = 'ROLE_ANONYMOUS';

 

INSERT INTO `User` (`username`,`fullname`,`emailAddress`,`password`,`externallyDefined`,`enabled`) VALUES

- ('jasperadmin','Jasper Administrator',NULL,'newPassword',0,1);

+ ('jasperadmin','Jasper Administrator',NULL,'jasperadmin',0,1);

 

INSERT INTO `UserRole` (`userId`,`roleId`)

select u.id, r.id from User u, Role r where u.username = 'jasperadmin' and r.roleName = 'ROLE_ADMINISTRATOR';

bash-3.00$ diff -u scripts/jasperserverTestMetadata.sql{.orig,}

--- scripts/jasperserverTestMetadata.sql.orig 2006-04-23 11:49:18.000000000 -0700

+++ scripts/jasperserverTestMetadata.sql 2006-06-20 15:18:40.071072300 -0700

@@ -74,7 +74,7 @@

 

/*!40000 ALTER TABLE `JdbcDatasource` DISABLE KEYS */;

INSERT INTO `JdbcDatasource` (`id`,`driver`,`password`,`connectionUrl`,`username`) VALUES

- (3,'com.mysql.jdbc.Driver','MyRootPwd','jdbc:mysql://localhost/sugarcrm','root');

+ (3,'com.mysql.jdbc.Driver','jasperadmin','jdbc:mysql://localhost/sugarcrm','jasperadmin');

/*!40000 ALTER TABLE `JdbcDatasource` ENABLE KEYS */;

 

 

 

as well as load the 'sugarcrm' database with the sample data provided.

After also making the following change:

 

bash-3.00$ diff -u jasperserver-api-impl/metadata/pom.xml{.orig,}

--- jasperserver-api-impl/metadata/pom.xml.orig 2006-06-13 19:52:09.624312000 -0700

+++ jasperserver-api-impl/metadata/pom.xml 2006-06-20 16:02:25.361340300 -0700

@@ -191,6 +191,7 @@

</fileset>

</configuration>

<hbm2ddl

+ export="false"

drop="true"

create="true"

outputfilename="jasperserverCreate.ddl"

 

 

I can then run "mvn install" (which will leave the databases alone).

All the tests will pass and it will finish building and installing

everything.

 

The document, "JasperServer-Source-Code-Build-Guide.pdf", is pretty

disconnected from reality on this score. It refers to a database,

'foodmart' and script, 'FoodMart-MySQL-032006.sql', that appear to

no longer be used. It also has the reader running maven commands

from directories that don't exist:

 

cd jasperserver/trunk/jasperserver-repository-hibernate/build-db

mvn install

cd jasperserver/trunk/jasperserver-unit-test

mvn install

 

 

As for my latest experience with Maven2:

 

 

I read the documentation for the maven-compiler-plugin, so

I just don't understand why:

 

mvn -Dmaven.compiler.compilerId="schpliz" compile

 

gives me an expected error:

 

"No such compiler 'schpliz'."

 

but:

 

mvn -Dmaven.compiler.fork=true -Dmaven.compiler.executable="schpliz" compile

 

goes ahead and compiles my project as though I hadn't entered any

properties at all. ("schpliz" does not exist in either case.)

 

mvn -Dmaven.compiler.noSuchProperty=true compile

 

gives me a successful build as well.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...