[javapackages] [doc] Few words about classpath
by Michal Srb
commit f1df502c63a02a9a0c8434069f725bc50a9c4a68
Author: Michal Srb <msrb(a)redhat.com>
Date: Wed Nov 6 13:15:52 2013 +0100
[doc] Few words about classpath
doc/introduction_for_packagers.txt | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/doc/introduction_for_packagers.txt b/doc/introduction_for_packagers.txt
index 4f2a33f..59682b7 100644
--- a/doc/introduction_for_packagers.txt
+++ b/doc/introduction_for_packagers.txt
@@ -84,6 +84,32 @@ all Java applications have to use wrapper shell scripts to setup the environment
before invoking the JVM and running the application itself. Note that this is
not necessary for libraries.
+[[classpath]]
+==== Class path
+
+The class path is a way of telling JVM where to look for user classes
+and 3rd party libraries. By default, only current directory is searched,
+all other locations need to be specified explicitly by setting up
+CLASSPATH environment variable, or via `-cp` (`-classpath`) option of a
+Java Virtual Machine.
+
+.Setting the class path
+[source,shell]
+------
+java -cp /usr/share/java/log4j.jar:/usr/share/java/junit.jar mypackage/MyClass.class
+CLASSPATH=/usr/share/java/log4j.jar:/usr/share/java/junit.jar java mypackage/MyClass.class
+------
+
+Please note that two JAR files are separated by colon in a class path
+definition.
+
+[TIP]
+======
+See
+http://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.html[official
+documentation] for more information about class path.
+======
+
==== Build System Identification
How to determine preferred upstream build system
TODO - write content
10 years, 6 months
[javapackages] [doc] Add anchor for pom_remove_dep macro
by Michal Srb
commit 8eb27551f687d2f76a892640996db5a9e1ec6110
Author: Michal Srb <msrb(a)redhat.com>
Date: Wed Nov 6 11:10:39 2013 +0100
[doc] Add anchor for pom_remove_dep macro
doc/pom_macros.txt | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/doc/pom_macros.txt b/doc/pom_macros.txt
index f46840e..71df481 100644
--- a/doc/pom_macros.txt
+++ b/doc/pom_macros.txt
@@ -11,6 +11,7 @@ for technical details how to use them. Below are some examples added for
convenience.
+[[pom_remove_dep]]
Often dependencies specified in Maven `pom.xml` files need to be removed because
of different reasons. `%pom_remove_dep` macro can be used to ease this task:
10 years, 6 months
[javapackages] [doc] Add anchor for compat packages section
by Michal Srb
commit aa1973b142ee3b916577749514a216ca25e89b81
Author: Michal Srb <msrb(a)redhat.com>
Date: Wed Nov 6 11:10:06 2013 +0100
[doc] Add anchor for compat packages section
doc/jar_file_id.txt | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/doc/jar_file_id.txt b/doc/jar_file_id.txt
index dadece9..26a3859 100644
--- a/doc/jar_file_id.txt
+++ b/doc/jar_file_id.txt
@@ -22,5 +22,6 @@ include::jar_file_id_artifact.txt[]
==== Aliases
include::jar_file_id_aliases.txt[]
+[[compat_packages]]
==== Compatibility versions
include::jar_file_id_compat.txt[]
10 years, 6 months
[javapackages] [doc] Fixes in "Packaging Maven project" section
by Michal Srb
commit 76cd15a20bc35d6ae28f196a4c8969bcf8b32c99
Author: Michal Srb <msrb(a)redhat.com>
Date: Wed Nov 6 11:09:14 2013 +0100
[doc] Fixes in "Packaging Maven project" section
doc/packaging_maven_project.txt | 41 ++++++--------------------------------
1 files changed, 7 insertions(+), 34 deletions(-)
---
diff --git a/doc/packaging_maven_project.txt b/doc/packaging_maven_project.txt
index 9971175..2f206bc 100644
--- a/doc/packaging_maven_project.txt
+++ b/doc/packaging_maven_project.txt
@@ -29,25 +29,12 @@ By default, resulting JAR files will be installed in `%{_javadir}/%{name}`,
therefore package needs to own this directory.
The build could fail from many reasons, but one probably most common is
-following one:
+build failure due to <<error_missing_dependency,missing dependencies>>
-------
-[ERROR] Failed to execute goal on project simplemaven: Could not resolve
-dependencies for project com.example:simplemaven:jar:1.0: The following
-artifacts could not be resolved: commons-io:commons-io:jar:2.4,
-junit:junit:jar:4.11: Cannot access central
-(http://repo.maven.apache.org/maven2) in offline mode and the artifact
-commons-io:commons-io:jar:2.4 has not been downloaded from it before. -> [Help
-1]
-------
-
-
-The error message above is self-explanatory. Maven couldn't find some dependencies and
-therefore it wasn't able to build the package. We can try to remove
-these missing dependencies from pom.xml and make Maven stop complaining about
-them. However, these removed dependencies may be crucial for building of the
-project and therefore it may be needed to package them later.
-Let's remove the dependencies from `pom.xml`.
+We can try to remove these missing dependencies from pom.xml and make Maven
+stop complaining about them. However, these removed dependencies may be crucial
+for building of the project and therefore it may be needed to package them
+later. Let's remove the dependencies from `pom.xml`.
.Remove dependencies from pom.xml
@@ -65,22 +52,8 @@ Let's remove the dependencies from `pom.xml`.
Package maintainer can use a wide variety of "`pom_`" macros for modifying
`pom.xml` files. See <<helper_macros, Macros for POM modification>> section for more information.
-Now try to build the project again.
-
-------
-[ERROR] Failed to execute goal
- org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
- on project simplemaven: Compilation failure: Compilation failure:
-[ERROR]
-/builddir/build/BUILD/simplemaven-1.0/src/main/java/com/example/Main.java:[3,29]
-package org.apache.commons.io does not exist
-[ERROR]
-/builddir/build/BUILD/simplemaven-1.0/src/main/java/com/example/Main.java:[8,9]
-cannot find symbol
-[ERROR] symbol: class FileUtils
-[ERROR] location: class com.example.Main
-[ERROR] -> [Help 1]
-------
+Now try to build the project again. The build will fail with
+<<error_compilation_failure,compilation failure>>.
Oops, another problem. This time Maven thought it had all the necessary dependenices, but Java
compiler thinks otherwise.
10 years, 6 months
[javapackages] [doc] Add initial text for "Common Errors" section
by Michal Srb
commit 3675daa8f25ad27ed28f683c692e0f322ed9445b
Author: Michal Srb <msrb(a)redhat.com>
Date: Wed Nov 6 11:07:46 2013 +0100
[doc] Add initial text for "Common Errors" section
doc/common_errors.txt | 106 +++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 103 insertions(+), 3 deletions(-)
---
diff --git a/doc/common_errors.txt b/doc/common_errors.txt
index 5711fe9..5085f5f 100644
--- a/doc/common_errors.txt
+++ b/doc/common_errors.txt
@@ -1,4 +1,104 @@
-Examples of common errors encountered during packaging, their explanations and
-possible solutions and/or workarounds
+This section contains explanations and solutions/workarounds for common
+errors which can be encountered during packaging.
-WORK IN PROGRESS - msrb
+[[error_missing_dependency]]
+=== Missing dependency
+
+------
+[ERROR] Failed to execute goal on project simplemaven: Could not resolve
+dependencies for project com.example:simplemaven:jar:1.0: The following
+artifacts could not be resolved: commons-io:commons-io:jar:2.4,
+junit:junit:jar:4.11: Cannot access central
+(http://repo.maven.apache.org/maven2) in offline mode and the artifact
+commons-io:commons-io:jar:2.4 has not been downloaded from it before. -> [Help
+1]
+------
+
+Maven wasn't able to build project `com.example:simplemaven`, because it
+couldn't find some dependencies (in this case
+`commons-io:commons-io:jar:2.4` and `junit:junit:jar:4.11`)
+
+Package maintainer has two options here:
+
+ - find out which packages provide given dependencies and add them to
+ `BuildRequires` in the spec file. Use `repoquery -f
+ 'mvn(commons-io:commons-io)'` to search for package which provides
+ given artifact.
+
+ - remove those dependencies from `pom.xml` file. Maven will stop
+ complaining about them and some dependencies don't have to be
+ mandatory for project to build. Maintainer can use wide variety of
+ <<helper_macros,macros>> for modifying POM files. The one
+ for removing dependencies is called
+ <<pom_remove_dep,%pom_remove_dep>>. If removed dependency was
+ actually needed, the build will later fail with compilation failure.
+
+
+[[error_compilation_failure]]
+=== Compilation failure
+
+------
+[ERROR] Failed to execute goal
+ org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
+ on project simplemaven: Compilation failure: Compilation failure:
+[ERROR]
+/builddir/build/BUILD/simplemaven-1.0/src/main/java/com/example/Main.java:[3,29]
+package org.apache.commons.io does not exist
+[ERROR]
+/builddir/build/BUILD/simplemaven-1.0/src/main/java/com/example/Main.java:[8,9]
+cannot find symbol
+[ERROR] symbol: class FileUtils
+[ERROR] location: class com.example.Main
+[ERROR] -> [Help 1]
+------
+
+Java compiler couldn't find given class on classpath or incompatible
+version was present. This could be caused by following reasons:
+
+ - `pom.xml` requires different version of Maven artifact than local
+ repository provides
+ - `pom.xml` is missing necessary dependency
+
+Different versions of same library may provide slightly different API.
+This means that project doesn't have to be buildable if different
+version is provided. If the library in local repository is older than
+the one required by project, then the library could be updated. If the
+project requires older version, then the project should be ported to
+latest stable version of the library (this may require cooperation with
+project's upstream). If none of these is possible from some reason, it
+is still possible to introduce new `compat` package. See
+<<compat_packages,compat packages>> section for more information on this
+topic.
+
+Sometimes `pom.xml` doesn't list all the necessary dependencies, even if
+it should. Dependencies can also depend on some other and typically all
+these will be available to the project which is being built. The problem
+is that local repository may contain different versions of these
+dependencies. And even if these versions are fully compatible with the
+project, they may require slightly different set of dependencies. This
+could lead to build failure if `pom.xml` doesn't specify all necessary
+dependencies and relies on transitive dependencies. Such a missing
+dependency may be considered a bug in the project. The solution is to
+explicitly add missing dependency to the `pom.xml`. This may be easily
+done by using `%pom_add_dep` macro. See section about
+<<helper_macros,macros for POM modification>> for more information.
+
+[[error_requires_unknown]]
+=== Requires cannot be generated
+
+------
+Following dependencies were not resolved and requires cannot be generated. Either remove the dependency from pom.xml or add proper packages to BuildRequires:
+org.apache.maven.doxia:doxia-core::tests:UNKNOWN
+------
+
+[[error_scope_system]]
+=== Dependencies with scope "system"
+
+------
+[ERROR] Failed to execute goal
+org.fedoraproject.xmvn:xmvn-mojo:1.2.0:install (default-cli) on project
+pom: Some reactor artifacts have dependencies with scope "system". Such
+dependencies are not supported by XMvn installer. You should either
+remove any dependencies with scope "system" before the build or not run
+XMvn instaler. -> [Help 1]
+------
10 years, 6 months
[javapackages] [doc] TODO: write "Build System Identification"
by Michal Srb
commit 123225d39c0214fa0db5dac146200f30cb72cf4d
Author: Michal Srb <msrb(a)redhat.com>
Date: Wed Nov 6 11:03:33 2013 +0100
[doc] TODO: write "Build System Identification"
doc/introduction_for_packagers.txt | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/doc/introduction_for_packagers.txt b/doc/introduction_for_packagers.txt
index 6482855..4f2a33f 100644
--- a/doc/introduction_for_packagers.txt
+++ b/doc/introduction_for_packagers.txt
@@ -86,6 +86,7 @@ not necessary for libraries.
==== Build System Identification
How to determine preferred upstream build system
+TODO - write content
==== Quiz for Packagers
10 years, 6 months
[springframework-batch/f20] use manual installation on F20
by gil
commit 76f45c70eb78a58d664b783d745d850501a42af2
Author: gil <puntogil(a)libero.it>
Date: Wed Nov 6 22:56:19 2013 +0100
use manual installation on F20
springframework-batch.spec | 87 +++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 85 insertions(+), 2 deletions(-)
---
diff --git a/springframework-batch.spec b/springframework-batch.spec
index 37a7bbc..edb8113 100644
--- a/springframework-batch.spec
+++ b/springframework-batch.spec
@@ -4,7 +4,7 @@
%global with_vpp 0
Name: springframework-batch
Version: 2.1.9
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Tools for enterprise batch or bulk processing
License: ASL 2.0
URL: http://www.springsource.org/spring-batch
@@ -15,6 +15,7 @@ BuildRequires: java-devel
BuildRequires: hibernate3
BuildRequires: hibernate3-entitymanager
+BuildRequires: mvn(cglib:cglib)
BuildRequires: mvn(com.h2database:h2)
BuildRequires: mvn(com.thoughtworks.xstream:xstream)
BuildRequires: mvn(commons-collections:commons-collections)
@@ -30,7 +31,6 @@ BuildRequires: mvn(javax.mail:mail)
BuildRequires: mvn(javax.persistence:persistence-api)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(log4j:log4j)
-BuildRequires: mvn(net.sf.cglib:cglib)
BuildRequires: mvn(org.aspectj:aspectjweaver)
BuildRequires: mvn(org.easymock:easymock)
BuildRequires: mvn(org.eclipse.gemini.blueprint:gemini-blueprint-core)
@@ -66,6 +66,47 @@ BuildRequires: maven-antrun-plugin
BuildRequires: foundrylogic-vpp
%endif
+%if %{?fedora} == 20
+Requires: hibernate3
+Requires: hibernate3-entitymanager
+Requires: mvn(cglib:cglib)
+Requires: mvn(com.h2database:h2)
+Requires: mvn(com.thoughtworks.xstream:xstream)
+Requires: mvn(commons-collections:commons-collections)
+Requires: mvn(commons-dbcp:commons-dbcp)
+Requires: mvn(commons-io:commons-io)
+%if %{?fedora} > 19
+Requires: mvn(hsqldb:hsqldb:1)
+%else
+Requires: mvn(hsqldb:hsqldb)
+%endif
+Requires: mvn(javax.mail:mail)
+#Requires: geronimo-jpa
+Requires: mvn(javax.persistence:persistence-api)
+Requires: mvn(junit:junit)
+Requires: mvn(log4j:log4j)
+Requires: mvn(org.aspectj:aspectjweaver)
+Requires: mvn(org.easymock:easymock)
+Requires: mvn(org.eclipse.gemini.blueprint:gemini-blueprint-core)
+Requires: mvn(org.apache.felix:org.osgi.core)
+Requires: mvn(org.apache.geronimo.specs:geronimo-jms_1.1_spec)
+Requires: mvn(org.apache.geronimo.specs:geronimo-jta_1.1_spec)
+Requires: mvn(org.codehaus.jackson:jackson-mapper-asl)
+Requires: mvn(org.codehaus.jettison:jettison)
+Requires: mvn(org.codehaus.woodstox:woodstox-core-asl)
+Requires: mvn(org.slf4j:slf4j-log4j12)
+Requires: mvn(org.springframework:spring-aop)
+Requires: mvn(org.springframework:spring-beans)
+Requires: mvn(org.springframework:spring-context)
+Requires: mvn(org.springframework:spring-context-support)
+Requires: mvn(org.springframework:spring-core)
+Requires: mvn(org.springframework:spring-jdbc)
+Requires: mvn(org.springframework:spring-jms)
+Requires: mvn(org.springframework:spring-orm)
+Requires: mvn(org.springframework:spring-tx)
+Requires: mvn(org.springframework.ws:spring-ws-core)
+%endif
+
BuildArch: noarch
%description
@@ -278,15 +319,57 @@ rm -r spring-batch-test/src/main/java/org/springframework/batch/test/StepScopeTe
%mvn_build -f
%install
+%if %{?fedora} != 20
%mvn_install
+%else
+mkdir -p %{buildroot}%{_javadir}/%{name}
+install -m 644 %{oname}-core/target/%{oname}-core-%{namedversion}.jar \
+ %{buildroot}%{_javadir}/%{name}/%{oname}-core.jar
+install -m 644 %{oname}-infrastructure/target/%{oname}-infrastructure-%{namedversion}.jar \
+ %{buildroot}%{_javadir}/%{name}/%{oname}-infrastructure.jar
+install -m 644 %{oname}-test/target/%{oname}-test-%{namedversion}.jar \
+ %{buildroot}%{_javadir}/%{name}/%{oname}-test.jar
+
+mkdir -p %{buildroot}%{_mavenpomdir}
+install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{oname}.pom
+%add_maven_depmap JPP.%{name}-%{oname}.pom
+install -pm 644 %{oname}-parent/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{oname}-parent.pom
+%add_maven_depmap JPP.%{name}-%{oname}-parent.pom
+
+install -pm 644 %{oname}-core/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{oname}-core.pom
+%add_maven_depmap JPP.%{name}-%{oname}-core.pom %{name}/%{oname}-core.jar
+install -pm 644 %{oname}-infrastructure/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{oname}-infrastructure.pom
+%add_maven_depmap JPP.%{name}-%{oname}-infrastructure.pom %{name}/%{oname}-infrastructure.jar
+install -pm 644 %{oname}-test/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{oname}-test.pom
+%add_maven_depmap JPP.%{name}-%{oname}-test.pom %{name}/%{oname}-test.jar
+
+mkdir -p %{buildroot}%{_javadocdir}/%{name}
+cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
+%endif
+
+%if %{?fedora} != 20
%files -f .mfiles
+%else
+%files
+%{_javadir}/%{name}/%{oname}-*.jar
+%{_mavenpomdir}/JPP.%{name}-%{oname}*.pom
+%{_mavendepmapfragdir}/%{name}
+%endif
%dir %{_javadir}/%{name}
%doc README.md license.txt notice.txt
+%if %{?fedora} != 20
%files javadoc -f .mfiles-javadoc
+%else
+%files javadoc
+%{_javadocdir}/%{name}
+%endif
%doc license.txt notice.txt
%changelog
+* Wed Nov 06 2013 gil cattaneo <puntogil(a)libero.it> 2.1.9-2
+- use manual installation on F20
+
* Thu Nov 29 2012 gil cattaneo <puntogil(a)libero.it> 2.1.9-1
- initial rpm
\ No newline at end of file
10 years, 6 months
[felix-scr-annotations/f20] fix requires on F20
by gil
commit 158d2ee1699dab10e962a1e735e2e22821959dc3
Author: gil <puntogil(a)libero.it>
Date: Wed Nov 6 22:44:06 2013 +0100
fix requires on F20
felix-scr-annotations.spec | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/felix-scr-annotations.spec b/felix-scr-annotations.spec
index 92459bc..c2bf1db 100644
--- a/felix-scr-annotations.spec
+++ b/felix-scr-annotations.spec
@@ -2,7 +2,7 @@
%global bundle org.apache.felix.scr.annotations
Name: felix-scr-annotations
Version: 1.9.6
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Annotations for SCR
License: ASL 2.0
URL: http://felix.apache.org/
@@ -78,6 +78,9 @@ cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%doc LICENSE NOTICE
%changelog
+* Wed Nov 06 2013 gil cattaneo <puntogil(a)libero.it> 1.9.6-4
+- fix requires on F20
+
* Wed Nov 06 2013 gil cattaneo <puntogil(a)libero.it> 1.9.6-3
- use manual installation on F20
10 years, 6 months
[thredds/f20] use manual installation on F20
by gil
commit ef6287339ecd7a171a2b9e732ecd032a6ceca171
Author: gil <puntogil(a)libero.it>
Date: Wed Nov 6 22:40:58 2013 +0100
use manual installation on F20
thredds.spec | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/thredds.spec b/thredds.spec
index f9be7af..9d452e8 100644
--- a/thredds.spec
+++ b/thredds.spec
@@ -79,7 +79,7 @@ in a similarly convenient fashion.
%package -n netcdf-java
Summary: Java interface to NetCDF files
BuildArch: noarch
-%if %{?fedora} != 20
+%if %{?fedora} == 20
Requires: mvn(com.google.protobuf:protobuf-java)
Requires: mvn(com.sleepycat:je)
Requires: mvn(joda-time:joda-time) >= 2.0
10 years, 6 months
[felix-scr-annotations/f20] use manual installation on F20
by gil
commit 590dbc47f5a9d596bca072d8ed9c303337eaf943
Author: gil <puntogil(a)libero.it>
Date: Wed Nov 6 22:40:22 2013 +0100
use manual installation on F20
felix-scr-annotations.spec | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/felix-scr-annotations.spec b/felix-scr-annotations.spec
index ad19104..92459bc 100644
--- a/felix-scr-annotations.spec
+++ b/felix-scr-annotations.spec
@@ -18,7 +18,7 @@ BuildRequires: maven-surefire-plugin
# i dont know which package as missing this required...
BuildRequires: mvn(org.mockito:mockito-all)
-%if %{?fedora} != 20
+%if %{?fedora} == 20
Requires: mvn(org.apache.felix:org.apache.felix.scr.generator)
%endif
10 years, 6 months